功能修改优化
This commit is contained in:
parent
06fda2ebf7
commit
0e10b67591
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.common.biz.config;
|
package com.bonus.common.biz.config;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -83,7 +84,7 @@ public class ListPagingUtil {
|
||||||
this.setPageSize(pageSize);
|
this.setPageSize(pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ListPagingUtil paging(Integer currentPage, Integer pageSize, List<?> list) {
|
/*public static ListPagingUtil paging(Integer currentPage, Integer pageSize, List<?> list) {
|
||||||
ListPagingUtil pagingUtil = new ListPagingUtil();
|
ListPagingUtil pagingUtil = new ListPagingUtil();
|
||||||
//初始化
|
//初始化
|
||||||
pagingUtil.pageStartInfo(currentPage, pageSize);
|
pagingUtil.pageStartInfo(currentPage, pageSize);
|
||||||
|
|
@ -95,6 +96,43 @@ public class ListPagingUtil {
|
||||||
pagingUtil.setTotalPage(pagingUtil.getTotal() % pagingUtil.getPageSize() == 0 ? pagingUtil.getTotal()/pagingUtil.getPageSize() :pagingUtil.getTotal()/pagingUtil.getPageSize()+1);
|
pagingUtil.setTotalPage(pagingUtil.getTotal() % pagingUtil.getPageSize() == 0 ? pagingUtil.getTotal()/pagingUtil.getPageSize() :pagingUtil.getTotal()/pagingUtil.getPageSize()+1);
|
||||||
//截取list
|
//截取list
|
||||||
pagingUtil.setRows(list.subList(pagingUtil.getStar(), pagingUtil.getTotal()-pagingUtil.getStar()>pagingUtil.getPageSize()?pagingUtil.getStar()+pagingUtil.getPageSize():pagingUtil.getTotal()));
|
pagingUtil.setRows(list.subList(pagingUtil.getStar(), pagingUtil.getTotal()-pagingUtil.getStar()>pagingUtil.getPageSize()?pagingUtil.getStar()+pagingUtil.getPageSize():pagingUtil.getTotal()));
|
||||||
|
return pagingUtil;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public static ListPagingUtil paging(Integer currentPage, Integer pageSize, List<?> list) {
|
||||||
|
ListPagingUtil pagingUtil = new ListPagingUtil();
|
||||||
|
|
||||||
|
// 初始化分页信息
|
||||||
|
pagingUtil.pageStartInfo(currentPage, pageSize);
|
||||||
|
|
||||||
|
// 计算起始索引
|
||||||
|
pagingUtil.setStar((pagingUtil.getCurrentPage() - 1) * pagingUtil.getPageSize());
|
||||||
|
|
||||||
|
// 设置总数
|
||||||
|
pagingUtil.setTotal(list.size());
|
||||||
|
|
||||||
|
// 设置总页数
|
||||||
|
int totalPage = pagingUtil.getTotal() / pagingUtil.getPageSize();
|
||||||
|
if (pagingUtil.getTotal() % pagingUtil.getPageSize() != 0) {
|
||||||
|
totalPage++; // 如果有余数,则总页数 +1
|
||||||
|
}
|
||||||
|
pagingUtil.setTotalPage(totalPage);
|
||||||
|
|
||||||
|
// 确保起始索引不会大于列表大小
|
||||||
|
int fromIndex = pagingUtil.getStar();
|
||||||
|
if (fromIndex >= pagingUtil.getTotal()) {
|
||||||
|
// 当前页的起始索引超过了总数据,返回空数据
|
||||||
|
pagingUtil.setRows(Collections.emptyList());
|
||||||
|
return pagingUtil;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算结束索引,确保不超过总数据大小
|
||||||
|
int toIndex = Math.min(fromIndex + pagingUtil.getPageSize(), pagingUtil.getTotal());
|
||||||
|
|
||||||
|
// 获取当前页的数据
|
||||||
|
pagingUtil.setRows(list.subList(fromIndex, toIndex));
|
||||||
|
|
||||||
return pagingUtil;
|
return pagingUtil;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,12 @@ public class BackApplyDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "审批数量")
|
@ApiModelProperty(value = "审批数量")
|
||||||
private BigDecimal auditNum;
|
private BigDecimal auditNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "外观判断不合格数量")
|
||||||
|
private BigDecimal badNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "外观判断合格数量")
|
||||||
|
private BigDecimal goodNum;
|
||||||
|
|
||||||
/** 在用数量 */
|
/** 在用数量 */
|
||||||
@ApiModelProperty(value = "在用数量")
|
@ApiModelProperty(value = "在用数量")
|
||||||
private BigDecimal num;
|
private BigDecimal num;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.bonus.common.biz.domain.BmFileInfo;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -43,6 +44,12 @@ public class MaCodeDto extends BaseEntity {
|
||||||
|
|
||||||
private String maStatus;
|
private String maStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "外观判断不合格数量")
|
||||||
|
private BigDecimal badNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "外观判断合格数量")
|
||||||
|
private BigDecimal goodNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 附件列表
|
* 附件列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -72,4 +72,10 @@ public class MaCodeVo {
|
||||||
|
|
||||||
@ApiModelProperty(value = "驳回数量")
|
@ApiModelProperty(value = "驳回数量")
|
||||||
private BigDecimal rejectNum;
|
private BigDecimal rejectNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "外观判断不合格数量")
|
||||||
|
private BigDecimal badNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "外观判断合格数量")
|
||||||
|
private BigDecimal goodNum;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import java.util.stream.Collectors;
|
||||||
import cn.hutool.core.util.PhoneUtil;
|
import cn.hutool.core.util.PhoneUtil;
|
||||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
|
import com.bonus.common.biz.domain.TypeTreeNode;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||||
import com.bonus.common.biz.enums.*;
|
import com.bonus.common.biz.enums.*;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
|
|
@ -23,6 +24,9 @@ import com.bonus.material.back.domain.vo.BackApplyRequestVo;
|
||||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
import com.bonus.common.biz.domain.BmFileInfo;
|
import com.bonus.common.biz.domain.BmFileInfo;
|
||||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
|
import com.bonus.material.common.domain.dto.SelectDto;
|
||||||
|
import com.bonus.material.common.domain.vo.AgreementVo;
|
||||||
|
import com.bonus.material.common.mapper.SelectMapper;
|
||||||
import com.bonus.material.ma.mapper.MachineMapper;
|
import com.bonus.material.ma.mapper.MachineMapper;
|
||||||
import com.bonus.material.purchase.config.RemoteConfig;
|
import com.bonus.material.purchase.config.RemoteConfig;
|
||||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||||
|
|
@ -71,6 +75,9 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
@Resource
|
@Resource
|
||||||
private SltAgreementInfoMapper sltAgreementInfoMapper;
|
private SltAgreementInfoMapper sltAgreementInfoMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SelectMapper mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询退料任务
|
* 查询退料任务
|
||||||
*
|
*
|
||||||
|
|
@ -290,6 +297,16 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
return AjaxResult.error(backApplyDetails.getTypeName() + "退料数量不能大于预退数量,请重新填写!");
|
return AjaxResult.error(backApplyDetails.getTypeName() + "退料数量不能大于预退数量,请重新填写!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (backApplyDetails.getGoodNum() != null && backApplyDetails.getBadNum() != null && backApplyDetails.getPreNum() != null) {
|
||||||
|
if (backApplyDetails.getGoodNum().add(backApplyDetails.getBadNum()).compareTo( backApplyDetails.getPreNum())>0) {
|
||||||
|
return AjaxResult.error(backApplyDetails.getTypeName() + "完好数量和损坏数量之和不能大于预退数量,请重新填写!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (backApplyDetails.getGoodNum() != null && backApplyDetails.getBadNum() != null && CollectionUtils.isNotEmpty(backApplyDetails.getMaCodeList())) {
|
||||||
|
if (backApplyDetails.getGoodNum().add(backApplyDetails.getBadNum()).compareTo( BigDecimal.valueOf(backApplyDetails.getMaCodeList().size()))>0) {
|
||||||
|
return AjaxResult.error(backApplyDetails.getTypeName() + "完好数量和损坏数量之和不能大于预退数量,请重新填写!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int result = 0;
|
int result = 0;
|
||||||
try {
|
try {
|
||||||
|
|
@ -349,7 +366,28 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private int saveBackApplyDetails(BackApplyRequestVo dto, BackApplyInfo backApplyInfo, int result) {
|
private int saveBackApplyDetails(BackApplyRequestVo dto, BackApplyInfo backApplyInfo, int result) {
|
||||||
|
List<TypeTreeNode> listL4 = new ArrayList<>();
|
||||||
|
// 针对app二维码扫描时,需要根据单位id和工程id获取协议id,然后根据协议id获取退料在用数量
|
||||||
|
if (backApplyInfo.getUnitId() != null && backApplyInfo.getProId() != null) {
|
||||||
|
SelectDto selectDto = new SelectDto();
|
||||||
|
selectDto.setUnitId(backApplyInfo.getUnitId().intValue());
|
||||||
|
selectDto.setProjectId(backApplyInfo.getProId().intValue());
|
||||||
|
List<AgreementVo> list = mapper.getAgreementInfoById(selectDto);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
backApplyInfo.setAgreementId(Long.valueOf(list.get(0).getAgreementId()));
|
||||||
|
listL4 = mapper.getUseTypeTreeL4(backApplyInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
for (BackApplyDetails details : dto.getBackApplyDetailsList()) {
|
for (BackApplyDetails details : dto.getBackApplyDetailsList()) {
|
||||||
|
if (details.getNum() == null && CollectionUtils.isNotEmpty(listL4)) {
|
||||||
|
for (TypeTreeNode typeTreeNode : listL4) {
|
||||||
|
// 如果找到匹配的 typeId,则更新数量
|
||||||
|
if (typeTreeNode.getTypeId() == details.getTypeId()) {
|
||||||
|
details.setNum(typeTreeNode.getNum());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
details.setCode(backApplyInfo.getCode());
|
details.setCode(backApplyInfo.getCode());
|
||||||
details.setParentId(backApplyInfo.getId());
|
details.setParentId(backApplyInfo.getId());
|
||||||
details.setAuditNum(details.getPreNum());
|
details.setAuditNum(details.getPreNum());
|
||||||
|
|
@ -403,6 +441,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
details.setMaId(maCodeDto.getMaId());
|
details.setMaId(maCodeDto.getMaId());
|
||||||
details.setPreNum(BigDecimal.valueOf(1));
|
details.setPreNum(BigDecimal.valueOf(1));
|
||||||
details.setApDetection(maCodeDto.getApDetection());
|
details.setApDetection(maCodeDto.getApDetection());
|
||||||
|
details.setGoodNum(maCodeDto.getGoodNum());
|
||||||
|
details.setBadNum(maCodeDto.getBadNum());
|
||||||
// 插入 CheckDetails
|
// 插入 CheckDetails
|
||||||
result += backApplyInfoMapper.insertCheckDetails(details);
|
result += backApplyInfoMapper.insertCheckDetails(details);
|
||||||
//更新ma_machine表状态为11(退料暂存)
|
//更新ma_machine表状态为11(退料暂存)
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,9 @@ public class RepairApplyRecord extends BaseEntity {
|
||||||
@ApiModelProperty(value = "数据所属组织")
|
@ApiModelProperty(value = "数据所属组织")
|
||||||
private Long companyId;
|
private Long companyId;
|
||||||
|
|
||||||
|
/** 报废原因id */
|
||||||
|
private Long scrapId;
|
||||||
|
|
||||||
/** 报废原因 */
|
/** 报废原因 */
|
||||||
@Excel(name = "报废原因")
|
@Excel(name = "报废原因")
|
||||||
@ApiModelProperty(value = "报废原因")
|
@ApiModelProperty(value = "报废原因")
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,9 @@ public class RepairPartDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "报废数量")
|
@ApiModelProperty(value = "报废数量")
|
||||||
private BigDecimal scrapNum;
|
private BigDecimal scrapNum;
|
||||||
|
|
||||||
|
/** 报废原因id */
|
||||||
|
private Long scrapId;
|
||||||
|
|
||||||
/** 报废原因 */
|
/** 报废原因 */
|
||||||
@ApiModelProperty(value = "报废原因")
|
@ApiModelProperty(value = "报废原因")
|
||||||
private String scrapReason;
|
private String scrapReason;
|
||||||
|
|
|
||||||
|
|
@ -631,12 +631,32 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private void batchInsertRepairInputDetails(List<RepairAuditDetails> repairAuditDetailsByQuery, Long agreementId) {
|
private void batchInsertRepairInputDetails(List<RepairAuditDetails> repairAuditDetailsByQuery, Long agreementId) {
|
||||||
|
boolean inputFlag = false;
|
||||||
|
boolean scrapFlag = false;
|
||||||
|
for (RepairAuditDetails repairAuditDetails : repairAuditDetailsByQuery) {
|
||||||
|
if (repairAuditDetails.getRepairedNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
inputFlag = true; // 标记需要插入修饰任务
|
||||||
|
}
|
||||||
|
if (repairAuditDetails.getScrapNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
scrapFlag = true; // 标记需要插入报废任务
|
||||||
|
}
|
||||||
|
// 如果两个标志都已满足,提前跳出循环
|
||||||
|
if (inputFlag && scrapFlag) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
//插入修饰审核入库任务表
|
//插入修饰审核入库任务表
|
||||||
final Long newTaskId = insertTt();
|
Long newTaskId = null;
|
||||||
|
if (inputFlag) {
|
||||||
|
newTaskId = insertTt();
|
||||||
|
insertTta(newTaskId, agreementId);
|
||||||
|
}
|
||||||
//插入报废任务表
|
//插入报废任务表
|
||||||
Long newScrapTaskId = insertScrapTt();
|
Long newScrapTaskId = null;
|
||||||
insertTta(newTaskId, agreementId);
|
if (scrapFlag) {
|
||||||
insertScrapTta(newScrapTaskId, agreementId);
|
newScrapTaskId = insertScrapTt();
|
||||||
|
insertScrapTta(newScrapTaskId, agreementId);
|
||||||
|
}
|
||||||
final List<RepairInputDetails> inputList = new ArrayList<>();
|
final List<RepairInputDetails> inputList = new ArrayList<>();
|
||||||
for (final RepairAuditDetails details : repairAuditDetailsByQuery) {
|
for (final RepairAuditDetails details : repairAuditDetailsByQuery) {
|
||||||
//修改机具状态
|
//修改机具状态
|
||||||
|
|
|
||||||
|
|
@ -617,6 +617,7 @@ public class RepairServiceImpl implements RepairService {
|
||||||
.setRepairType(RepairTypeEnum.TO_SCRAP.getTypeId()).setStatus(0L).setIsSlt(0L).setPartNum(0)
|
.setRepairType(RepairTypeEnum.TO_SCRAP.getTypeId()).setStatus(0L).setIsSlt(0L).setPartNum(0)
|
||||||
.setFileIds(null == fileInfo.getId() ? "" : String.valueOf(fileInfo.getId()))
|
.setFileIds(null == fileInfo.getId() ? "" : String.valueOf(fileInfo.getId()))
|
||||||
.setRepairNum(BigDecimal.valueOf(0)).setScrapNum(bean.getNumberScrapRepairPartList().get(0).getScrapNum())
|
.setRepairNum(BigDecimal.valueOf(0)).setScrapNum(bean.getNumberScrapRepairPartList().get(0).getScrapNum())
|
||||||
|
.setScrapId(bean.getNumberScrapRepairPartList().get(0).getScrapId())
|
||||||
.setScrapReason(bean.getNumberScrapRepairPartList().get(0).getScrapReason())
|
.setScrapReason(bean.getNumberScrapRepairPartList().get(0).getScrapReason())
|
||||||
.setScrapType(bean.getNumberScrapRepairPartList().get(0).getScrapType())
|
.setScrapType(bean.getNumberScrapRepairPartList().get(0).getScrapType())
|
||||||
.setRepairer(loginUser.getUsername()).setCreateBy(loginUser.getUsername());
|
.setRepairer(loginUser.getUsername()).setCreateBy(loginUser.getUsername());
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
package com.bonus.material.scrap.mapper;
|
package com.bonus.material.scrap.mapper;
|
||||||
|
|
||||||
import com.bonus.material.basic.domain.BmUnitType;
|
import com.bonus.material.repair.domain.RepairPartDetails;
|
||||||
import com.bonus.material.scrap.domain.ScrapApplyDetails;
|
|
||||||
import com.bonus.material.scrap.domain.ScrapReason;
|
import com.bonus.material.scrap.domain.ScrapReason;
|
||||||
import com.bonus.material.scrap.domain.vo.ScrapTaskListVo;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -78,4 +76,13 @@ public interface ScrapReasonMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<ScrapReason> getList(ScrapReason scrapReason);
|
List<ScrapReason> getList(ScrapReason scrapReason);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修记录
|
||||||
|
* @param scrapReason
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RepairPartDetails> getRepairRecord(ScrapReason scrapReason);
|
||||||
|
|
||||||
|
int updateRepairRecord(ScrapReason scrapReason);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,13 @@ package com.bonus.material.scrap.service.impl;
|
||||||
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.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.repair.domain.RepairPartDetails;
|
||||||
import com.bonus.material.scrap.domain.ScrapReason;
|
import com.bonus.material.scrap.domain.ScrapReason;
|
||||||
import com.bonus.material.scrap.mapper.ScrapReasonMapper;
|
import com.bonus.material.scrap.mapper.ScrapReasonMapper;
|
||||||
import com.bonus.material.scrap.service.IScrapReasonService;
|
import com.bonus.material.scrap.service.IScrapReasonService;
|
||||||
import com.bonus.material.warehouse.domain.WhHouseInfo;
|
|
||||||
import com.bonus.material.warehouse.mapper.WhHouseInfoMapper;
|
|
||||||
import com.bonus.material.warehouse.service.IWhHouseInfoService;
|
|
||||||
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.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -108,6 +107,14 @@ public class ScrapReasonServiceImpl implements IScrapReasonService
|
||||||
scrapReason.setUpdateTime(DateUtils.getNowDate());
|
scrapReason.setUpdateTime(DateUtils.getNowDate());
|
||||||
scrapReason.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
|
scrapReason.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||||
try {
|
try {
|
||||||
|
// 先根据id查询报修记录,如果存在,修改报修记录的报废原因
|
||||||
|
List<RepairPartDetails> list = scrapReasonMapper.getRepairRecord(scrapReason);
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
int res = scrapReasonMapper.updateRepairRecord(scrapReason);
|
||||||
|
if (res == 0) {
|
||||||
|
throw new ServiceException("修改报废原因记录失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
return scrapReasonMapper.updateScrapReasonInfo(scrapReason);
|
return scrapReasonMapper.updateScrapReasonInfo(scrapReason);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("修改失败");
|
throw new ServiceException("修改失败");
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
ba.update_by AS updateBy,
|
ba.update_by AS updateBy,
|
||||||
ba.update_time AS updateTime,
|
ba.update_time AS updateTime,
|
||||||
ba.remark AS remark,
|
ba.remark AS remark,
|
||||||
ba.ap_detection AS apDetection
|
ba.ap_detection AS apDetection,
|
||||||
|
ba.bad_num AS badNum,
|
||||||
|
ba.good_num AS goodNum
|
||||||
FROM
|
FROM
|
||||||
back_apply_details ba
|
back_apply_details ba
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = ba.type_id and mt.del_flag = 0
|
LEFT JOIN ma_type mt ON mt.type_id = ba.type_id and mt.del_flag = 0
|
||||||
|
|
@ -201,7 +203,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
mt.type_name AS materialName,
|
mt.type_name AS materialName,
|
||||||
mt1.type_name AS typeName,
|
mt1.type_name AS typeName,
|
||||||
bcd.ap_detection AS apDetection,
|
bcd.ap_detection AS apDetection,
|
||||||
mm.ma_status AS maStatus
|
mm.ma_status AS maStatus,
|
||||||
|
bcd.bad_num AS badNum,
|
||||||
|
bcd.good_num AS goodNum
|
||||||
FROM
|
FROM
|
||||||
back_check_details bcd
|
back_check_details bcd
|
||||||
left join ma_machine mm on bcd.ma_id = mm.ma_id
|
left join ma_machine mm on bcd.ma_id = mm.ma_id
|
||||||
|
|
@ -484,6 +488,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="typeId != null">type_id,</if>
|
<if test="typeId != null">type_id,</if>
|
||||||
<if test="preNum != null">pre_num,</if>
|
<if test="preNum != null">pre_num,</if>
|
||||||
<if test="auditNum != null">audit_num,</if>
|
<if test="auditNum != null">audit_num,</if>
|
||||||
|
<if test="badNum != null">bad_num,</if>
|
||||||
|
<if test="goodNum != null">good_num,</if>
|
||||||
<if test="num != null">use_num,</if>
|
<if test="num != null">use_num,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="status != null">status,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
|
|
@ -498,6 +504,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="typeId != null">#{typeId},</if>
|
<if test="typeId != null">#{typeId},</if>
|
||||||
<if test="preNum != null">#{preNum},</if>
|
<if test="preNum != null">#{preNum},</if>
|
||||||
<if test="auditNum != null">#{auditNum},</if>
|
<if test="auditNum != null">#{auditNum},</if>
|
||||||
|
<if test="badNum != null">#{badNum},</if>
|
||||||
|
<if test="goodNum != null">#{goodNum},</if>
|
||||||
<if test="num != null">#{num},</if>
|
<if test="num != null">#{num},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
|
@ -522,6 +530,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
<if test="apDetection != null and apDetection != ''">ap_detection,</if>
|
<if test="apDetection != null and apDetection != ''">ap_detection,</if>
|
||||||
|
<if test="badNum != null">bad_num,</if>
|
||||||
|
<if test="goodNum != null">good_num,</if>
|
||||||
<if test="companyId != null">company_id,</if>
|
<if test="companyId != null">company_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
|
@ -536,6 +546,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
<if test="apDetection != null and apDetection != ''">#{apDetection},</if>
|
<if test="apDetection != null and apDetection != ''">#{apDetection},</if>
|
||||||
|
<if test="badNum != null">#{badNum},</if>
|
||||||
|
<if test="goodNum != null">#{goodNum},</if>
|
||||||
<if test="companyId != null">#{companyId},</if>
|
<if test="companyId != null">#{companyId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.material.repair.mapper.RepairMapper">
|
<mapper namespace="com.bonus.material.repair.mapper.RepairMapper">
|
||||||
<insert id="addRecord">
|
<insert id="addRecord">
|
||||||
insert into repair_apply_record (task_id,ma_id,type_id,repair_num,scrap_num,repair_type,create_by,create_time,repair_content,company_id,scrap_reason,scrap_type,supplier_id,part_num,part_price,part_type,part_name,repairer,file_ids,remark,part_id)
|
insert into repair_apply_record (task_id,ma_id,type_id,repair_num,scrap_num,repair_type,create_by,create_time,repair_content,company_id,scrap_id,scrap_reason,scrap_type,supplier_id,part_num,part_price,part_type,part_name,repairer,file_ids,remark,part_id)
|
||||||
values (#{taskId},#{maId},#{typeId},#{repairNum},#{scrapNum},#{repairType},#{createBy},now(),#{repairContent},#{companyId},#{scrapReason},#{scrapType},#{supplierId},#{partNum},#{partPrice},#{partType},#{partName},#{repairer},#{fileIds},#{remark},#{partId});
|
values (#{taskId},#{maId},#{typeId},#{repairNum},#{scrapNum},#{repairType},#{createBy},now(),#{repairContent},#{companyId}, #{scrapId},#{scrapReason},#{scrapType},#{supplierId},#{partNum},#{partPrice},#{partType},#{partName},#{repairer},#{fileIds},#{remark},#{partId});
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="addPart">
|
<insert id="addPart">
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="addTask" useGeneratedKeys="true" keyProperty="taskId">
|
<insert id="addTask" useGeneratedKeys="true" keyProperty="taskId">
|
||||||
insert into tm_task (pre_task_id,task_status,task_type,code,create_by,create_time,company_id)
|
insert into tm_task (pre_task_id,task_status,task_type,code,create_by,create_time,company_id,month_order)
|
||||||
values (#{preTaskId},#{taskStatus},#{taskType},#{repairCode},#{createBy},now(),#{companyId});
|
values (#{preTaskId},#{taskStatus},#{taskType},#{repairCode},#{createBy},now(),#{companyId},#{monthOrder});
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="createAgreementTask">
|
<insert id="createAgreementTask">
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
GROUP BY sc.id
|
GROUP BY sc.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getRepairRecord" resultType="com.bonus.material.repair.domain.RepairPartDetails">
|
||||||
|
SELECT
|
||||||
|
task_id as taskId,
|
||||||
|
ma_id as maId,
|
||||||
|
scrap_id as scrapId,
|
||||||
|
scrap_reason as scrapReason
|
||||||
|
FROM
|
||||||
|
repair_apply_details
|
||||||
|
WHERE
|
||||||
|
scrap_id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateScrapReasonInfo">
|
<update id="updateScrapReasonInfo">
|
||||||
update scrap_reason
|
update scrap_reason
|
||||||
set type_id = #{typeId},
|
set type_id = #{typeId},
|
||||||
|
|
@ -143,8 +155,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where id = #{id} and del_flag = 0
|
where id = #{id} and del_flag = 0
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateRepairRecord">
|
||||||
|
update
|
||||||
|
repair_apply_details
|
||||||
|
set
|
||||||
|
scrap_reason = #{scrapReason}
|
||||||
|
where scrap_id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<!-- <delete id="deleteScrapApplyDetailsById" parameterType="Long">-->
|
|
||||||
|
<!-- <delete id="deleteScrapApplyDetailsById" parameterType="Long">-->
|
||||||
<!-- delete from scrap_apply_details where id = #{id}-->
|
<!-- delete from scrap_apply_details where id = #{id}-->
|
||||||
<!-- </delete>-->
|
<!-- </delete>-->
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue