领料关联库管
This commit is contained in:
parent
ca817bb3ab
commit
3680bf221a
|
|
@ -212,6 +212,9 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean isNameDuplicate(ArchivesDetails archivesDetails) {
|
private boolean isNameDuplicate(ArchivesDetails archivesDetails) {
|
||||||
|
archivesDetails.setLevel(StringUtils.isNotBlank(archivesDetails.getLevel())
|
||||||
|
? String.valueOf(Integer.parseInt(archivesDetails.getLevel()) + 1)
|
||||||
|
: "1");
|
||||||
ArchivesDetails info = archivesMapper.selectDetailsByName(archivesDetails);
|
ArchivesDetails info = archivesMapper.selectDetailsByName(archivesDetails);
|
||||||
return info != null;
|
return info != null;
|
||||||
}
|
}
|
||||||
|
|
@ -224,8 +227,7 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult updateDetails(ArchivesDetails archivesDetails) {
|
public AjaxResult updateDetails(ArchivesDetails archivesDetails) {
|
||||||
// 根据类型名称和上级id查询,同级下名称不能重复
|
// 根据类型名称和上级id查询,同级下名称不能重复
|
||||||
ArchivesDetails info = archivesMapper.selectDetailsByName(archivesDetails);
|
if (isNameDuplicate(archivesDetails)) {
|
||||||
if (info != null && !archivesDetails.getDetailsId().equals(info.getDetailsId())) {
|
|
||||||
return AjaxResult.error(HttpCodeEnum.NAME_DUPLICATE.getCode(), HttpCodeEnum.NAME_DUPLICATE.getMsg());
|
return AjaxResult.error(HttpCodeEnum.NAME_DUPLICATE.getCode(), HttpCodeEnum.NAME_DUPLICATE.getMsg());
|
||||||
}
|
}
|
||||||
archivesDetails.setUpdateBy(SecurityUtils.getUsername());
|
archivesDetails.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,9 @@ public class LeaseApplyDetails extends BaseEntity {
|
||||||
|
|
||||||
private String keyword;
|
private String keyword;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "编码类型集合")
|
@ApiModelProperty(value = "编码类型集合")
|
||||||
private List<MaCodeVo> maCodeVoList;
|
private List<MaCodeVo> maCodeVoList;
|
||||||
|
|
||||||
|
|
@ -112,8 +115,9 @@ public class LeaseApplyDetails extends BaseEntity {
|
||||||
|
|
||||||
public LeaseApplyDetails() {}
|
public LeaseApplyDetails() {}
|
||||||
|
|
||||||
public LeaseApplyDetails(Long parentId, String keyword) {
|
public LeaseApplyDetails(Long parentId, String keyword, Long userId) {
|
||||||
this.parentId = parentId;
|
this.parentId = parentId;
|
||||||
this.keyword = keyword;
|
this.keyword = keyword;
|
||||||
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,8 @@ public interface LeaseApplyDetailsMapper {
|
||||||
/**
|
/**
|
||||||
* 获取领料出库单详情
|
* 获取领料出库单详情
|
||||||
* @param id
|
* @param id
|
||||||
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<LeaseOutVo> selectLeaseOutDetailsList(Long id);
|
List<LeaseOutVo> selectLeaseOutDetailsList(@Param("id") Long id, @Param("userId") Long userId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,10 @@ public interface LeaseApplyInfoMapper {
|
||||||
/**
|
/**
|
||||||
* 查询领料任务
|
* 查询领料任务
|
||||||
*
|
*
|
||||||
* @param id 领料任务主键
|
* @param leaseApplyInfo
|
||||||
* @return 领料任务
|
* @return 领料任务
|
||||||
*/
|
*/
|
||||||
LeaseApplyInfo selectLeaseApplyInfoById(Long id);
|
LeaseApplyInfo selectLeaseApplyInfoById(LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料任务列表
|
* 查询领料任务列表
|
||||||
|
|
|
||||||
|
|
@ -77,13 +77,17 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
@Override
|
@Override
|
||||||
public LeaseApplyRequestVo selectLeaseApplyInfoById(Long id, String keyword) {
|
public LeaseApplyRequestVo selectLeaseApplyInfoById(Long id, String keyword) {
|
||||||
try {
|
try {
|
||||||
Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(leaseApplyInfoMapper.selectLeaseApplyInfoById(id));
|
LeaseApplyInfo leaseApplyInfo = new LeaseApplyInfo();
|
||||||
|
leaseApplyInfo.setId(id);
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
leaseApplyInfo.setUserId(userId);
|
||||||
|
Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(leaseApplyInfoMapper.selectLeaseApplyInfoById(leaseApplyInfo));
|
||||||
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
|
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
|
||||||
|
|
||||||
optionalInfo.ifPresent(info -> {
|
optionalInfo.ifPresent(info -> {
|
||||||
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
||||||
// 获取领料单详情
|
// 获取领料单详情
|
||||||
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword));
|
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, userId));
|
||||||
if (!CollectionUtils.isEmpty(details)) {
|
if (!CollectionUtils.isEmpty(details)) {
|
||||||
leaseApplyRequestVo.setLeaseApplyDetailsList(details);
|
leaseApplyRequestVo.setLeaseApplyDetailsList(details);
|
||||||
for (LeaseApplyDetails detail : details) {
|
for (LeaseApplyDetails detail : details) {
|
||||||
|
|
@ -114,10 +118,11 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
|
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
|
||||||
|
leaseApplyInfo.setUserId(SecurityUtils.getUserId());
|
||||||
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
||||||
for (LeaseApplyInfo applyInfo : list) {
|
/*for (LeaseApplyInfo applyInfo : list) {
|
||||||
applyInfo.setMaTypeNames(leaseApplyDetailsMapper.selectMaTypeNameByParentId(applyInfo.getId()));
|
applyInfo.setMaTypeNames(leaseApplyDetailsMapper.selectMaTypeNameByParentId(applyInfo.getId()));
|
||||||
}
|
}*/
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -317,7 +322,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<LeaseApplyDetails> selectLeaseApplyDetailsList(LeaseApplyInfo leaseApplyInfo) {
|
public List<LeaseApplyDetails> selectLeaseApplyDetailsList(LeaseApplyInfo leaseApplyInfo) {
|
||||||
return leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(leaseApplyInfo.getId(), leaseApplyInfo.getKeyWord()));
|
return leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(leaseApplyInfo.getId(), leaseApplyInfo.getKeyWord(), leaseApplyInfo.getUserId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -350,13 +355,16 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
@Override
|
@Override
|
||||||
public LeaseApplyRequestVo getInfo(Long id) {
|
public LeaseApplyRequestVo getInfo(Long id) {
|
||||||
try {
|
try {
|
||||||
Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(leaseApplyInfoMapper.selectLeaseApplyInfoById(id));
|
LeaseApplyInfo leaseApplyInfo = new LeaseApplyInfo();
|
||||||
|
leaseApplyInfo.setId(id);
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(leaseApplyInfoMapper.selectLeaseApplyInfoById(leaseApplyInfo));
|
||||||
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
|
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
|
||||||
|
|
||||||
optionalInfo.ifPresent(info -> {
|
optionalInfo.ifPresent(info -> {
|
||||||
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
||||||
// 获取领料单详情
|
// 获取领料单详情
|
||||||
List<LeaseOutVo> details = leaseApplyDetailsMapper.selectLeaseOutDetailsList(id);
|
List<LeaseOutVo> details = leaseApplyDetailsMapper.selectLeaseOutDetailsList(id, userId);
|
||||||
if (!CollectionUtils.isEmpty(details)) {
|
if (!CollectionUtils.isEmpty(details)) {
|
||||||
leaseApplyRequestVo.setLeaseOutVoList(details);
|
leaseApplyRequestVo.setLeaseOutVoList(details);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="infoId != null">
|
<if test="infoId != null">
|
||||||
and info_id = #{infoId}
|
and info_id = #{infoId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="level != null">
|
||||||
|
and level = #{level}
|
||||||
|
</if>
|
||||||
<if test="detailsId != null">
|
<if test="detailsId != null">
|
||||||
and parent_id = #{detailsId}
|
and parent_id = #{detailsId}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||||
WHERE mm.ma_code is not null and mm.ma_status in (1)
|
WHERE mm.ma_code is not null and mm.ma_status in (1)
|
||||||
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
||||||
|
<if test="userId != null">
|
||||||
|
JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id = #{userId}
|
||||||
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectLeaseApplyDetailsList" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails" resultMap="LeaseApplyDetailsResult">
|
<select id="selectLeaseApplyDetailsList" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails" resultMap="LeaseApplyDetailsResult">
|
||||||
|
|
@ -295,6 +298,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
|
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
|
||||||
LEFT JOIN lease_apply_details lad ON lod.type_id = lad.type_id
|
LEFT JOIN lease_apply_details lad ON lod.type_id = lad.type_id
|
||||||
LEFT JOIN purchase_check_details pcd ON lod.type_id = pcd.type_id
|
LEFT JOIN purchase_check_details pcd ON lod.type_id = pcd.type_id
|
||||||
|
<if test="userId != null">
|
||||||
|
JOIN ma_type_keeper mtk ON mtk.type_id = lod.type_id AND mtk.user_id = #{userId}
|
||||||
|
</if>
|
||||||
WHERE lod.parent_id = #{id}
|
WHERE lod.parent_id = #{id}
|
||||||
GROUP BY lod.type_id, mm.ma_code
|
GROUP BY lod.type_id, mm.ma_code
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bai.unit_id,bai.project_id,bu.unit_name, bp.pro_name, bai.agreement_code, tt.task_status as taskStatus,
|
bai.unit_id,bai.project_id,bu.unit_name, bp.pro_name, bai.agreement_code, tt.task_status as taskStatus,
|
||||||
sda.dict_label as taskStatusName,
|
sda.dict_label as taskStatusName,
|
||||||
IFNULL(sum(lad.pre_num),0) as preCountNum,
|
IFNULL(sum(lad.pre_num),0) as preCountNum,
|
||||||
IFNULL(sum(lad.al_num),0) as alNum
|
IFNULL(sum(lad.al_num),0) as alNum,
|
||||||
|
GROUP_CONCAT(mt1.type_name) as maTypeNames
|
||||||
from
|
from
|
||||||
lease_apply_info lai
|
lease_apply_info lai
|
||||||
left join tm_task tt on lai.task_id = tt.task_id
|
left join tm_task tt on lai.task_id = tt.task_id
|
||||||
|
|
@ -57,6 +58,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join bm_project bp on bp.pro_id = bai.project_id
|
left join bm_project bp on bp.pro_id = bai.project_id
|
||||||
left join sys_dict_data sda on tt.task_status = sda.dict_value
|
left join sys_dict_data sda on tt.task_status = sda.dict_value
|
||||||
and sda.dict_type = 'lease_task_status'
|
and sda.dict_type = 'lease_task_status'
|
||||||
|
left join ma_type mt on lad.type_id = mt.type_id and mt.del_flag = '0'
|
||||||
|
left join ma_type mt1 on mt.parent_id = mt1.type_id and mt1.del_flag = '0'
|
||||||
|
<if test="userId != null">
|
||||||
|
JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id = #{userId}
|
||||||
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectLeaseApplyInfoList" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo" resultMap="LeaseApplyInfoResult">
|
<select id="selectLeaseApplyInfoList" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo" resultMap="LeaseApplyInfoResult">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue