This commit is contained in:
parent
2ca16fd1d5
commit
983ec5db92
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.bonus.material.part.controller;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
|
import com.bonus.material.part.domain.vo.PartChaseVerifyVo;
|
||||||
|
import com.bonus.material.part.service.IPartCheckInfoService;
|
||||||
|
import com.bonus.material.purchase.domain.vo.PurchaseVerifyVo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ma_sh
|
||||||
|
* @create 2025/2/18 16:14
|
||||||
|
*/
|
||||||
|
@Api(tags = "配件入库管理接口")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/part_check")
|
||||||
|
public class PartCheckInfoController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IPartCheckInfoService partCheckInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配件内层批量验收API
|
||||||
|
* @param partChaseVerifyVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("配件内层批量验收API")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
@PostMapping("/innerVerify")
|
||||||
|
public AjaxResult innerVerify(@RequestBody PartChaseVerifyVo partChaseVerifyVo) {
|
||||||
|
return partCheckInfoService.innerVerify(partChaseVerifyVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -34,6 +34,9 @@ public class PartTypeCheckDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "任务ID")
|
@ApiModelProperty(value = "任务ID")
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "验收人ID")
|
||||||
|
private Long checkUser;
|
||||||
|
|
||||||
/** 规格id */
|
/** 规格id */
|
||||||
//@Excel(name = "规格id")
|
//@Excel(name = "规格id")
|
||||||
@ApiModelProperty(value = "规格id")
|
@ApiModelProperty(value = "规格id")
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,9 @@ public class PartTypeQueryDto {
|
||||||
@ApiModelProperty(value = "是否完成")
|
@ApiModelProperty(value = "是否完成")
|
||||||
private Integer isFinish;
|
private Integer isFinish;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务状态名称,未完成/已完成")
|
||||||
|
private String taskStatusName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "开始时间")
|
@ApiModelProperty(value = "开始时间")
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.bonus.material.part.domain.vo;
|
||||||
|
|
||||||
|
import com.bonus.material.part.domain.PartTypeCheckDetails;
|
||||||
|
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ma_sh
|
||||||
|
* @create 2025/2/19 14:22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PartChaseVerifyVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id列表")
|
||||||
|
private List<Long> taskIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "验收是否通过")
|
||||||
|
private Boolean verifyPass;
|
||||||
|
|
||||||
|
/** 验收结论 */
|
||||||
|
@ApiModelProperty(value = "验收结论")
|
||||||
|
private String checkResult;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "新购物资列表")
|
||||||
|
List<PartTypeCheckDetails> purchaseCheckDetailsList;
|
||||||
|
}
|
||||||
|
|
@ -117,4 +117,12 @@ public interface PartArrivedMapper
|
||||||
* @return 外层信息
|
* @return 外层信息
|
||||||
*/
|
*/
|
||||||
PartTypeCheckInfo getCheckInfoForm(PartTypeQueryDto partTypeQueryDto);
|
PartTypeCheckInfo getCheckInfoForm(PartTypeQueryDto partTypeQueryDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新任务状态
|
||||||
|
* @param taskId
|
||||||
|
* @param status
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateTaskStatus(@Param("taskId") Long taskId,@Param("status") Integer status);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.bonus.material.part.mapper;
|
||||||
|
|
||||||
|
import com.bonus.material.part.domain.PartTypeCheckDetails;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ma_sh
|
||||||
|
* @create 2025/2/18 17:10
|
||||||
|
*/
|
||||||
|
public interface PartCheckMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务状态更新
|
||||||
|
* @param taskId
|
||||||
|
* @param newTaskStatus
|
||||||
|
* @param checkResult
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int batchUpdateDetailsTaskStatus(@Param("taskId") Long taskId, @Param("newTaskStatus") Integer newTaskStatus, @Param("checkResult") String checkResult);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新采购明细
|
||||||
|
* @param details
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updatePurchaseDetails4Check(PartTypeCheckDetails details);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.bonus.material.part.service;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.part.domain.vo.PartChaseVerifyVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ma_sh
|
||||||
|
* @create 2025/2/18 17:09
|
||||||
|
*/
|
||||||
|
public interface IPartCheckInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配件内层批量验收API
|
||||||
|
* @param partChaseVerifyVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult innerVerify(PartChaseVerifyVo partChaseVerifyVo);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,180 @@
|
||||||
|
package com.bonus.material.part.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.common.biz.domain.BmFileInfo;
|
||||||
|
import com.bonus.common.biz.enums.PartLeaseTaskStatusEnum;
|
||||||
|
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
||||||
|
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||||
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
|
import com.bonus.material.countersign.domain.SignProcessVo;
|
||||||
|
import com.bonus.material.countersign.mapper.SignProcessMapper;
|
||||||
|
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||||
|
import com.bonus.material.part.domain.PartTypeCheckDetails;
|
||||||
|
import com.bonus.material.part.domain.PartTypeQueryDto;
|
||||||
|
import com.bonus.material.part.domain.vo.PartChaseVerifyVo;
|
||||||
|
import com.bonus.material.part.mapper.PartArrivedMapper;
|
||||||
|
import com.bonus.material.part.mapper.PartCheckMapper;
|
||||||
|
import com.bonus.material.part.service.IPartCheckInfoService;
|
||||||
|
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||||
|
import com.bonus.material.purchase.domain.PurchaseSignRecord;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ma_sh
|
||||||
|
* @create 2025/2/18 17:10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class IPartCheckInfoServiceImpl implements IPartCheckInfoService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SignProcessMapper signProcessMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PartCheckMapper partCheckMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PartArrivedMapper partArrivedMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BmFileInfoMapper bmFileInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配件内层批量验收API
|
||||||
|
* @param partChaseVerifyVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult innerVerify(PartChaseVerifyVo partChaseVerifyVo) {
|
||||||
|
try {
|
||||||
|
AjaxResult result = new AjaxResult();
|
||||||
|
if (!CollectionUtils.isEmpty(partChaseVerifyVo.getPurchaseCheckDetailsList())) {
|
||||||
|
if (BooleanUtils.isTrue(partChaseVerifyVo.getVerifyPass())) {
|
||||||
|
// 验收通过处理流程
|
||||||
|
for (PartTypeCheckDetails details : partChaseVerifyVo.getPurchaseCheckDetailsList()) {
|
||||||
|
// 前端选择验收通过操作,进入会签校验流程
|
||||||
|
if (null != details && null != details.getTaskId()) {
|
||||||
|
// 查询已进行会签的org_id集合
|
||||||
|
List<PurchaseSignRecord> purchaseSignRecordList = signProcessMapper.getPurchaseSignRecordByTask(details.getTaskId());
|
||||||
|
Long loginUserDeptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||||
|
if (null == loginUserDeptId || 0 == loginUserDeptId) {
|
||||||
|
return AjaxResult.error("会签失败!,请检查用户部门信息");
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(purchaseSignRecordList)) {
|
||||||
|
// 如果该任务没有进行过会签,则无需校验 直接进行会签流程
|
||||||
|
int addPurchaseSignResult = signProcessMapper.insertPurchaseSignRecord(new PurchaseSignRecord(details.getTaskId(), SecurityUtils.getUserId(), loginUserDeptId));
|
||||||
|
if (0 < addPurchaseSignResult) {
|
||||||
|
return AjaxResult.success("会签成功");
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("会签失败!,插入0条数据");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// 查询需要进行会签的org_id集合
|
||||||
|
List<SignProcessVo> signProcessVoList = signProcessMapper.getList(new SignProcessVo());
|
||||||
|
if (CollectionUtils.isEmpty(signProcessVoList)) {
|
||||||
|
return AjaxResult.error("会签失败!,未查询到会签配置流程!");
|
||||||
|
} else {
|
||||||
|
// 查询出配置需要会签的org_id集合
|
||||||
|
Set<Long> configSignOrgSet = signProcessVoList.stream().map(SignProcessVo::getOrgId).collect(Collectors.toSet());
|
||||||
|
// 获取已进行会签的org_id集合
|
||||||
|
Set<Long> signedOrgSet = purchaseSignRecordList.stream().map(PurchaseSignRecord::getOrgId).collect(Collectors.toSet());
|
||||||
|
// 移除已会签的org_id
|
||||||
|
configSignOrgSet.removeAll(signedOrgSet);
|
||||||
|
if (!CollectionUtils.isEmpty(configSignOrgSet)) {
|
||||||
|
// 如果还有需要进行会签的数据,那么进行本次会签
|
||||||
|
int addPurchaseSignResult = signProcessMapper.insertPurchaseSignRecord(new PurchaseSignRecord(details.getTaskId(), SecurityUtils.getUserId(), loginUserDeptId));
|
||||||
|
if (0 < addPurchaseSignResult) {
|
||||||
|
// 会签成功,对配置的流程进行处理
|
||||||
|
configSignOrgSet.remove(loginUserDeptId);
|
||||||
|
if (configSignOrgSet.isEmpty()) {
|
||||||
|
System.out.println("ONE会签成功,放行进行验收流程!");
|
||||||
|
} else {
|
||||||
|
// 如果本次会签完成后还有需要进行会签的,那么本次会签完成,返回前端
|
||||||
|
return AjaxResult.success("会签成功!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("会签失败!,插入0条数据");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
System.out.println("TWO会签成功,已全部进行会签,放行进行验收流程!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("detail数据异常,任务ID为空");
|
||||||
|
}
|
||||||
|
details.setCheckUser(SecurityUtils.getUserId());
|
||||||
|
details.setStatus(PurchaseTaskStatusEnum.TO_STORE.getStatus());
|
||||||
|
result = 0 < partCheckMapper.updatePurchaseDetails4Check(details) ? AjaxResult.success("验收成功") : AjaxResult.error("details无验证信息");
|
||||||
|
extractedFile(details);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 验收驳回处理流程
|
||||||
|
for (PartTypeCheckDetails details : partChaseVerifyVo.getPurchaseCheckDetailsList()) {
|
||||||
|
details.setStatus(PurchaseTaskStatusEnum.TO_CHECK_AFTER_REJECT.getStatus());
|
||||||
|
result = 0 < partCheckMapper.updatePurchaseDetails4Check(details) ? AjaxResult.success("驳回成功") : AjaxResult.error("details无验证信息");
|
||||||
|
extractedFile(details);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<Long> taskIdList = partChaseVerifyVo.getPurchaseCheckDetailsList().stream().
|
||||||
|
map(PartTypeCheckDetails::getTaskId)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
for (Long taskId : taskIdList) {
|
||||||
|
PartTypeQueryDto partTypeQueryDto = new PartTypeQueryDto();
|
||||||
|
partTypeQueryDto.setTaskId(taskId);
|
||||||
|
List<PartTypeCheckDetails> partTypeCheckDetailsList = partArrivedMapper.selectPartTypeCheckDetailsListByQueryDto(partTypeQueryDto);
|
||||||
|
// 将集合中的status取出
|
||||||
|
List<Integer> statusList = partTypeCheckDetailsList.stream()
|
||||||
|
.map(PartTypeCheckDetails::getStatus)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (!CollectionUtils.isEmpty(statusList)) {
|
||||||
|
int publishedStatus = PurchaseTaskStatusEnum.TO_CHECK.getStatus();
|
||||||
|
int inProgressStatus = PurchaseTaskStatusEnum.TO_CHECK_AFTER_REJECT.getStatus();
|
||||||
|
boolean notContainsNoFinished =!statusList.contains(publishedStatus);
|
||||||
|
boolean allReject = statusList.stream()
|
||||||
|
.allMatch(status -> status.equals(inProgressStatus));
|
||||||
|
if (notContainsNoFinished && !allReject) {
|
||||||
|
partArrivedMapper.updateTaskStatus(taskId, PurchaseTaskStatusEnum.TO_STORE.getStatus());
|
||||||
|
} else if (notContainsNoFinished && allReject) {
|
||||||
|
partArrivedMapper.updateTaskStatus(taskId, PurchaseTaskStatusEnum.TO_CHECK_AFTER_REJECT.getStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
} catch (final Exception e) {
|
||||||
|
return AjaxResult.error("验收状态更改失败,异常报错:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验收文件上传
|
||||||
|
* @param details
|
||||||
|
*/
|
||||||
|
private void extractedFile(PartTypeCheckDetails details) {
|
||||||
|
if (!CollectionUtils.isEmpty(details.getBmFileInfos())) {
|
||||||
|
for (final BmFileInfo bmFileInfo : details.getBmFileInfos()) {
|
||||||
|
if (null != bmFileInfo.getTaskType() && Objects.equals(TmTaskTypeEnum.TM_TASK_AGREEMENT_MANAGEMENT.getTaskTypeId(), bmFileInfo.getTaskType())) {
|
||||||
|
bmFileInfo.setTaskId(details.getTaskId());
|
||||||
|
bmFileInfo.setModelId(details.getId());
|
||||||
|
bmFileInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,23 +2,26 @@ package com.bonus.material.part.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
import com.bonus.material.part.domain.*;
|
import com.bonus.material.part.domain.*;
|
||||||
import com.bonus.material.part.mapper.PartAcceptMapper;
|
import com.bonus.material.part.mapper.PartAcceptMapper;
|
||||||
|
|
||||||
|
import com.bonus.material.part.mapper.PartArrivedMapper;
|
||||||
import com.bonus.material.part.service.IPartAcceptService;
|
import com.bonus.material.part.service.IPartAcceptService;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,12 +33,15 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class PartAcceptServiceImpl implements IPartAcceptService
|
public class PartAcceptServiceImpl implements IPartAcceptService
|
||||||
{
|
{
|
||||||
@Autowired
|
@Resource
|
||||||
private PartAcceptMapper partAcceptMapper;
|
private PartAcceptMapper partAcceptMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
BmFileInfoMapper bmFileInfoMapper;
|
BmFileInfoMapper bmFileInfoMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PartArrivedMapper partArrivedMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询配件类型三级树
|
* 查询配件类型三级树
|
||||||
* @param partTypeDto
|
* @param partTypeDto
|
||||||
|
|
@ -52,6 +58,7 @@ public class PartAcceptServiceImpl implements IPartAcceptService
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AjaxResult partTypeWarehouse(List<PartTypeCheckDetails> partTypeCheckDetails) {
|
public AjaxResult partTypeWarehouse(List<PartTypeCheckDetails> partTypeCheckDetails) {
|
||||||
if (partTypeCheckDetails.size() == 0){
|
if (partTypeCheckDetails.size() == 0){
|
||||||
return AjaxResult.error("请选择要操作的记录");
|
return AjaxResult.error("请选择要操作的记录");
|
||||||
|
|
@ -64,9 +71,27 @@ public class PartAcceptServiceImpl implements IPartAcceptService
|
||||||
return AjaxResult.error("操作失败");
|
return AjaxResult.error("操作失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int countThree = partAcceptMapper.selectStatus(partTypeCheckDetails.get(0).getTaskId());
|
PartTypeQueryDto partTypeQueryDto = new PartTypeQueryDto();
|
||||||
if(countThree == 0) {
|
Long taskId = partTypeCheckDetails.get(0).getTaskId();
|
||||||
partAcceptMapper.updateStatus(partTypeCheckDetails.get(0).getTaskId());
|
partTypeQueryDto.setTaskId(taskId);
|
||||||
|
List<PartTypeCheckDetails> partTypeCheckDetailsList = partArrivedMapper.selectPartTypeCheckDetailsListByQueryDto(partTypeQueryDto);
|
||||||
|
// 将集合中的status取出
|
||||||
|
List<Integer> statusList = partTypeCheckDetailsList.stream()
|
||||||
|
.map(PartTypeCheckDetails::getStatus)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (!CollectionUtils.isEmpty(statusList)) {
|
||||||
|
int publishedStatus = PurchaseTaskStatusEnum.TO_CHECK.getStatus();
|
||||||
|
int inProgressStatus = PurchaseTaskStatusEnum.TO_STORE.getStatus();
|
||||||
|
int inStoreStatus = PurchaseTaskStatusEnum.IN_STORE.getStatus();
|
||||||
|
boolean notContainsNoFinished =!statusList.contains(publishedStatus);
|
||||||
|
boolean containToStore = statusList.contains(inProgressStatus);
|
||||||
|
boolean allStore = statusList.stream()
|
||||||
|
.allMatch(status -> status.equals(inStoreStatus));
|
||||||
|
if (notContainsNoFinished && allStore) {
|
||||||
|
partArrivedMapper.updateTaskStatus(taskId, PurchaseTaskStatusEnum.IN_STORE.getStatus());
|
||||||
|
} else if (notContainsNoFinished && containToStore) {
|
||||||
|
partArrivedMapper.updateTaskStatus(taskId, PurchaseTaskStatusEnum.TASK_IN_PROGRESS.getStatus());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
package com.bonus.material.part.service.impl;
|
package com.bonus.material.part.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bonus.common.biz.enums.PurchaseTaskStageEnum;
|
||||||
|
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
||||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.common.biz.domain.BmFileInfo;
|
import com.bonus.common.biz.domain.BmFileInfo;
|
||||||
|
|
@ -11,6 +14,7 @@ import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
import com.bonus.material.part.domain.*;
|
import com.bonus.material.part.domain.*;
|
||||||
import com.bonus.material.part.mapper.PartArrivedMapper;
|
import com.bonus.material.part.mapper.PartArrivedMapper;
|
||||||
import com.bonus.material.part.service.IPartArrivedService;
|
import com.bonus.material.part.service.IPartArrivedService;
|
||||||
|
import com.bonus.material.purchase.domain.PurchaseCheckInfo;
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
|
|
@ -22,6 +26,7 @@ import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.bonus.common.biz.constant.MaterialConstants.PART_TASK_TYPE_LABEL;
|
import static com.bonus.common.biz.constant.MaterialConstants.PART_TASK_TYPE_LABEL;
|
||||||
|
|
||||||
|
|
@ -34,12 +39,17 @@ import static com.bonus.common.biz.constant.MaterialConstants.PART_TASK_TYPE_LAB
|
||||||
@Service
|
@Service
|
||||||
public class PartArrivedServiceImpl implements IPartArrivedService
|
public class PartArrivedServiceImpl implements IPartArrivedService
|
||||||
{
|
{
|
||||||
@Autowired
|
@Resource
|
||||||
private PartArrivedMapper partArrivedMapper;
|
private PartArrivedMapper partArrivedMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
BmFileInfoMapper bmFileInfoMapper;
|
BmFileInfoMapper bmFileInfoMapper;
|
||||||
|
|
||||||
|
// 引入新购任务阶段常量
|
||||||
|
private static final int PURCHASE_TASK_STAGE_MANAGE = 1;
|
||||||
|
private static final int PURCHASE_TASK_STAGE_CHECK = 2;
|
||||||
|
private static final int PURCHASE_TASK_STAGE_STORE = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询配件类型三级树--前端联动式下拉框
|
* 查询配件类型三级树--前端联动式下拉框
|
||||||
* @param partId 类型id
|
* @param partId 类型id
|
||||||
|
|
@ -96,7 +106,7 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
||||||
final int thisMonthMaxOrder = partArrivedMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_PART_TYPE.getTaskTypeId());
|
final int thisMonthMaxOrder = partArrivedMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_PART_TYPE.getTaskTypeId());
|
||||||
String taskCode = genderTaskCode(thisMonthMaxOrder);
|
String taskCode = genderTaskCode(thisMonthMaxOrder);
|
||||||
final TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_PART_TYPE.getTaskTypeId(),
|
final TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_PART_TYPE.getTaskTypeId(),
|
||||||
0,
|
PurchaseTaskStatusEnum.TO_NOTICE.getStatus(),
|
||||||
partTypeCheckDto.getPartTypeCheckInfo().getCompanyId(), thisMonthMaxOrder + 1, taskCode);
|
partTypeCheckDto.getPartTypeCheckInfo().getCompanyId(), thisMonthMaxOrder + 1, taskCode);
|
||||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||||
partArrivedMapper.insertTmTask(tmTask);
|
partArrivedMapper.insertTmTask(tmTask);
|
||||||
|
|
@ -119,7 +129,7 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
||||||
if (!CollectionUtils.isEmpty(partTypeCheckDetailsList)) {
|
if (!CollectionUtils.isEmpty(partTypeCheckDetailsList)) {
|
||||||
for (PartTypeCheckDetails details : partTypeCheckDetailsList) {
|
for (PartTypeCheckDetails details : partTypeCheckDetailsList) {
|
||||||
details.setTaskId(taskId);
|
details.setTaskId(taskId);
|
||||||
details.setStatus(0);
|
details.setStatus(1);
|
||||||
details.setInputStatus("0");
|
details.setInputStatus("0");
|
||||||
final List<BmFileInfo> bmFileInfos = details.getBmFileInfos();
|
final List<BmFileInfo> bmFileInfos = details.getBmFileInfos();
|
||||||
if (!CollectionUtils.isEmpty(bmFileInfos)) {
|
if (!CollectionUtils.isEmpty(bmFileInfos)) {
|
||||||
|
|
@ -162,20 +172,50 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
||||||
@Override
|
@Override
|
||||||
public List<PartTypeCheckInfo> selectPartTypeCheckInfoList(PartTypeQueryDto partTypeQueryDto) {
|
public List<PartTypeCheckInfo> selectPartTypeCheckInfoList(PartTypeQueryDto partTypeQueryDto) {
|
||||||
List<PartTypeCheckInfo> partTypeCheckInfos = partArrivedMapper.selectPartTypeCheckInfoJoinList(partTypeQueryDto);
|
List<PartTypeCheckInfo> partTypeCheckInfos = partArrivedMapper.selectPartTypeCheckInfoJoinList(partTypeQueryDto);
|
||||||
int count = 0;
|
List<PartTypeCheckInfo> purchaseCheckInfoResult = new ArrayList<>();
|
||||||
for (int i = 0; i < partTypeCheckInfos.size(); i++) {
|
for (int i = 0; i < partTypeCheckInfos.size(); i++) {
|
||||||
List<PartTypeCheckDetails> partTypeCheckDetails = partArrivedMapper.selectPartTypeCheckDetailsList(partTypeCheckInfos.get(i).getTaskId());
|
List<PartTypeCheckDetails> partTypeCheckDetails = partArrivedMapper.selectPartTypeCheckDetailsList(partTypeCheckInfos.get(i).getTaskId());
|
||||||
if(partTypeCheckDetails.size()>0){
|
if (null != partTypeQueryDto.getTaskStage()) {
|
||||||
count = (int) partTypeCheckDetails.stream()
|
// 根据阶段来过滤详情数据
|
||||||
.filter(details -> details.getStatus() == 0)
|
switch (partTypeQueryDto.getTaskStage()) {
|
||||||
.count();
|
case PURCHASE_TASK_STAGE_MANAGE:
|
||||||
if(count>0){
|
// 新购管理阶段展示全部任务、不进行过滤
|
||||||
|
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("已完成");
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case PURCHASE_TASK_STAGE_CHECK:
|
||||||
|
partTypeCheckDetails = partTypeCheckDetails.stream().filter(o -> !PurchaseTaskStatusEnum.TO_NOTICE.getStatus().equals(o.getStatus())).collect(Collectors.toList());
|
||||||
|
partTypeCheckDetails = partTypeCheckDetails.stream().filter(o -> !PurchaseTaskStatusEnum.TO_CHECK_AFTER_REJECT.getStatus().equals(o.getStatus())).collect(Collectors.toList());
|
||||||
|
if (partTypeCheckInfos.get(i).getTaskStatus().equals(PurchaseTaskStatusEnum.TO_CHECK.getStatus())) {
|
||||||
|
partTypeCheckInfos.get(i).setTaskStatusName("未完成");
|
||||||
|
} else {
|
||||||
|
partTypeCheckInfos.get(i).setTaskStatusName("已完成");
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case PURCHASE_TASK_STAGE_STORE:
|
||||||
|
partTypeCheckDetails = partTypeCheckDetails.stream().filter(o ->
|
||||||
|
PurchaseTaskStatusEnum.IN_STORE.getStatus().equals(o.getStatus()) ||
|
||||||
|
PurchaseTaskStatusEnum.TO_STORE.getStatus().equals(o.getStatus()) ||
|
||||||
|
PurchaseTaskStatusEnum.TASK_FINISHED.getStatus().equals(o.getStatus()) ||
|
||||||
|
(PurchaseTaskStatusEnum.TO_CHECK.getStatus().equals(o.getStatus()))
|
||||||
|
).collect(Collectors.toList());
|
||||||
|
if (partTypeCheckInfos.get(i).getTaskStatus().equals(PurchaseTaskStatusEnum.TASK_IN_PROGRESS.getStatus()) ||
|
||||||
|
partTypeCheckInfos.get(i).getTaskStatus().equals(PurchaseTaskStatusEnum.TO_STORE.getStatus()) ||
|
||||||
|
partTypeCheckInfos.get(i).getTaskStatus().equals(PurchaseTaskStatusEnum.TO_CHECK.getStatus())) {
|
||||||
|
partTypeCheckInfos.get(i).setTaskStatusName("未完成");
|
||||||
|
} else {
|
||||||
|
partTypeCheckInfos.get(i).setTaskStatusName("已完成");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
System.err.println("未知的新购任务阶段:" + partTypeQueryDto.getTaskStage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!CollectionUtils.isEmpty(partTypeCheckDetails)) {
|
||||||
BigDecimal purchaseNum = new BigDecimal(0);
|
BigDecimal purchaseNum = new BigDecimal(0);
|
||||||
BigDecimal purchasePrice = new BigDecimal(0);
|
BigDecimal purchasePrice = new BigDecimal(0);
|
||||||
BigDecimal purchaseTaxPrice = new BigDecimal(0);
|
BigDecimal purchaseTaxPrice = new BigDecimal(0);
|
||||||
|
|
@ -194,7 +234,36 @@ public class PartArrivedServiceImpl implements IPartArrivedService
|
||||||
partTypeCheckInfos.get(i).setPurchaseTaxPrice(purchaseTaxPrice);
|
partTypeCheckInfos.get(i).setPurchaseTaxPrice(purchaseTaxPrice);
|
||||||
partTypeCheckInfos.get(i).setPurchaseMaTypeName(partName);
|
partTypeCheckInfos.get(i).setPurchaseMaTypeName(partName);
|
||||||
}
|
}
|
||||||
return partTypeCheckInfos;
|
purchaseCheckInfoResult.add(partTypeCheckInfos.get(i));
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(purchaseCheckInfoResult)) {
|
||||||
|
String keyWord = partTypeQueryDto.getKeyWord();
|
||||||
|
// 如果关键字不为空,进行过滤
|
||||||
|
if (StringUtils.isNotBlank(keyWord)) {
|
||||||
|
purchaseCheckInfoResult = purchaseCheckInfoResult.stream()
|
||||||
|
.filter(item -> containsKeyword(item, keyWord))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(partTypeQueryDto.getTaskStatusName())) {
|
||||||
|
purchaseCheckInfoResult = purchaseCheckInfoResult.stream()
|
||||||
|
.filter(item -> item.getTaskStatusName().equals(partTypeQueryDto.getTaskStatusName()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return purchaseCheckInfoResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断关键字是否在任务信息中
|
||||||
|
* @param item
|
||||||
|
* @param keyWord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean containsKeyword(PartTypeCheckInfo item, String keyWord) {
|
||||||
|
return (item.getPurchaseMaTypeName() != null && item.getPurchaseMaTypeName().contains(keyWord)) ||
|
||||||
|
(item.getCode() != null && item.getCode().contains(keyWord)) ||
|
||||||
|
(item.getSupplier() != null && item.getSupplier().contains(keyWord)) ||
|
||||||
|
(item.getCreateBy() != null && item.getCreateBy().contains(keyWord));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,11 @@ import java.util.List;
|
||||||
@ToString
|
@ToString
|
||||||
public class PurchaseNoticePersonDto {
|
public class PurchaseNoticePersonDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否配件验收,0 是
|
||||||
|
*/
|
||||||
|
private Integer isPartFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电话号码
|
* 电话号码
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||||
import com.bonus.common.core.utils.sms.SmsUtils;
|
import com.bonus.common.core.utils.sms.SmsUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.part.mapper.PartCheckMapper;
|
||||||
import com.bonus.material.purchase.domain.dto.PurchaseNoticePersonDto;
|
import com.bonus.material.purchase.domain.dto.PurchaseNoticePersonDto;
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
|
|
@ -37,6 +38,9 @@ public class PurchaseNoticePersonServiceImpl implements IPurchaseNoticePersonSer
|
||||||
@Resource
|
@Resource
|
||||||
private PurchaseCheckDetailsServiceImpl purchaseCheckDetailsService;
|
private PurchaseCheckDetailsServiceImpl purchaseCheckDetailsService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PartCheckMapper partCheckMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询新购短信通知人员
|
* 查询新购短信通知人员
|
||||||
*
|
*
|
||||||
|
|
@ -84,6 +88,15 @@ public class PurchaseNoticePersonServiceImpl implements IPurchaseNoticePersonSer
|
||||||
String sendResult = SmsUtils.smsToken(splitPhoneNumber, purchaseNoticePersonDto.getContent(),"");
|
String sendResult = SmsUtils.smsToken(splitPhoneNumber, purchaseNoticePersonDto.getContent(),"");
|
||||||
if (sendResult != null) {
|
if (sendResult != null) {
|
||||||
// 发送短信后修改任务状态
|
// 发送短信后修改任务状态
|
||||||
|
if (purchaseNoticePersonDto.getIsPartFlag() != null && purchaseNoticePersonDto.getIsPartFlag() == 0) {
|
||||||
|
tmTaskMapper.updateTmTask(new TmTask()
|
||||||
|
.setTaskId(purchaseNoticePersonDto.getTaskId())
|
||||||
|
.setTaskType(TmTaskTypeEnum.TM_TASK_PART_TYPE.getTaskTypeId())
|
||||||
|
.setTaskStatus(PurchaseTaskStatusEnum.TO_CHECK.getStatus())
|
||||||
|
);
|
||||||
|
// 修改配件采购明细的任务状态
|
||||||
|
partCheckMapper.batchUpdateDetailsTaskStatus(purchaseNoticePersonDto.getTaskId(), PurchaseTaskStatusEnum.TO_CHECK.getStatus(), "");
|
||||||
|
}
|
||||||
tmTaskMapper.updateTmTask(new TmTask()
|
tmTaskMapper.updateTmTask(new TmTask()
|
||||||
.setTaskId(purchaseNoticePersonDto.getTaskId())
|
.setTaskId(purchaseNoticePersonDto.getTaskId())
|
||||||
.setTaskType(TmTaskTypeEnum.TM_TASK_PURCHASE.getTaskTypeId())
|
.setTaskType(TmTaskTypeEnum.TM_TASK_PURCHASE.getTaskTypeId())
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<update id="partTypeWarehouse">
|
<update id="partTypeWarehouse">
|
||||||
update purchase_part_details
|
update purchase_part_details
|
||||||
set status = 1
|
set
|
||||||
|
input_num = #{purchaseNum},
|
||||||
|
input_time = now(),
|
||||||
|
status = 19
|
||||||
where id = #{id} and del_flag = 0
|
where id = #{id} and del_flag = 0
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.material.part.mapper.PartArrivedMapper">
|
<mapper namespace="com.bonus.material.part.mapper.PartArrivedMapper">
|
||||||
|
|
||||||
|
<update id="updateTaskStatus">
|
||||||
|
update
|
||||||
|
tm_task
|
||||||
|
set
|
||||||
|
task_status = #{status}
|
||||||
|
where
|
||||||
|
task_id = #{taskId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="getTypeTree" resultType="com.bonus.material.part.domain.PartTypeDto">
|
<select id="getTypeTree" resultType="com.bonus.material.part.domain.PartTypeDto">
|
||||||
select DISTINCT m.pa_id as partId, m.pa_name as partName, m.parent_id as parentId, m.unit_id as unitId, m.unit_name as unitName, m.storage_num as storageNum,
|
select DISTINCT m.pa_id as partId, m.pa_name as partName, m.parent_id as parentId, m.unit_id as unitId, m.unit_name as unitName, m.storage_num as storageNum,
|
||||||
m.rent_price as rentPrice, m.buy_price as buyPrice, m.level,m.del_flag as delFlag,m.remark
|
m.rent_price as rentPrice, m.buy_price as buyPrice, m.level,m.del_flag as delFlag,m.remark
|
||||||
|
|
@ -114,15 +123,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="startTime != null "> and date_format(ppi.create_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')</if>
|
<if test="startTime != null "> and date_format(ppi.create_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d')</if>
|
||||||
<if test="endTime != null "> and date_format(ppi.create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if>
|
<if test="endTime != null "> and date_format(ppi.create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if>
|
||||||
<if test="taskStatus != null "> and t.task_status = #{taskStatus}</if>
|
<if test="taskStatus != null "> and t.task_status = #{taskStatus}</if>
|
||||||
<if test="keyWord != null and keyWord != ''">
|
|
||||||
and (
|
|
||||||
t.code like concat('%', #{keyWord}, '%') or
|
|
||||||
msi.supplier like concat('%', #{keyWord}, '%') or
|
|
||||||
ppi.create_by like concat('%', #{keyWord}, '%') or
|
|
||||||
ppi.arrival_time like concat('%', #{keyWord}, '%') or
|
|
||||||
ppi.create_time like concat('%', #{keyWord}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
</where>
|
||||||
order by ppi.create_time desc
|
order by ppi.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -138,7 +138,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectPartTypeCheckDetailsListByQueryDto" resultType="com.bonus.material.part.domain.PartTypeCheckDetails">
|
<select id="selectPartTypeCheckDetailsListByQueryDto" resultType="com.bonus.material.part.domain.PartTypeCheckDetails">
|
||||||
select ppd.id as id,part_id as partId,mpt.pa_name as partName,ppd.task_id as taskId,purchase_price as purchasePrice,purchase_tax_price as purchaseTaxPrice,purchase_num as purchaseNum,
|
select ppd.id as id,part_id as partId,mpt.pa_name as partName,ppd.task_id as taskId,purchase_price as purchasePrice,purchase_tax_price as purchaseTaxPrice,purchase_num as purchaseNum,
|
||||||
mpt.unit_name as unitName,mpt.rent_price as rentPrice,ppd.production_time as productionTime,mpt2.pa_name as maTypeName,ppd.status,
|
mpt.unit_name as unitName,mpt.rent_price as rentPrice,ppd.production_time as productionTime,mpt2.pa_name as maTypeName,ppd.status,
|
||||||
mpt3.pa_name as maName,msi.supplier as supplierName
|
mpt3.pa_name as maName,msi.supplier as supplierName, ppd.check_result as checkResult
|
||||||
from purchase_part_details ppd
|
from purchase_part_details ppd
|
||||||
left join ma_part_type mpt on ppd.part_id = mpt.pa_id and mpt.del_flag = 0
|
left join ma_part_type mpt on ppd.part_id = mpt.pa_id and mpt.del_flag = 0
|
||||||
left join purchase_part_info ppi on ppi.id = 2
|
left join purchase_part_info ppi on ppi.id = 2
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.bonus.material.part.mapper.PartCheckMapper">
|
||||||
|
|
||||||
|
<update id="batchUpdateDetailsTaskStatus">
|
||||||
|
update purchase_part_details
|
||||||
|
set status = #{newTaskStatus}
|
||||||
|
where task_id = #{taskId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updatePurchaseDetails4Check">
|
||||||
|
update
|
||||||
|
purchase_part_details
|
||||||
|
<set>
|
||||||
|
`status` = #{status},check_result = #{checkResult},check_time = NOW(),
|
||||||
|
<if test="status != null and status == 4">
|
||||||
|
check_num = purchase_num,
|
||||||
|
</if>
|
||||||
|
<if test="checkUser != null">
|
||||||
|
check_user = #{checkUser}
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
<where>
|
||||||
|
<if test="taskId != null">
|
||||||
|
and task_id = #{taskId}
|
||||||
|
</if>
|
||||||
|
<if test="partId != null">
|
||||||
|
and part_id = #{partId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
|
|
@ -316,7 +316,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
update
|
update
|
||||||
purchase_check_details
|
purchase_check_details
|
||||||
set
|
set
|
||||||
pre_status = #{status}, `status` = #{newTaskStatus}, check_result = #{checkResult}
|
`status` = #{newTaskStatus}, check_result = #{checkResult}
|
||||||
where
|
where
|
||||||
task_id = #{taskId}
|
task_id = #{taskId}
|
||||||
and
|
and
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue