新购优化

This commit is contained in:
mashuai 2025-06-15 13:52:25 +08:00
parent 02ae3b6c9c
commit e51cbaf4bc
8 changed files with 74 additions and 10 deletions

View File

@ -290,4 +290,7 @@ public class LeaseApplyInfo extends BaseEntity{
@ApiModelProperty(value = "发布批次") @ApiModelProperty(value = "发布批次")
private String publishTask; private String publishTask;
@ApiModelProperty(value = "有无电子签名 0 否1 是")
private Integer hasSign;
} }

View File

@ -80,4 +80,11 @@ public interface LeaseApplyInfoMapper {
* @return * @return
*/ */
List<LeaseApplyInfo> selectPublishList(LeaseApplyInfo leaseApplyInfo); List<LeaseApplyInfo> selectPublishList(LeaseApplyInfo leaseApplyInfo);
/**
* 查询待签名的领料单
* @param leaseApplyInfo
* @return
*/
List<LeaseApplyInfo> getNoSignList(LeaseApplyInfo leaseApplyInfo);
} }

View File

@ -175,7 +175,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
*/ */
@Override @Override
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) { public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
leaseApplyInfo.setUserId(SecurityUtils.getUserId()); leaseApplyInfo.setUserId(SecurityUtils.getLoginUser().getUserid());
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo); List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
// 如果statusList包含345则为领料出库查询需查询领用出库数据进行拼接 // 如果statusList包含345则为领料出库查询需查询领用出库数据进行拼接
if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) { if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
@ -196,6 +196,17 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
} }
} }
} }
if (!CollectionUtils.isEmpty(list)) {
if (leaseApplyInfo.getHasSign() != null && leaseApplyInfo.getHasSign() == 1) {
// 将list集合中leaseSignUrl不为null的数据过滤出来
list = list.stream()
.filter(info -> StringUtils.isNotBlank(info.getLeaseSignUrl()))
.collect(Collectors.toList());
} else if (leaseApplyInfo.getHasSign() != null && leaseApplyInfo.getHasSign() == 0) {
// 查询待签名的领料单
list = leaseApplyInfoMapper.getNoSignList(leaseApplyInfo);
}
}
// 使用 Stream API 进行降序排序 // 使用 Stream API 进行降序排序
List<LeaseApplyInfo> sortedList = list.stream() List<LeaseApplyInfo> sortedList = list.stream()
.sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime).reversed()) .sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime).reversed())

View File

@ -104,7 +104,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
} }
leaseApplyRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate()); leaseApplyRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate());
leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername()); leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername());
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getLoginUser().getUserid();
Long deptId = mapper.getDeptIdByUserId(userId); Long deptId = mapper.getDeptIdByUserId(userId);
LeaseDeptInfo leaseDeptInfo = new LeaseDeptInfo(); LeaseDeptInfo leaseDeptInfo = new LeaseDeptInfo();
leaseDeptInfo = mapper.getDeptIdByParentId(deptId); leaseDeptInfo = mapper.getDeptIdByParentId(deptId);
@ -321,7 +321,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
@Override @Override
public LeaseDeptInfo getCode() { public LeaseDeptInfo getCode() {
try { try {
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getLoginUser().getUserid();
Long deptId = mapper.getDeptIdByUserId(userId); Long deptId = mapper.getDeptIdByUserId(userId);
LeaseDeptInfo leaseDeptInfo = new LeaseDeptInfo(); LeaseDeptInfo leaseDeptInfo = new LeaseDeptInfo();
leaseDeptInfo = mapper.getDeptIdByParentId(deptId); leaseDeptInfo = mapper.getDeptIdByParentId(deptId);

View File

@ -172,10 +172,16 @@ public class IPartCheckInfoServiceImpl implements IPartCheckInfoService {
boolean notContainsNoFinished =!statusList.contains(publishedStatus); boolean notContainsNoFinished =!statusList.contains(publishedStatus);
boolean allReject = statusList.stream() boolean allReject = statusList.stream()
.allMatch(status -> status.equals(inProgressStatus)); .allMatch(status -> status.equals(inProgressStatus));
int res = 0;
if (notContainsNoFinished && !allReject) { if (notContainsNoFinished && !allReject) {
partArrivedMapper.updateTaskStatus(taskId, PurchaseTaskStatusEnum.TO_STORE.getStatus()); res = partArrivedMapper.updateTaskStatus(taskId, PurchaseTaskStatusEnum.TO_STORE.getStatus());
} else if (notContainsNoFinished && allReject) { } else if (notContainsNoFinished && allReject) {
partArrivedMapper.updateTaskStatus(taskId, PurchaseTaskStatusEnum.TO_CHECK_AFTER_REJECT.getStatus()); res = partArrivedMapper.updateTaskStatus(taskId, PurchaseTaskStatusEnum.TO_CHECK_AFTER_REJECT.getStatus());
}
if (res < 1) {
return AjaxResult.error("会签驳回失败");
} else {
return AjaxResult.success("会签驳回成功");
} }
} }
} }

View File

@ -186,8 +186,7 @@ public class PartArrivedServiceImpl implements IPartArrivedService
switch (partTypeQueryDto.getTaskStage()) { switch (partTypeQueryDto.getTaskStage()) {
case PURCHASE_TASK_STAGE_MANAGE: case PURCHASE_TASK_STAGE_MANAGE:
// 新购管理阶段展示全部任务不进行过滤 // 新购管理阶段展示全部任务不进行过滤
if (partTypeCheckInfos.get(i).getTaskStatus().equals(PurchaseTaskStatusEnum.TO_NOTICE.getStatus()) || if (partTypeCheckInfos.get(i).getTaskStatus().equals(PurchaseTaskStatusEnum.TO_NOTICE.getStatus())) {
partTypeCheckInfos.get(i).getTaskStatus().equals(PurchaseTaskStatusEnum.TO_CHECK_AFTER_REJECT.getStatus())) {
partTypeCheckInfos.get(i).setTaskStatusName("未完成"); partTypeCheckInfos.get(i).setTaskStatusName("未完成");
} else { } else {
partTypeCheckInfos.get(i).setTaskStatusName("已完成"); partTypeCheckInfos.get(i).setTaskStatusName("已完成");

View File

@ -328,8 +328,6 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
List<PurchaseSignRecord> purchaseSignRecordList = signProcessMapper.getPurchaseSignRecordByTask(purchaseCheckInfo.getTaskId()); List<PurchaseSignRecord> purchaseSignRecordList = signProcessMapper.getPurchaseSignRecordByTask(purchaseCheckInfo.getTaskId());
// 查询需要进行会签的org_id集合 // 查询需要进行会签的org_id集合
List<SignProcessVo> signProcessVoList = signProcessMapper.getList(new SignProcessVo()); List<SignProcessVo> signProcessVoList = signProcessMapper.getList(new SignProcessVo());
// 获取当前登录人组织id
Long loginUserDeptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if (!CollectionUtils.isEmpty(purchaseSignRecordList) && !CollectionUtils.isEmpty(signProcessVoList)) { if (!CollectionUtils.isEmpty(purchaseSignRecordList) && !CollectionUtils.isEmpty(signProcessVoList)) {
// 查询出配置需要会签的org_id集合 // 查询出配置需要会签的org_id集合
Set<Long> configSignOrgSet = signProcessVoList.stream().map(SignProcessVo::getOrgId).collect(Collectors.toSet()); Set<Long> configSignOrgSet = signProcessVoList.stream().map(SignProcessVo::getOrgId).collect(Collectors.toSet());
@ -613,6 +611,8 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
int addPurchaseSignResult = signProcessMapper.insertPurchaseSignRecord(purchaseSignRecord); int addPurchaseSignResult = signProcessMapper.insertPurchaseSignRecord(purchaseSignRecord);
if (addPurchaseSignResult < 1) { if (addPurchaseSignResult < 1) {
return AjaxResult.error("会签失败purchase_audit_record表插入0条数据"); return AjaxResult.error("会签失败purchase_audit_record表插入0条数据");
} else {
return AjaxResult.success("验收驳回成功");
} }
} }
} }

View File

@ -267,7 +267,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
IFNULL(lod.num, 0) AS alNum, IFNULL(lod.num, 0) AS alNum,
GROUP_CONCAT( DISTINCT mt1.type_name ) AS maTypeNames, GROUP_CONCAT( DISTINCT mt1.type_name ) AS maTypeNames,
lpd.publish_task AS publishTask, lpd.publish_task AS publishTask,
lai.task_id AS taskId lai.task_id AS taskId,
lai.lease_sign_url AS leaseSignUrl
FROM FROM
lease_publish_details lpd lease_publish_details lpd
LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id
@ -302,4 +303,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY ORDER BY
lpd.create_time DESC lpd.create_time DESC
</select> </select>
<select id="getNoSignList" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo" resultMap="LeaseApplyInfoResult">
<include refid="selectLeaseApplyInfoVo"/>
<where>
<if test="code != null and code != ''"> and lai.code = #{code}</if>
<if test="taskId != null "> and lai.task_id = #{taskId}</if>
<if test="leasePerson != null and leasePerson != ''"> and lai.lease_person = #{leasePerson}</if>
<if test="phone != null and phone != ''"> and lai.phone = #{phone}</if>
<if test="type != null and type != ''"> and lai.type = #{type}</if>
<if test="companyAuditBy != null "> and lai.company_audit_by = #{companyAuditBy}</if>
<if test="companyAuditTime != null "> and lai.company_audit_time = #{companyAuditTime}</if>
<if test="companyAuditRemark != null and companyAuditRemark != ''"> and lai.company_audit_remark = #{companyAuditRemark}</if>
<if test="deptAuditBy != null "> and lai.dept_audit_by = #{deptAuditBy}</if>
<if test="deptAuditTime != null "> and lai.dept_audit_time = #{deptAuditTime}</if>
<if test="deptAuditRemark != null and deptAuditRemark != ''"> and lai.dept_audit_remark = #{deptAuditRemark}</if>
<if test="directAuditBy != null "> and lai.direct_audit_by = #{directAuditBy}</if>
<if test="directAuditTime != null "> and lai.direct_audit_time = #{directAuditTime}</if>
<if test="directAuditRemark != null and directAuditRemark != ''"> and lai.direct_audit_remark = #{directAuditRemark}</if>
<if test="companyId != null "> and lai.company_id = #{companyId}</if>
<if test="statusList != null and statusList.size() > 0">
and tt.task_status in
<foreach item="item" collection="statusList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[ AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if>
<if test="directId != null "> and lai.direct_id = #{directId}</if>
<if test="leaseType != null and leaseType != ''"> and lai.lease_type = #{leaseType}</if>
<if test="estimateLeaseTime != null "> and lai.estimate_lease_time = #{estimateLeaseTime}</if>
<if test="costBearingParty != null and costBearingParty != ''"> and lai.cost_bearing_party = #{costBearingParty}</if>
and lai.lease_sign_url is null
</where>
GROUP BY lai.id
ORDER BY tt.task_status,tt.create_time desc
</select>
</mapper> </mapper>