试验检验审核驳回修改
This commit is contained in:
parent
2d6b540764
commit
d595a6b80a
|
|
@ -107,6 +107,12 @@
|
||||||
<version>5.8.16</version>
|
<version>5.8.16</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.bonus.sgzb</groupId>
|
||||||
|
<artifactId>sgzb-modules-base</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
@ -114,4 +120,21 @@
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -14,15 +14,11 @@ import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.bonus.sgzb.common.log.annotation.Log;
|
import com.bonus.sgzb.common.log.annotation.Log;
|
||||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||||
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
|
|
||||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
|
||||||
|
|
@ -105,4 +101,5 @@ public class RepairAuditDetailsController extends BaseController
|
||||||
return toAjax(repairAuditDetailsService.auditRepair(scrapAudit));
|
return toAjax(repairAuditDetailsService.auditRepair(scrapAudit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,6 @@ public class ScrapApplyDetails extends BaseEntity
|
||||||
@ApiModelProperty(value = "机具编号")
|
@ApiModelProperty(value = "机具编号")
|
||||||
private String maCode;
|
private String maCode;
|
||||||
|
|
||||||
|
|
||||||
// 传入参数
|
// 传入参数
|
||||||
@ApiModelProperty(value = "单位id")
|
@ApiModelProperty(value = "单位id")
|
||||||
private Integer backUnit;
|
private Integer backUnit;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.sgzb.material.mapper;
|
package com.bonus.sgzb.material.mapper;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.base.domain.RepairTaskDetails;
|
||||||
import com.bonus.sgzb.material.domain.RepairAuditDetails;
|
import com.bonus.sgzb.material.domain.RepairAuditDetails;
|
||||||
import com.bonus.sgzb.material.vo.RepairAuditDetailsVO;
|
import com.bonus.sgzb.material.vo.RepairAuditDetailsVO;
|
||||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||||
|
|
@ -75,4 +76,8 @@ public interface RepairAuditDetailsMapper
|
||||||
List<RepairAuditDetails> selectRepairInputByTaskId(Long taskId);
|
List<RepairAuditDetails> selectRepairInputByTaskId(Long taskId);
|
||||||
|
|
||||||
List<RepairAuditDetails> selectScrapNumByTaskId(Long taskId);
|
List<RepairAuditDetails> selectScrapNumByTaskId(Long taskId);
|
||||||
|
|
||||||
|
int updateStatus(RepairAuditDetails bean);
|
||||||
|
|
||||||
|
int insertRepairDetails(RepairTaskDetails repairTaskDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -113,4 +113,5 @@ public interface RepairTestInputMapper {
|
||||||
* @date 2024/1/9 15:14
|
* @date 2024/1/9 15:14
|
||||||
*/
|
*/
|
||||||
List<RepairTestInputDetailVo> exportList(RepairTestInputDto bean);
|
List<RepairTestInputDetailVo> exportList(RepairTestInputDto bean);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@ package com.bonus.sgzb.material.service.impl;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.base.domain.RepairTaskDetails;
|
||||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||||
|
|
@ -160,22 +162,41 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
@Transactional(rollbackFor=Exception.class)
|
@Transactional(rollbackFor=Exception.class)
|
||||||
public int auditRepair(ScrapAudit scrapAudit) throws Exception {
|
public int auditRepair(ScrapAudit scrapAudit) throws Exception {
|
||||||
String checkResult = scrapAudit.getCheckResult();
|
String checkResult = scrapAudit.getCheckResult();
|
||||||
|
List<RepairAuditDetails> auditDetailList = scrapAudit.getAuditDetailList();
|
||||||
List<Long> taskIdList = scrapAudit.getTaskIdList();
|
List<Long> taskIdList = scrapAudit.getTaskIdList();
|
||||||
|
BigDecimal b = new BigDecimal(0);
|
||||||
for (Long taskId : taskIdList) {
|
for (Long taskId : taskIdList) {
|
||||||
|
String status = "0";
|
||||||
TmTask task1 = taskMapper.selectTmTaskByTaskId(taskId);
|
TmTask task1 = taskMapper.selectTmTaskByTaskId(taskId);
|
||||||
if (task1.getTaskStatus() == 47) {
|
if (task1.getTaskStatus() == 47) {
|
||||||
throw new Exception("任务已审核已通过");
|
throw new Exception("任务已审核已通过");
|
||||||
}
|
}
|
||||||
if ("通过".equals(checkResult)) {
|
|
||||||
|
|
||||||
String taskCode ="";
|
List<RepairAuditDetails> auditAllList = repairAuditDetailsMapper.selectRepairAuditDetailsByTaskId(taskId);
|
||||||
int taskStatus= 0;
|
// 查询协议表
|
||||||
int taskType = 0;
|
TmTaskAgreement tmTaskAgreement = agreementMapper.selectTmTaskAgreementByTaskId(taskId);
|
||||||
int companyId = 0;
|
String taskCode ="";
|
||||||
// 查询协议表
|
int taskStatus= 0;
|
||||||
TmTaskAgreement tmTaskAgreement = agreementMapper.selectTmTaskAgreementByTaskId(taskId);
|
int taskType = 0;
|
||||||
List<RepairAuditDetails> repairInputList = repairAuditDetailsMapper.selectRepairInputByTaskId(taskId);
|
int companyId = 0;
|
||||||
List<RepairAuditDetails> scrapNumList = repairAuditDetailsMapper.selectScrapNumByTaskId(taskId);
|
if ("通过".equals(checkResult)) {
|
||||||
|
status = "1";
|
||||||
|
List<RepairAuditDetails> repairInputList = new ArrayList<>();
|
||||||
|
List<RepairAuditDetails> scrapNumList = new ArrayList<>();
|
||||||
|
if (auditDetailList != null && auditDetailList.size()>0){
|
||||||
|
for (RepairAuditDetails bean : auditDetailList){
|
||||||
|
if (bean.getRepairedNum().compareTo(b)>0){
|
||||||
|
repairInputList.add(bean);
|
||||||
|
}
|
||||||
|
if (bean.getScrapNum().compareTo(b)>0){
|
||||||
|
scrapNumList.add(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
repairInputList = repairAuditDetailsMapper.selectRepairInputByTaskId(taskId);
|
||||||
|
scrapNumList = repairAuditDetailsMapper.selectScrapNumByTaskId(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
if(repairInputList != null && repairInputList.size() > 0){
|
if(repairInputList != null && repairInputList.size() > 0){
|
||||||
companyId = repairInputList.get(0).getCompanyId();
|
companyId = repairInputList.get(0).getCompanyId();
|
||||||
taskCode = purchaseCodeRule("R",50);
|
taskCode = purchaseCodeRule("R",50);
|
||||||
|
|
@ -186,7 +207,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
Long typeId = inputDetails.getTypeId();
|
Long typeId = inputDetails.getTypeId();
|
||||||
Long maId = inputDetails.getMaId();
|
Long maId = inputDetails.getMaId();
|
||||||
BigDecimal repairNum = inputDetails.getRepairedNum();
|
BigDecimal repairNum = inputDetails.getRepairedNum();
|
||||||
BigDecimal b = new BigDecimal(0);
|
|
||||||
// 创建修饰后入库任务
|
// 创建修饰后入库任务
|
||||||
if (repairNum.compareTo(b) > 0) {
|
if (repairNum.compareTo(b) > 0) {
|
||||||
// 添加修试后入库任务
|
// 添加修试后入库任务
|
||||||
|
|
@ -213,7 +234,6 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
for (RepairAuditDetails scrapDetails : scrapNumList) {
|
for (RepairAuditDetails scrapDetails : scrapNumList) {
|
||||||
Long typeId = scrapDetails.getTypeId();
|
Long typeId = scrapDetails.getTypeId();
|
||||||
Long maId = scrapDetails.getMaId();
|
Long maId = scrapDetails.getMaId();
|
||||||
BigDecimal b = new BigDecimal(0);
|
|
||||||
// 创建报废任务
|
// 创建报废任务
|
||||||
BigDecimal scrapNum = scrapDetails.getScrapNum();
|
BigDecimal scrapNum = scrapDetails.getScrapNum();
|
||||||
if (scrapNum.compareTo(b) > 0) {
|
if (scrapNum.compareTo(b) > 0) {
|
||||||
|
|
@ -234,20 +254,68 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
|
|
||||||
}
|
}
|
||||||
// 修饰审核通过时改修任务为已通过审核
|
// 修饰审核通过时改修任务为已通过审核
|
||||||
task1.setTaskStatus(47);
|
int i = 0;
|
||||||
|
int j = 0;
|
||||||
|
if (repairInputList != null){
|
||||||
|
i = repairInputList.size();
|
||||||
|
}
|
||||||
|
if (scrapNumList != null){
|
||||||
|
j = scrapNumList.size();
|
||||||
|
}
|
||||||
|
if (auditAllList.size() == (i + j)){
|
||||||
|
task1.setTaskStatus(47);
|
||||||
|
}
|
||||||
task1.setUpdateTime(new Date());
|
task1.setUpdateTime(new Date());
|
||||||
task1.setUpdateBy(SecurityUtils.getUsername());
|
task1.setUpdateBy(SecurityUtils.getUsername());
|
||||||
taskMapper.updateTmTask(task1);
|
taskMapper.updateTmTask(task1);
|
||||||
} else {
|
} else {
|
||||||
|
status = "2";
|
||||||
|
List<RepairAuditDetails> repairDetailList = new ArrayList<>();
|
||||||
|
if (auditDetailList != null && auditDetailList.size()>0){
|
||||||
|
repairDetailList.addAll(auditDetailList);
|
||||||
|
}else {
|
||||||
|
repairDetailList.addAll(auditAllList);
|
||||||
|
}
|
||||||
|
if(repairDetailList != null && repairDetailList.size() > 0){
|
||||||
|
companyId = repairDetailList.get(0).getCompanyId();
|
||||||
|
taskCode = purchaseCodeRule("WX",41);
|
||||||
|
taskStatus = 42;
|
||||||
|
taskType = 41;
|
||||||
|
long inputTaskId = genTask(taskCode,taskType,taskStatus,tmTaskAgreement,companyId);
|
||||||
|
for (RepairAuditDetails inputDetails : repairDetailList) {
|
||||||
|
// 添加驳回后维修详细表数据
|
||||||
|
RepairTaskDetails repairTaskDetails = new RepairTaskDetails();
|
||||||
|
repairTaskDetails.setTaskId(String.valueOf(inputTaskId));
|
||||||
|
repairTaskDetails.setMaId(String.valueOf(inputDetails.getMaId()));
|
||||||
|
repairTaskDetails.setTypeId(String.valueOf(inputDetails.getTypeId()));
|
||||||
|
BigDecimal repairNum = inputDetails.getRepairNum();
|
||||||
|
int i = repairNum.intValue(); // 直接转换
|
||||||
|
repairTaskDetails.setRepairNum(i);
|
||||||
|
repairTaskDetails.setStatus("0");
|
||||||
|
repairTaskDetails.setCreateBy(SecurityUtils.getUserId());
|
||||||
|
repairTaskDetails.setCompanyId((long) companyId);
|
||||||
|
repairAuditDetailsMapper.insertRepairDetails(repairTaskDetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
// 修饰审核任务不通过时
|
// 修饰审核任务不通过时
|
||||||
TmTask tmTask = new TmTask();
|
TmTask tmTask = new TmTask();
|
||||||
tmTask.setTaskId(taskId);
|
tmTask.setTaskId(taskId);
|
||||||
tmTask.setRemark(scrapAudit.getRemark());
|
tmTask.setRemark(scrapAudit.getRemark());
|
||||||
tmTask.setTaskStatus(48);
|
int i = repairDetailList.size();
|
||||||
|
if (auditAllList.size() == i){
|
||||||
|
tmTask.setTaskStatus(48);
|
||||||
|
}
|
||||||
tmTask.setUpdateTime(new Date());
|
tmTask.setUpdateTime(new Date());
|
||||||
tmTask.setUpdateBy(SecurityUtils.getUsername());
|
tmTask.setUpdateBy(SecurityUtils.getUsername());
|
||||||
taskMapper.updateTmTask(tmTask);
|
taskMapper.updateTmTask(tmTask);
|
||||||
}
|
}
|
||||||
|
if (scrapAudit.getAuditDetailList() != null && scrapAudit.getAuditDetailList().size() > 0){
|
||||||
|
for (RepairAuditDetails bean : auditDetailList){
|
||||||
|
bean.setAuditBy(SecurityUtils.getUserId());
|
||||||
|
bean.setStatus(status);
|
||||||
|
repairAuditDetailsMapper.updateStatus(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.sgzb.material.vo;
|
package com.bonus.sgzb.material.vo;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.material.domain.RepairAuditDetails;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
@ -17,4 +18,7 @@ public class ScrapAudit {
|
||||||
@ApiModelProperty(value = "不通过原因")
|
@ApiModelProperty(value = "不通过原因")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "审核任务明细id")
|
||||||
|
private List<RepairAuditDetails> auditDetailList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="companyId != null">#{companyId},</if>
|
<if test="companyId != null">#{companyId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertRepairDetails">
|
||||||
|
insert into repair_apply_details
|
||||||
|
(
|
||||||
|
<if test="taskId != null">
|
||||||
|
task_id,
|
||||||
|
</if>
|
||||||
|
<if test="maId != null">
|
||||||
|
ma_id,
|
||||||
|
</if>
|
||||||
|
<if test="typeId != null">
|
||||||
|
type_id,
|
||||||
|
</if>
|
||||||
|
<if test="backNum != null">
|
||||||
|
repair_num,
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
status,
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
create_by,
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
update_by,
|
||||||
|
</if>
|
||||||
|
update_time,
|
||||||
|
<if test="remark != null and remark != ''">
|
||||||
|
remark,
|
||||||
|
</if>
|
||||||
|
<if test="companyId != null">
|
||||||
|
company_id,
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
back_id,
|
||||||
|
</if>
|
||||||
|
create_time
|
||||||
|
)
|
||||||
|
values (
|
||||||
|
<if test="taskId != null">
|
||||||
|
#{taskId},
|
||||||
|
</if>
|
||||||
|
<if test="maId != null">
|
||||||
|
#{maId},
|
||||||
|
</if>
|
||||||
|
<if test="typeId != null">
|
||||||
|
#{typeId},
|
||||||
|
</if>
|
||||||
|
<if test="backNum != null">
|
||||||
|
#{backNum},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
#{status},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
#{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
#{createBy},
|
||||||
|
</if>
|
||||||
|
NOW(),
|
||||||
|
<if test="remark != null and remark != ''">
|
||||||
|
#{remark},
|
||||||
|
</if>
|
||||||
|
<if test="companyId != null">
|
||||||
|
#{companyId},
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
#{id},
|
||||||
|
</if>
|
||||||
|
NOW()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateRepairAuditDetails" parameterType="com.bonus.sgzb.material.domain.RepairAuditDetails">
|
<update id="updateRepairAuditDetails" parameterType="com.bonus.sgzb.material.domain.RepairAuditDetails">
|
||||||
update repair_audit_details
|
update repair_audit_details
|
||||||
|
|
@ -143,6 +214,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateStatus">
|
||||||
|
update repair_audit_details
|
||||||
|
set audit_by = #{auditBy},
|
||||||
|
audit_time = now(),
|
||||||
|
status = #{status}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="deleteRepairAuditDetailsById" parameterType="Long">
|
<delete id="deleteRepairAuditDetailsById" parameterType="Long">
|
||||||
delete from repair_audit_details where id = #{id}
|
delete from repair_audit_details where id = #{id}
|
||||||
|
|
|
||||||
|
|
@ -248,4 +248,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="companyId != null">#{companyId},</if>
|
<if test="companyId != null">#{companyId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue