材料员确认
This commit is contained in:
parent
d1d7d0f479
commit
a04795ee22
|
|
@ -307,4 +307,7 @@ public class LeaseApplyInfo extends BaseEntity{
|
||||||
|
|
||||||
@ApiModelProperty(value = "有无电子签名 0 否,1 是")
|
@ApiModelProperty(value = "有无电子签名 0 否,1 是")
|
||||||
private Integer hasSign;
|
private Integer hasSign;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "i8工程id")
|
||||||
|
private String externalId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.bonus.common.biz.domain.lease;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ma_sh
|
||||||
|
* @create 2025/6/20 17:16
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class LeaseConfirmSign {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "确认人签名URL")
|
||||||
|
private String confirmSignUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "确认人签名类型")
|
||||||
|
private int confirmSignType;
|
||||||
|
}
|
||||||
|
|
@ -80,9 +80,8 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
|
|
||||||
@ApiOperation(value = "材料员确认接口")
|
@ApiOperation(value = "材料员确认接口")
|
||||||
@PostMapping("/confirmMaterial")
|
@PostMapping("/confirmMaterial")
|
||||||
public AjaxResult confirmMaterial(@RequestBody LeaseApplyInfo leaseApplyInfo) {
|
public AjaxResult confirmMaterial(@RequestBody LeaseApplyDetails detail) {
|
||||||
int confirmResult = leaseApplyInfoService.confirmLeaseTask(leaseApplyInfo.getId().toString(), leaseApplyInfo.getIsConfirm(),
|
int confirmResult = leaseApplyInfoService.confirmLeaseTask(detail);
|
||||||
leaseApplyInfo.getConfirmRemark());
|
|
||||||
return confirmResult > 0 ? success("确认成功") : error("确认失败");
|
return confirmResult > 0 ? success("确认成功") : error("确认失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,6 +134,26 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id, keyWord, publishTask));
|
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id, keyWord, publishTask));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取领料任务详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取领料任务详细信息")
|
||||||
|
//@RequiresPermissions("lease:info:query")
|
||||||
|
@GetMapping(value = "/getInfoById")
|
||||||
|
public AjaxResult getLeaseInfo(LeaseApplyInfo bean) {
|
||||||
|
return success(leaseApplyInfoService.selectLeaseApplyInfoByIdTwo(bean));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取领料单
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取领料单")
|
||||||
|
//@RequiresPermissions("lease:info:query")
|
||||||
|
@GetMapping(value = "/getLeaseRequestVo")
|
||||||
|
public AjaxResult getLeaseRequestVo(LeaseApplyDetails bean) {
|
||||||
|
return success(leaseApplyInfoService.getLeaseRequestVo(bean));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取领料出库内部详细信息
|
* 获取领料出库内部详细信息
|
||||||
* @param leaseApplyDetails
|
* @param leaseApplyDetails
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,14 @@ package com.bonus.material.lease.domain;
|
||||||
|
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -158,6 +160,27 @@ public class LeaseApplyDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "租赁工程")
|
@ApiModelProperty(value = "租赁工程")
|
||||||
private String leaseProject;
|
private String leaseProject;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否确认")
|
||||||
|
private Integer isConfirm;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "确认人")
|
||||||
|
private String confirmPerson;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "确认时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date confirmTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "材料员确认备注")
|
||||||
|
private String confirmRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "出库时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date outTime;
|
||||||
|
|
||||||
|
private String leaseSignId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "领料物资名称汇总")
|
||||||
|
private String maTypeNames;
|
||||||
public LeaseApplyDetails(Long id, Long parentId, Long typeId, BigDecimal preNum, BigDecimal auditNum, BigDecimal alNum, String status, Long companyId) {
|
public LeaseApplyDetails(Long id, Long parentId, Long typeId, BigDecimal preNum, BigDecimal auditNum, BigDecimal alNum, String status, Long companyId) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.parentId = parentId;
|
this.parentId = parentId;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.material.lease.domain.vo;
|
package com.bonus.material.lease.domain.vo;
|
||||||
|
|
||||||
|
import com.bonus.common.biz.domain.lease.LeaseConfirmSign;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
|
|
@ -34,6 +35,8 @@ public class LeaseApplyRequestVo extends BaseEntity {
|
||||||
|
|
||||||
private List<LeaseOutVo> leaseOutVoList;
|
private List<LeaseOutVo> leaseOutVoList;
|
||||||
|
|
||||||
|
private LeaseConfirmSign confirmSign;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库管签名集合
|
* 库管签名集合
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.lease.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
|
|
@ -162,4 +163,5 @@ public interface LeaseApplyDetailsMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int deletePublishTask(LeaseOutDetails leaseOutDetails);
|
int deletePublishTask(LeaseOutDetails leaseOutDetails);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@ package com.bonus.material.lease.mapper;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||||
|
import com.bonus.common.biz.domain.lease.LeaseConfirmSign;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
||||||
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -52,13 +54,10 @@ public interface LeaseApplyInfoMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 材料员确认
|
* 材料员确认
|
||||||
* @param id
|
|
||||||
* @param isConfirm
|
|
||||||
* @param confirmTime
|
|
||||||
* @param confirmRemark
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int confirmLeaseTask(@Param("id") String id,@Param("isConfirm") Integer isConfirm,@Param("materialMan") Long materialMan,@Param("confirmTime") Date confirmTime, @Param("confirmRemark") String confirmRemark);
|
int confirmLeaseTask(LeaseApplyDetails details);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除领料任务
|
* 删除领料任务
|
||||||
|
|
@ -107,4 +106,18 @@ public interface LeaseApplyInfoMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updateLeasePublishInfoSign(LeaseApplyInfo leaseApplyInfo);
|
int updateLeasePublishInfoSign(LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
|
List<LeaseApplyInfo> selectCompleteOutList(LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
|
int checkPermission(@Param("externalId") String externalId,@Param("username") String username);
|
||||||
|
|
||||||
|
List<LeaseApplyDetails> selectOutDetailsList(LeaseApplyInfo leaseApplyInfo);
|
||||||
|
|
||||||
|
int updateLeaseApplyInfoConfirm(Long id);
|
||||||
|
|
||||||
|
LeaseApplyInfo getLeaseInfoById(LeaseApplyInfo bean);
|
||||||
|
|
||||||
|
List<LeaseApplyDetails> getDetailsLeaseList(LeaseApplyDetails bean);
|
||||||
|
|
||||||
|
LeaseConfirmSign getLeaseConfirmSign(LeaseApplyDetails bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,12 +42,10 @@ public interface ILeaseApplyInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 材料员确认service
|
* 材料员确认service
|
||||||
* @param id
|
|
||||||
* @param isConfirm
|
|
||||||
* @param confirmRemark
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int confirmLeaseTask(@Param("id") String id, @Param("isConfirm") Integer isConfirm, @Param("confirmRemark") String confirmRemark);
|
int confirmLeaseTask(LeaseApplyDetails details);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -174,4 +172,8 @@ public interface ILeaseApplyInfoService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult leaseOutByInfo(LeaseOutRequestVo leaseOutRequestVo);
|
AjaxResult leaseOutByInfo(LeaseOutRequestVo leaseOutRequestVo);
|
||||||
|
|
||||||
|
List<LeaseApplyDetails> selectLeaseApplyInfoByIdTwo(LeaseApplyInfo bean);
|
||||||
|
|
||||||
|
LeaseApplyRequestVo getLeaseRequestVo(LeaseApplyDetails bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.bonus.common.biz.config.PoiOutPage;
|
import com.bonus.common.biz.config.PoiOutPage;
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
import com.bonus.common.biz.domain.BmFileInfo;
|
import com.bonus.common.biz.domain.BmFileInfo;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
import com.bonus.common.biz.domain.lease.*;
|
||||||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
|
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
|
||||||
import com.bonus.common.biz.enums.MaMachineStatusEnum;
|
import com.bonus.common.biz.enums.MaMachineStatusEnum;
|
||||||
|
|
@ -23,10 +23,9 @@ import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
|
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
|
||||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseOutRequestVo;
|
|
||||||
import com.bonus.material.lease.domain.vo.LeaseOutVo;
|
import com.bonus.material.lease.domain.vo.LeaseOutVo;
|
||||||
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
||||||
import com.bonus.material.lease.service.ILeaseOutDetailsService;
|
import com.bonus.material.lease.service.ILeaseOutDetailsService;
|
||||||
|
|
@ -39,7 +38,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
|
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
|
||||||
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
@ -183,6 +181,76 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LeaseApplyDetails> selectLeaseApplyInfoByIdTwo(LeaseApplyInfo bean) {
|
||||||
|
try {
|
||||||
|
if(bean.getId() == null){
|
||||||
|
throw new RuntimeException("领料id不能为空" );
|
||||||
|
}
|
||||||
|
List<LeaseApplyDetails> leaseApplyDetailsList = leaseApplyInfoMapper.selectOutDetailsList(bean);
|
||||||
|
return leaseApplyDetailsList;
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 记录异常日志
|
||||||
|
throw new RuntimeException("Failed to select lease apply info", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LeaseApplyRequestVo getLeaseRequestVo(LeaseApplyDetails bean) {
|
||||||
|
try {
|
||||||
|
LeaseApplyInfo leaseApplyInfo = new LeaseApplyInfo();
|
||||||
|
leaseApplyInfo.setId(bean.getId());
|
||||||
|
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||||
|
leaseApplyInfo.setUserId(userId);
|
||||||
|
LeaseApplyInfo info = leaseApplyInfoMapper.getLeaseInfoById(leaseApplyInfo);
|
||||||
|
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
|
||||||
|
// 查询领用出库数据
|
||||||
|
/** 设置审批人签名url 防止代码冲突 **/
|
||||||
|
String directAuditUrl = leaseApplyInfoMapper.getDirectAuditUrl(info);
|
||||||
|
info.setDirectAuditSignUrl(directAuditUrl);
|
||||||
|
/** 设置审批人签名url 防止代码冲突 **/
|
||||||
|
|
||||||
|
// 电子签名进行base64拼接
|
||||||
|
if (StringUtils.isNotBlank(info.getLeaseSignUrl())) {
|
||||||
|
info.setLeaseSignUrl("data:image/png;base64," + info.getLeaseSignUrl());
|
||||||
|
}
|
||||||
|
/** 设置发料单位 防止代码冲突 **/
|
||||||
|
|
||||||
|
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
||||||
|
// 获取领料单详情
|
||||||
|
List<LeaseApplyDetails> details = leaseApplyInfoMapper.getDetailsLeaseList(bean);
|
||||||
|
if (!CollectionUtils.isEmpty(details)) {
|
||||||
|
leaseApplyRequestVo.setLeaseApplyDetailsList(details);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据id查询领料出库情况,查询出库人电子签名详情
|
||||||
|
List<LeaseOutSign> outSignList = leaseApplyInfoMapper.selectLeaseApplyOutList(bean.getId());
|
||||||
|
if (!CollectionUtils.isEmpty(outSignList)) {
|
||||||
|
for (LeaseOutSign applyInfo : outSignList) {
|
||||||
|
if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) {
|
||||||
|
applyInfo.setOutSignUrl("data:image/png;base64," + applyInfo.getOutSignUrl());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
leaseApplyRequestVo.setKgSignList(outSignList);
|
||||||
|
}
|
||||||
|
// 根据id查询领料出库情况,查询材料员电子签名详情
|
||||||
|
if(details != null && !details.isEmpty()){
|
||||||
|
bean.setConfirmPerson(details.get(0).getConfirmPerson());
|
||||||
|
LeaseConfirmSign confirmSign = leaseApplyInfoMapper.getLeaseConfirmSign(bean);
|
||||||
|
if(confirmSign != null){
|
||||||
|
confirmSign.setConfirmSignUrl("data:image/png;base64," + confirmSign.getConfirmSignUrl());
|
||||||
|
leaseApplyRequestVo.setConfirmSign(confirmSign);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return leaseApplyRequestVo;
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 记录异常日志
|
||||||
|
throw new RuntimeException("Failed to select lease apply info", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料任务列表
|
* 查询领料任务列表
|
||||||
*
|
*
|
||||||
|
|
@ -264,14 +332,43 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
/**
|
/**
|
||||||
* 材料员确认service
|
* 材料员确认service
|
||||||
*
|
*
|
||||||
* @param id
|
|
||||||
* @param isConfirm
|
|
||||||
* @param confirmRemark
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int confirmLeaseTask(String id, Integer isConfirm, String confirmRemark) {
|
public int confirmLeaseTask(LeaseApplyDetails details) {
|
||||||
return leaseApplyInfoMapper.confirmLeaseTask(id, isConfirm, SecurityUtils.getLoginUser().getUserid(), new Date(), confirmRemark);
|
details.setConfirmPerson(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||||
|
details.setConfirmTime(new Date());
|
||||||
|
//进行确认通过
|
||||||
|
int count = leaseApplyInfoMapper.confirmLeaseTask(details);
|
||||||
|
return count;
|
||||||
|
// if (count > 0) {
|
||||||
|
// //查询是否都已确认
|
||||||
|
// LeaseApplyInfo leaseApplyInfo = new LeaseApplyInfo();
|
||||||
|
// leaseApplyInfo.setId(Long.valueOf(id));
|
||||||
|
// List<LeaseApplyDetails> details = leaseApplyInfoMapper.selectOutDetailsList(leaseApplyInfo);
|
||||||
|
// //查询details中是否有未确认的数据isConfirm==1
|
||||||
|
// int flag = 0;
|
||||||
|
// if (!CollectionUtils.isEmpty(details)) {
|
||||||
|
// for (LeaseApplyDetails detail : details) {
|
||||||
|
// if (detail.getIsConfirm() == null || detail.getIsConfirm() == 1) {
|
||||||
|
// flag = 1;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (flag == 0) {
|
||||||
|
// //leaseApplyInfo表全部确认
|
||||||
|
// int countTwo = leaseApplyInfoMapper.updateLeaseApplyInfoConfirm(Long.valueOf(id));
|
||||||
|
// if(countTwo ==0){
|
||||||
|
// throw new ServiceException("确认失败,lease_apply_info表更新失败");
|
||||||
|
// }else{
|
||||||
|
// return countTwo;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return count;
|
||||||
|
//
|
||||||
|
// }else{
|
||||||
|
// throw new ServiceException("确认失败,lease_out_details表更新失败");
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -283,13 +380,33 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
@Override
|
@Override
|
||||||
public List<LeaseApplyInfo> getCompleteOutTaskList(LeaseApplyInfo leaseApplyInfo) {
|
public List<LeaseApplyInfo> getCompleteOutTaskList(LeaseApplyInfo leaseApplyInfo) {
|
||||||
leaseApplyInfo.setUserId(SecurityUtils.getLoginUser().getUserid());
|
leaseApplyInfo.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||||
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
|
||||||
// 如果statusList包含3、4、5,则为领料出库查询,需查询领用出库数据,进行拼接
|
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectCompleteOutList(leaseApplyInfo);
|
||||||
if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
|
//材料站权限过滤
|
||||||
if (leaseApplyInfo.getStatusList().contains(4)) {
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
// 查询领用出库数据
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
extracted(leaseApplyInfo, list);
|
list = list.stream()
|
||||||
|
.filter(info -> {
|
||||||
|
// 调用 mapper 方法检查是否有符合条件的数据
|
||||||
|
int count = leaseApplyInfoMapper.checkPermission(info.getExternalId(), username);
|
||||||
|
return count > 0;
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (leaseApplyInfo.getIsConfirm()!=null) {
|
||||||
|
if (leaseApplyInfo.getIsConfirm() == 2) {
|
||||||
|
// 已确认
|
||||||
|
list = list.stream()
|
||||||
|
.filter(item -> item.getIsConfirm() == 2)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
// 未确认
|
||||||
|
list = list.stream()
|
||||||
|
.filter(item -> item.getIsConfirm() == 1)
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 使用 Stream API 进行降序排序
|
// 使用 Stream API 进行降序排序
|
||||||
List<LeaseApplyInfo> sortedList = list.stream()
|
List<LeaseApplyInfo> sortedList = list.stream()
|
||||||
|
|
@ -304,18 +421,26 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
.filter(item -> containsKeyword(item, keyWord))
|
.filter(item -> containsKeyword(item, keyWord))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
// 判断状态
|
// // 判断状态
|
||||||
if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
|
// if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
|
||||||
// 将集合sortedList中状态taskStatus包含在leaseApplyInfo.getStatusList()中的元素
|
// // 将集合sortedList中状态taskStatus包含在leaseApplyInfo.getStatusList()中的元素
|
||||||
sortedList = sortedList.stream()
|
// sortedList = sortedList.stream()
|
||||||
.filter(item -> leaseApplyInfo.getStatusList().contains(item.getTaskStatus()))
|
// .filter(item -> leaseApplyInfo.getStatusList().contains(item.getTaskStatus()))
|
||||||
.collect(Collectors.toList());
|
// .collect(Collectors.toList());
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
sortedList.removeIf(Objects::isNull);
|
sortedList.removeIf(Objects::isNull);
|
||||||
if (leaseApplyInfo.getIsConfirm() != null) {
|
if (leaseApplyInfo.getIsConfirm() != null) {
|
||||||
if (leaseApplyInfo.getIsConfirm() == 1) {
|
if (leaseApplyInfo.getIsConfirm() == 1) {
|
||||||
sortedList.removeIf(item -> item.getIsConfirm() != null && item.getIsConfirm() == 2);
|
for (LeaseApplyInfo item : sortedList) {
|
||||||
|
if(item.getPreCountNum().compareTo(item.getAlNum()) != 0){
|
||||||
|
item.setIsConfirm(1);
|
||||||
|
}else{
|
||||||
|
//查找签名的数量之和是否为
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// sortedList.removeIf(item -> item.getIsConfirm() != null && item.getIsConfirm() == 2);
|
||||||
} else if (leaseApplyInfo.getIsConfirm() == 2) {
|
} else if (leaseApplyInfo.getIsConfirm() == 2) {
|
||||||
sortedList.removeIf(item -> item.getIsConfirm() == null || item.getIsConfirm() != 2);
|
sortedList.removeIf(item -> item.getIsConfirm() == null || item.getIsConfirm() != 2);
|
||||||
}
|
}
|
||||||
|
|
@ -323,7 +448,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
// 再次移除可能的null值
|
// 再次移除可能的null值
|
||||||
sortedList.removeIf(Objects::isNull);
|
sortedList.removeIf(Objects::isNull);
|
||||||
// 只有出库完成的任务才需要进行确认,这里过滤掉任务状态不等于4(出库已完成)的
|
// 只有出库完成的任务才需要进行确认,这里过滤掉任务状态不等于4(出库已完成)的
|
||||||
sortedList.removeIf(item -> item.getTaskStatus() != 4);
|
// sortedList.removeIf(item -> item.getTaskStatus() != 4);
|
||||||
|
|
||||||
return sortedList;
|
return sortedList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
lai.create_by, lai.create_time, lai.update_by, lai.update_time, lai.remark, lai.company_id,
|
lai.create_by, lai.create_time, lai.update_by, lai.update_time, lai.remark, lai.company_id,
|
||||||
lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.lease_sign_type,
|
lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.lease_sign_type,
|
||||||
lai.material_man, lai.confirm_time, lai.is_confirm, lai.confirm_remark,
|
lai.material_man, lai.confirm_time, lai.is_confirm, lai.confirm_remark,
|
||||||
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 as unitName, bp.pro_name as projectName, bai.agreement_code as agreementCode, 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,
|
||||||
|
|
@ -76,6 +76,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<sql id="selectLeaseApplyInfoVoTwo">
|
||||||
|
select
|
||||||
|
lai.id, lai.code, lai.task_id, lai.lease_person as leasePerson, lai.phone, lai.type, lai.company_audit_by,
|
||||||
|
lai.company_audit_time, lai.company_audit_remark, lai.dept_audit_by, lai.dept_audit_time,
|
||||||
|
lai.dept_audit_remark, lai.direct_audit_by, lai.direct_audit_time, lai.direct_audit_remark,
|
||||||
|
lai.create_by, lai.create_time, lai.update_by, lai.update_time, lai.remark, lai.company_id,
|
||||||
|
lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.lease_sign_type,
|
||||||
|
lai.material_man, lai.confirm_time, lai.is_confirm, lai.confirm_remark,
|
||||||
|
bai.unit_id,bai.project_id,bu.unit_name as unitName, bp.pro_name as projectName,bp.external_id as externalId, bai.agreement_code as agreementCode, tt.task_status as taskStatus,
|
||||||
|
sda.dict_label as taskStatusName,
|
||||||
|
IFNULL(sum(lad.pre_num),0) as preCountNum,
|
||||||
|
IFNULL(sum(lod.out_num),0) as alNum,
|
||||||
|
CASE
|
||||||
|
WHEN IFNULL(sum(lad.pre_num),0) = SUM(CASE WHEN lod.is_confirm = 2 THEN lod.out_num ELSE 0 END) THEN 2
|
||||||
|
ELSE 1
|
||||||
|
END as isConfirm,
|
||||||
|
GROUP_CONCAT(DISTINCT mt1.type_name) as maTypeNames,
|
||||||
|
bp.contract_part as contractPart,
|
||||||
|
sd.dept_name as impUnitName,
|
||||||
|
tt.task_type as taskType
|
||||||
|
from
|
||||||
|
lease_apply_info lai
|
||||||
|
left join tm_task tt on lai.task_id = tt.task_id
|
||||||
|
left join lease_apply_details lad on lai.id = lad.parent_id
|
||||||
|
left join lease_out_details lod on lai.id = lod.parent_id
|
||||||
|
left join tm_task_agreement tta on lai.task_id = tta.task_id
|
||||||
|
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
|
||||||
|
left join bm_unit bu on bu.unit_id = bai.unit_id
|
||||||
|
left join bm_project bp on bp.pro_id = bai.project_id
|
||||||
|
left join sys_dept sd on sd.dept_id = bp.imp_unit
|
||||||
|
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'
|
||||||
|
</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">
|
||||||
<include refid="selectLeaseApplyInfoVo"/>
|
<include refid="selectLeaseApplyInfoVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
|
@ -328,15 +364,147 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
GROUP BY
|
GROUP BY
|
||||||
su.user_id
|
su.user_id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectCompleteOutList" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||||
|
<include refid="selectLeaseApplyInfoVoTwo"/>
|
||||||
|
where
|
||||||
|
lod.out_num >0 and lod.lease_sign_id is not null and bp.external_id is not null
|
||||||
|
<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 tt.task_type = '2'
|
||||||
|
GROUP BY lai.id
|
||||||
|
ORDER BY tt.task_status,tt.create_time desc
|
||||||
|
</select>
|
||||||
|
<select id="checkPermission" resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(1)
|
||||||
|
FROM `sbd_audit`.sg_project_post_personnel sgp
|
||||||
|
LEFT JOIN `data_center`.dx_fb_son dfs ON sgp.depart_id = dfs.project_dept_id
|
||||||
|
WHERE sgp.post_id = '3de0eb390f3611efa1940242ac130004'
|
||||||
|
AND sgp.cno = #{username}
|
||||||
|
AND dfs.id = #{externalId}
|
||||||
|
</select>
|
||||||
|
<select id="selectOutDetailsList" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||||
|
select
|
||||||
|
lod.id as id,
|
||||||
|
lod.parent_id as parentId,
|
||||||
|
sum(lod.out_num) as outNum,
|
||||||
|
DATE_FORMAT(lod.confirm_time, '%Y-%m-%d') as confirmTime,
|
||||||
|
lod.is_confirm as isConfirm,
|
||||||
|
su.nick_name as confirmPerson,
|
||||||
|
lod.confirm_remark as confirmRemark,
|
||||||
|
GROUP_CONCAT(DISTINCT mt2.type_name) as maTypeNames,
|
||||||
|
lod.lease_sign_id as leaseSignId
|
||||||
|
from lease_out_details lod
|
||||||
|
left join ma_type mt1 on lod.type_id = mt1.type_id
|
||||||
|
left join ma_type mt2 on mt1.parent_id = mt2.type_id
|
||||||
|
left join sys_user su on lod.confirm_person = su.user_id
|
||||||
|
where lod.parent_id = 353
|
||||||
|
and lod.out_num > 0
|
||||||
|
and lod.lease_sign_id is not null
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
AND GROUP_CONCAT(DISTINCT mt2.type_name) LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
|
||||||
|
</if>
|
||||||
|
group by lod.lease_sign_id
|
||||||
|
order by lod.is_confirm
|
||||||
|
</select>
|
||||||
|
<select id="getLeaseInfoById" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||||
|
select
|
||||||
|
lai.id, lai.code, lai.task_id, lai.lease_person as leasePerson, lai.phone, lai.type, lai.company_audit_by,
|
||||||
|
lai.company_audit_time, lai.company_audit_remark, lai.dept_audit_by as directAuditBy, lai.dept_audit_time,
|
||||||
|
lai.dept_audit_remark, lai.direct_audit_by, lai.direct_audit_time, lai.direct_audit_remark,
|
||||||
|
lai.create_by, DATE_FORMAT(lai.create_time, '%Y-%m-%d') as createTime, lai.update_by, lai.update_time, lai.remark, lai.company_id,
|
||||||
|
lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url as leaseSignUrl, lai.lease_sign_type as leaseSignType,
|
||||||
|
lai.material_man, lai.confirm_time, lai.is_confirm, lai.confirm_remark,
|
||||||
|
bai.unit_id,bai.project_id,bu.unit_name as unitName, bp.pro_name as projectName,bp.external_id as externalId, bai.agreement_code as agreementCode, tt.task_status as taskStatus,
|
||||||
|
sda.dict_label as taskStatusName,
|
||||||
|
IFNULL(sum(lad.pre_num),0) as preCountNum,
|
||||||
|
IFNULL(sum(lod.out_num),0) as alNum,
|
||||||
|
CASE
|
||||||
|
WHEN IFNULL(sum(lad.pre_num),0) = SUM(CASE WHEN lod.is_confirm = 2 THEN lod.out_num ELSE 0 END) THEN 2
|
||||||
|
ELSE 1
|
||||||
|
END as isConfirm,
|
||||||
|
GROUP_CONCAT(DISTINCT mt1.type_name) as maTypeNames,
|
||||||
|
bp.contract_part as contractPart,
|
||||||
|
sd.dept_name as impUnitName,
|
||||||
|
tt.task_type as taskType
|
||||||
|
from
|
||||||
|
lease_apply_info lai
|
||||||
|
left join tm_task tt on lai.task_id = tt.task_id
|
||||||
|
left join lease_apply_details lad on lai.id = lad.parent_id
|
||||||
|
left join lease_out_details lod on lai.id = lod.parent_id
|
||||||
|
left join tm_task_agreement tta on lai.task_id = tta.task_id
|
||||||
|
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
|
||||||
|
left join bm_unit bu on bu.unit_id = bai.unit_id
|
||||||
|
left join bm_project bp on bp.pro_id = bai.project_id
|
||||||
|
left join sys_dept sd on sd.dept_id = bp.imp_unit
|
||||||
|
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'
|
||||||
|
where lai.id = #{id}
|
||||||
|
</select>
|
||||||
|
<select id="getDetailsLeaseList" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||||
|
select
|
||||||
|
lod.id as id,
|
||||||
|
lod.type_id as typeId,
|
||||||
|
lod.parent_id as parentId,
|
||||||
|
lod.out_num as outNum,
|
||||||
|
DATE_FORMAT(lod.confirm_time, '%Y-%m-%d') as confirmTime,
|
||||||
|
mt2.type_name as maTypeName,
|
||||||
|
mt1.type_name as typeName,
|
||||||
|
lod.remark as remark,
|
||||||
|
mt1.manage_type as manageType,
|
||||||
|
lod.confirm_person as confirmPerson,
|
||||||
|
mt1.unit_name as unitName
|
||||||
|
from lease_out_details lod
|
||||||
|
left join ma_type mt1 on lod.type_id = mt1.type_id
|
||||||
|
left join ma_type mt2 on mt1.parent_id = mt2.type_id
|
||||||
|
where lod.parent_id = #{id}
|
||||||
|
and lod.out_num > 0
|
||||||
|
and lod.lease_sign_id = #{leaseSignId}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="getLeaseConfirmSign" resultType="com.bonus.common.biz.domain.lease.LeaseConfirmSign">
|
||||||
|
select
|
||||||
|
su.sign_url as confirmSignUrl,
|
||||||
|
su.sign_type as confirmSignType
|
||||||
|
from sys_user su
|
||||||
|
where su.user_id = #{confirmPerson} and su.del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="confirmLeaseTask">
|
<update id="confirmLeaseTask">
|
||||||
update
|
update
|
||||||
lease_apply_info
|
lease_out_details
|
||||||
set
|
set
|
||||||
material_man = #{materialMan}, confirm_time = #{confirmTime}, is_confirm = #{isConfirm},
|
is_confirm = #{isConfirm}, confirm_time = #{confirmTime}, confirm_person = #{confirmPerson},
|
||||||
confirm_remark = #{confirmRemark}
|
confirm_remark = #{confirmRemark}
|
||||||
where
|
where
|
||||||
id = #{id}
|
parent_id = #{id} and lease_sign_id = #{leaseSignId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateLeasePublishInfoSign">
|
<update id="updateLeasePublishInfoSign">
|
||||||
|
|
@ -350,4 +518,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and publish_task = #{publishTask}
|
and publish_task = #{publishTask}
|
||||||
</if>
|
</if>
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateLeaseApplyInfoConfirm">
|
||||||
|
update lease_apply_info
|
||||||
|
is_confirm = 2
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue