领料关联库管
This commit is contained in:
parent
ca817bb3ab
commit
3680bf221a
|
|
@ -212,6 +212,9 @@ public class ArchivesServiceImpl implements ArchivesService {
|
|||
* @return
|
||||
*/
|
||||
private boolean isNameDuplicate(ArchivesDetails archivesDetails) {
|
||||
archivesDetails.setLevel(StringUtils.isNotBlank(archivesDetails.getLevel())
|
||||
? String.valueOf(Integer.parseInt(archivesDetails.getLevel()) + 1)
|
||||
: "1");
|
||||
ArchivesDetails info = archivesMapper.selectDetailsByName(archivesDetails);
|
||||
return info != null;
|
||||
}
|
||||
|
|
@ -224,8 +227,7 @@ public class ArchivesServiceImpl implements ArchivesService {
|
|||
@Override
|
||||
public AjaxResult updateDetails(ArchivesDetails archivesDetails) {
|
||||
// 根据类型名称和上级id查询,同级下名称不能重复
|
||||
ArchivesDetails info = archivesMapper.selectDetailsByName(archivesDetails);
|
||||
if (info != null && !archivesDetails.getDetailsId().equals(info.getDetailsId())) {
|
||||
if (isNameDuplicate(archivesDetails)) {
|
||||
return AjaxResult.error(HttpCodeEnum.NAME_DUPLICATE.getCode(), HttpCodeEnum.NAME_DUPLICATE.getMsg());
|
||||
}
|
||||
archivesDetails.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
|
|
|||
|
|
@ -96,6 +96,9 @@ public class LeaseApplyDetails extends BaseEntity {
|
|||
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "编码类型集合")
|
||||
private List<MaCodeVo> maCodeVoList;
|
||||
|
||||
|
|
@ -112,8 +115,9 @@ public class LeaseApplyDetails extends BaseEntity {
|
|||
|
||||
public LeaseApplyDetails() {}
|
||||
|
||||
public LeaseApplyDetails(Long parentId, String keyword) {
|
||||
public LeaseApplyDetails(Long parentId, String keyword, Long userId) {
|
||||
this.parentId = parentId;
|
||||
this.keyword = keyword;
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,8 @@ public interface LeaseApplyDetailsMapper {
|
|||
/**
|
||||
* 获取领料出库单详情
|
||||
* @param id
|
||||
* @param userId
|
||||
* @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 领料任务
|
||||
*/
|
||||
LeaseApplyInfo selectLeaseApplyInfoById(Long id);
|
||||
LeaseApplyInfo selectLeaseApplyInfoById(LeaseApplyInfo leaseApplyInfo);
|
||||
|
||||
/**
|
||||
* 查询领料任务列表
|
||||
|
|
|
|||
|
|
@ -77,13 +77,17 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
@Override
|
||||
public LeaseApplyRequestVo selectLeaseApplyInfoById(Long id, String keyword) {
|
||||
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();
|
||||
|
||||
optionalInfo.ifPresent(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)) {
|
||||
leaseApplyRequestVo.setLeaseApplyDetailsList(details);
|
||||
for (LeaseApplyDetails detail : details) {
|
||||
|
|
@ -114,10 +118,11 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
|
||||
leaseApplyInfo.setUserId(SecurityUtils.getUserId());
|
||||
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
||||
for (LeaseApplyInfo applyInfo : list) {
|
||||
/*for (LeaseApplyInfo applyInfo : list) {
|
||||
applyInfo.setMaTypeNames(leaseApplyDetailsMapper.selectMaTypeNameByParentId(applyInfo.getId()));
|
||||
}
|
||||
}*/
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -317,7 +322,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
*/
|
||||
@Override
|
||||
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
|
||||
public LeaseApplyRequestVo getInfo(Long id) {
|
||||
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();
|
||||
|
||||
optionalInfo.ifPresent(info -> {
|
||||
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
||||
// 获取领料单详情
|
||||
List<LeaseOutVo> details = leaseApplyDetailsMapper.selectLeaseOutDetailsList(id);
|
||||
List<LeaseOutVo> details = leaseApplyDetailsMapper.selectLeaseOutDetailsList(id, userId);
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
leaseApplyRequestVo.setLeaseOutVoList(details);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="infoId != null">
|
||||
and info_id = #{infoId}
|
||||
</if>
|
||||
<if test="level != null">
|
||||
and level = #{level}
|
||||
</if>
|
||||
<if test="detailsId != null">
|
||||
and parent_id = #{detailsId}
|
||||
</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
|
||||
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
|
||||
<if test="userId != null">
|
||||
JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id = #{userId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<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 lease_apply_details lad ON lod.type_id = lad.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}
|
||||
GROUP BY lod.type_id, mm.ma_code
|
||||
</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,
|
||||
sda.dict_label as taskStatusName,
|
||||
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
|
||||
lease_apply_info lai
|
||||
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 sys_dict_data sda on tt.task_status = sda.dict_value
|
||||
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>
|
||||
|
||||
<select id="selectLeaseApplyInfoList" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo" resultMap="LeaseApplyInfoResult">
|
||||
|
|
|
|||
Loading…
Reference in New Issue