新购优化
This commit is contained in:
parent
02ae3b6c9c
commit
e51cbaf4bc
|
|
@ -290,4 +290,7 @@ public class LeaseApplyInfo extends BaseEntity{
|
|||
|
||||
@ApiModelProperty(value = "发布批次")
|
||||
private String publishTask;
|
||||
|
||||
@ApiModelProperty(value = "有无电子签名 0 否,1 是")
|
||||
private Integer hasSign;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,4 +80,11 @@ public interface LeaseApplyInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
List<LeaseApplyInfo> selectPublishList(LeaseApplyInfo leaseApplyInfo);
|
||||
|
||||
/**
|
||||
* 查询待签名的领料单
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
List<LeaseApplyInfo> getNoSignList(LeaseApplyInfo leaseApplyInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
|
||||
leaseApplyInfo.setUserId(SecurityUtils.getUserId());
|
||||
leaseApplyInfo.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
||||
// 如果statusList包含3、4、5,则为领料出库查询,需查询领用出库数据,进行拼接
|
||||
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 进行降序排序
|
||||
List<LeaseApplyInfo> sortedList = list.stream()
|
||||
.sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime).reversed())
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
}
|
||||
leaseApplyRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate());
|
||||
leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername());
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
Long deptId = mapper.getDeptIdByUserId(userId);
|
||||
LeaseDeptInfo leaseDeptInfo = new LeaseDeptInfo();
|
||||
leaseDeptInfo = mapper.getDeptIdByParentId(deptId);
|
||||
|
|
@ -321,7 +321,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
@Override
|
||||
public LeaseDeptInfo getCode() {
|
||||
try {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
Long deptId = mapper.getDeptIdByUserId(userId);
|
||||
LeaseDeptInfo leaseDeptInfo = new LeaseDeptInfo();
|
||||
leaseDeptInfo = mapper.getDeptIdByParentId(deptId);
|
||||
|
|
|
|||
|
|
@ -172,10 +172,16 @@ public class IPartCheckInfoServiceImpl implements IPartCheckInfoService {
|
|||
boolean notContainsNoFinished =!statusList.contains(publishedStatus);
|
||||
boolean allReject = statusList.stream()
|
||||
.allMatch(status -> status.equals(inProgressStatus));
|
||||
int res = 0;
|
||||
if (notContainsNoFinished && !allReject) {
|
||||
partArrivedMapper.updateTaskStatus(taskId, PurchaseTaskStatusEnum.TO_STORE.getStatus());
|
||||
res = partArrivedMapper.updateTaskStatus(taskId, PurchaseTaskStatusEnum.TO_STORE.getStatus());
|
||||
} 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("会签驳回成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,8 +186,7 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
|||
switch (partTypeQueryDto.getTaskStage()) {
|
||||
case PURCHASE_TASK_STAGE_MANAGE:
|
||||
// 新购管理阶段展示全部任务、不进行过滤
|
||||
if (partTypeCheckInfos.get(i).getTaskStatus().equals(PurchaseTaskStatusEnum.TO_NOTICE.getStatus()) ||
|
||||
partTypeCheckInfos.get(i).getTaskStatus().equals(PurchaseTaskStatusEnum.TO_CHECK_AFTER_REJECT.getStatus())) {
|
||||
if (partTypeCheckInfos.get(i).getTaskStatus().equals(PurchaseTaskStatusEnum.TO_NOTICE.getStatus())) {
|
||||
partTypeCheckInfos.get(i).setTaskStatusName("未完成");
|
||||
} else {
|
||||
partTypeCheckInfos.get(i).setTaskStatusName("已完成");
|
||||
|
|
|
|||
|
|
@ -328,8 +328,6 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
List<PurchaseSignRecord> purchaseSignRecordList = signProcessMapper.getPurchaseSignRecordByTask(purchaseCheckInfo.getTaskId());
|
||||
// 查询需要进行会签的org_id集合
|
||||
List<SignProcessVo> signProcessVoList = signProcessMapper.getList(new SignProcessVo());
|
||||
// 获取当前登录人组织id
|
||||
Long loginUserDeptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (!CollectionUtils.isEmpty(purchaseSignRecordList) && !CollectionUtils.isEmpty(signProcessVoList)) {
|
||||
// 查询出配置需要会签的org_id集合
|
||||
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);
|
||||
if (addPurchaseSignResult < 1) {
|
||||
return AjaxResult.error("会签失败,purchase_audit_record表插入0条数据");
|
||||
} else {
|
||||
return AjaxResult.success("验收驳回成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,7 +267,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
IFNULL(lod.num, 0) AS alNum,
|
||||
GROUP_CONCAT( DISTINCT mt1.type_name ) AS maTypeNames,
|
||||
lpd.publish_task AS publishTask,
|
||||
lai.task_id AS taskId
|
||||
lai.task_id AS taskId,
|
||||
lai.lease_sign_url AS leaseSignUrl
|
||||
FROM
|
||||
lease_publish_details lpd
|
||||
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
|
||||
lpd.create_time DESC
|
||||
</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>
|
||||
Loading…
Reference in New Issue