材料站
This commit is contained in:
parent
870da9e03f
commit
57ae6a898b
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.material.back.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
|
|
@ -84,7 +85,7 @@ public class BackApplyInfo implements Serializable {
|
|||
/**
|
||||
* 退料数量
|
||||
*/
|
||||
private Integer backNum;
|
||||
private BigDecimal backNum;
|
||||
|
||||
/** 联系方式 */
|
||||
@Excel(name = "退料人电话")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.back.mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -204,14 +205,14 @@ public interface BackApplyInfoMapper {
|
|||
* @param record
|
||||
* @param backNum
|
||||
*/
|
||||
void updateStlInfoTwo(@Param("info") SltAgreementInfo info,@Param("record") BackApplyInfo record, @Param("backNum") Integer backNum);
|
||||
void updateStlInfoTwo(@Param("info") SltAgreementInfo info,@Param("record") BackApplyInfo record, @Param("backNum") BigDecimal backNum);
|
||||
|
||||
/**
|
||||
* 新增结算信息
|
||||
* @param info
|
||||
* @param many
|
||||
*/
|
||||
void insStlInfoTwo(@Param("info")SltAgreementInfo info, @Param("many")Integer many);
|
||||
void insStlInfoTwo(@Param("info")SltAgreementInfo info, @Param("many")BigDecimal many);
|
||||
|
||||
/**
|
||||
* 更新详情
|
||||
|
|
|
|||
|
|
@ -1537,17 +1537,17 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
for (BackApplyInfo bean : allList) {
|
||||
List<SltAgreementInfo> infoList = backApplyInfoMapper.getStlInfo(bean);
|
||||
if (infoList.size() > 0) {
|
||||
Integer backNum = bean.getBackNum();
|
||||
BigDecimal backNum = bean.getBackNum();
|
||||
for (SltAgreementInfo info : infoList) {
|
||||
Integer num = info.getBackNum();
|
||||
if (backNum.equals(num)) {
|
||||
BigDecimal num = info.getBackNum();
|
||||
if (backNum.compareTo(num) == 0) {
|
||||
backApplyInfoMapper.updateStlInfo(info, record);
|
||||
break;
|
||||
} else if (backNum > num) {
|
||||
backNum = backNum - num;
|
||||
} else if (backNum.compareTo(num) > 0) {
|
||||
backNum = backNum.subtract(num);
|
||||
backApplyInfoMapper.updateStlInfo(info, record);
|
||||
} else {
|
||||
Integer many = num - backNum;
|
||||
BigDecimal many = num.subtract(backNum);
|
||||
backApplyInfoMapper.updateStlInfoTwo(info, record, backNum);
|
||||
backApplyInfoMapper.insStlInfoTwo(info, many);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import lombok.experimental.Accessors;
|
|||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -91,7 +92,7 @@ public class MaterialBackApplyInfo implements Serializable {
|
|||
/**
|
||||
* 退料数量
|
||||
*/
|
||||
private Integer backNum;
|
||||
private BigDecimal backNum;
|
||||
|
||||
@Excel(name = "班组长电话")
|
||||
@ApiModelProperty(value = "联系方式")
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.bonus.material.clz.domain.vo.back.MaterialBackMaCodeVo;
|
|||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -137,14 +138,14 @@ public interface MaterialBackInfoMapper {
|
|||
* @param record
|
||||
* @param backNum
|
||||
*/
|
||||
void updateStlInfoTwo(@Param("info") SltAgreementInfo info,@Param("record") MaterialBackApplyInfo record, @Param("backNum") Integer backNum);
|
||||
void updateStlInfoTwo(@Param("info") SltAgreementInfo info,@Param("record") MaterialBackApplyInfo record, @Param("backNum") BigDecimal backNum);
|
||||
|
||||
/**
|
||||
* 新增退料任务详情
|
||||
* @param info
|
||||
* @param many
|
||||
*/
|
||||
void insStlInfoTwo(@Param("info")SltAgreementInfo info, @Param("many")Integer many);
|
||||
void insStlInfoTwo(@Param("info")SltAgreementInfo info, @Param("many")BigDecimal many);
|
||||
|
||||
/**
|
||||
* 删除退料任务详情
|
||||
|
|
|
|||
|
|
@ -828,17 +828,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
* @return
|
||||
*/
|
||||
private int saveBackApplyDetails(String createBy, MaterialBackApplyRequestVo dto, MaterialBackApplyInfo backApplyInfo, int result) {
|
||||
List<TypeTreeNode> listL4 = new ArrayList<>();
|
||||
for (MaterialBackApplyDetails 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.setParentId(backApplyInfo.getId());
|
||||
details.setAuditNum(details.getPreNum());
|
||||
|
|
@ -874,7 +864,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
} else {
|
||||
for (MaterialBackApplyInfo applyInfo : allList) {
|
||||
if (applyInfo.getTypeId().equals(details.getTypeId().toString())
|
||||
&& applyInfo.getBackNum().toString().equals(details.getPreNum().toString())) {
|
||||
&& applyInfo.getBackNum().compareTo(details.getPreNum()) == 0) {
|
||||
newList.add(applyInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -900,17 +890,17 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
for (MaterialBackApplyInfo bean : allList) {
|
||||
List<SltAgreementInfo> infoList = materialBackInfoMapper.getStlInfo(bean);
|
||||
if (infoList.size() > 0) {
|
||||
Integer backNum = bean.getBackNum();
|
||||
BigDecimal backNum = bean.getBackNum();
|
||||
for (SltAgreementInfo info : infoList) {
|
||||
Integer num = info.getBackNum();
|
||||
if (backNum.equals(num)) {
|
||||
BigDecimal num = info.getBackNum();
|
||||
if (backNum.compareTo(num) == 0) {
|
||||
materialBackInfoMapper.updateStlInfo(info, record);
|
||||
break;
|
||||
} else if (backNum > num) {
|
||||
backNum = backNum - num;
|
||||
} else if (backNum.compareTo(num) > 0) {
|
||||
backNum = backNum.subtract(num);
|
||||
materialBackInfoMapper.updateStlInfo(info, record);
|
||||
} else {
|
||||
Integer many = num - backNum;
|
||||
BigDecimal many = num.subtract(backNum);
|
||||
materialBackInfoMapper.updateStlInfoTwo(info, record, backNum);
|
||||
materialBackInfoMapper.insStlInfoTwo(info, many);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import com.bonus.common.core.web.domain.BaseEntity;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author :梁超
|
||||
*/
|
||||
|
|
@ -29,7 +31,7 @@ public class DirectApplyDetails extends BaseEntity {
|
|||
/**
|
||||
* 直转数量
|
||||
*/
|
||||
private Integer directNum;
|
||||
private BigDecimal directNum;
|
||||
|
||||
private String typeName;
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class SltAgreementInfo extends BaseEntity {
|
|||
|
||||
private Long userId;
|
||||
|
||||
private Integer backNum;
|
||||
private BigDecimal backNum;
|
||||
|
||||
/** 领料时间 */
|
||||
@ApiModelProperty(value = "领料时间")
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
|
|||
record.setTypeId(Long.valueOf(directApplyDetails.getTypeId()));
|
||||
record.setMaId(directApplyDetails.getMaId() == null ?
|
||||
null : Long.valueOf(directApplyDetails.getMaId()));
|
||||
record.setOutNum(BigDecimal.valueOf(directApplyDetails.getDirectNum()));
|
||||
record.setOutNum(directApplyDetails.getDirectNum());
|
||||
record.setOutType("1".equals(directApplyDetails.getManageType()) ?
|
||||
1 : 0);
|
||||
record.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
|
|
@ -555,8 +555,8 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
|
|||
details.setCreateTime(DateUtils.getNowDate());
|
||||
details.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
details.setTypeId(Long.valueOf(directApplyDetails.getTypeId()));
|
||||
details.setPreNum(BigDecimal.valueOf(directApplyDetails.getDirectNum()));
|
||||
details.setAlNum(BigDecimal.valueOf(directApplyDetails.getDirectNum()));
|
||||
details.setPreNum(directApplyDetails.getDirectNum());
|
||||
details.setAlNum(directApplyDetails.getDirectNum());
|
||||
details.setStatus("2");
|
||||
leaseApplyDetails.add(details);
|
||||
}
|
||||
|
|
@ -595,7 +595,7 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
|
|||
details.setTypeId(Long.valueOf(directApplyDetails.getTypeId()));
|
||||
details.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
details.setCreateTime(DateUtils.getNowDate());
|
||||
details.setPreNum(BigDecimal.valueOf(directApplyDetails.getDirectNum()));
|
||||
details.setPreNum(directApplyDetails.getDirectNum());
|
||||
details.setMaId(directApplyDetails.getMaId() == null ?
|
||||
null : Long.valueOf(directApplyDetails.getMaId()));
|
||||
details.setBackStatus("0");
|
||||
|
|
@ -610,18 +610,18 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
|
|||
bean.setMaId(directApplyDetails.getMaId() == null ?
|
||||
null : Long.valueOf(directApplyDetails.getMaId()));
|
||||
List<SltAgreementInfo> infoList = backApplyInfoMapper.getStlInfo(bean);
|
||||
Integer backNum = directApplyDetails.getDirectNum();
|
||||
BigDecimal backNum = directApplyDetails.getDirectNum();
|
||||
if (CollectionUtils.isNotEmpty(infoList)) {
|
||||
for (SltAgreementInfo agreementInfo : infoList) {
|
||||
Integer num = agreementInfo.getBackNum();
|
||||
if (backNum.equals(num)) {
|
||||
BigDecimal num = agreementInfo.getBackNum();
|
||||
if (backNum.compareTo(num) == 0) {
|
||||
backApplyInfoMapper.updateStlInfo(agreementInfo, backApplyInfo);
|
||||
break;
|
||||
} else if (backNum > num) {
|
||||
backNum = backNum - num;
|
||||
} else if (backNum.compareTo(num) > 0) {
|
||||
backNum = backNum.subtract(num);
|
||||
backApplyInfoMapper.updateStlInfo(agreementInfo, backApplyInfo);
|
||||
} else {
|
||||
Integer many = num - backNum;
|
||||
BigDecimal many = num.subtract(backNum);
|
||||
backApplyInfoMapper.updateStlInfoTwo(agreementInfo, backApplyInfo, backNum);
|
||||
backApplyInfoMapper.insStlInfoTwo(agreementInfo, many);
|
||||
break;
|
||||
|
|
@ -645,8 +645,8 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
|
|||
BackApplyDetails details = new BackApplyDetails();
|
||||
details.setCode(backApplyInfo.getCode());
|
||||
details.setParentId(backApplyInfo.getId());
|
||||
details.setPreNum(BigDecimal.valueOf(directApplyDetails.getDirectNum()));
|
||||
details.setAuditNum(BigDecimal.valueOf(directApplyDetails.getDirectNum()));
|
||||
details.setPreNum(directApplyDetails.getDirectNum());
|
||||
details.setAuditNum(directApplyDetails.getDirectNum());
|
||||
details.setNum(directApplyDetails.getUseNum() == null ?
|
||||
BigDecimal.ZERO : BigDecimal.valueOf(directApplyDetails.getUseNum()));
|
||||
details.setStatus(String.valueOf(BackTaskStatusEnum.BACK_TASK_IN_FINISHED.getStatus()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue