代码中金额、数量类型修改
This commit is contained in:
parent
d6888f6a97
commit
5639054cfd
|
|
@ -43,15 +43,15 @@ public class RepairAuditDetails extends BaseEntity
|
||||||
|
|
||||||
/** 维修总量 */
|
/** 维修总量 */
|
||||||
@Excel(name = "维修总量")
|
@Excel(name = "维修总量")
|
||||||
private BigDecimal repairNum;
|
private Integer repairNum;
|
||||||
|
|
||||||
/** 维修数量 */
|
/** 维修数量 */
|
||||||
@Excel(name = "维修数量")
|
@Excel(name = "维修数量")
|
||||||
private BigDecimal repairedNum;
|
private Integer repairedNum;
|
||||||
|
|
||||||
/** 报废数量 */
|
/** 报废数量 */
|
||||||
@Excel(name = "报废数量")
|
@Excel(name = "报废数量")
|
||||||
private BigDecimal scrapNum;
|
private Integer scrapNum;
|
||||||
|
|
||||||
/** 审核人 */
|
/** 审核人 */
|
||||||
@Excel(name = "审核人")
|
@Excel(name = "审核人")
|
||||||
|
|
@ -144,30 +144,30 @@ public class RepairAuditDetails extends BaseEntity
|
||||||
{
|
{
|
||||||
return typeId;
|
return typeId;
|
||||||
}
|
}
|
||||||
public void setRepairNum(BigDecimal repairNum)
|
public void setRepairNum(Integer repairNum)
|
||||||
{
|
{
|
||||||
this.repairNum = repairNum;
|
this.repairNum = repairNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getRepairNum()
|
public Integer getRepairNum()
|
||||||
{
|
{
|
||||||
return repairNum;
|
return repairNum;
|
||||||
}
|
}
|
||||||
public void setRepairedNum(BigDecimal repairedNum)
|
public void setRepairedNum(Integer repairedNum)
|
||||||
{
|
{
|
||||||
this.repairedNum = repairedNum;
|
this.repairedNum = repairedNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getRepairedNum()
|
public Integer getRepairedNum()
|
||||||
{
|
{
|
||||||
return repairedNum;
|
return repairedNum;
|
||||||
}
|
}
|
||||||
public void setScrapNum(BigDecimal scrapNum)
|
public void setScrapNum(Integer scrapNum)
|
||||||
{
|
{
|
||||||
this.scrapNum = scrapNum;
|
this.scrapNum = scrapNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getScrapNum()
|
public Integer getScrapNum()
|
||||||
{
|
{
|
||||||
return scrapNum;
|
return scrapNum;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ public class RepairTestWarehousingDto {
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/** 数量*/
|
/** 数量*/
|
||||||
private String repairNum;
|
private Integer repairNum;
|
||||||
|
|
||||||
/**更新时间*/
|
/**更新时间*/
|
||||||
private String updateTime;
|
private String updateTime;
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class ScrapApplyDetails extends BaseEntity
|
||||||
|
|
||||||
/** 报废数量 */
|
/** 报废数量 */
|
||||||
@ApiModelProperty(value = "报废数量")
|
@ApiModelProperty(value = "报废数量")
|
||||||
private BigDecimal scrapNum;
|
private Integer scrapNum;
|
||||||
|
|
||||||
/** (1退料2,维修审核,3盘点) */
|
/** (1退料2,维修审核,3盘点) */
|
||||||
@ApiModelProperty(value = "(1退料2,维修审核,3盘点)")
|
@ApiModelProperty(value = "(1退料2,维修审核,3盘点)")
|
||||||
|
|
@ -162,12 +162,12 @@ public class ScrapApplyDetails extends BaseEntity
|
||||||
{
|
{
|
||||||
return typeId;
|
return typeId;
|
||||||
}
|
}
|
||||||
public void setScrapNum(BigDecimal scrapNum)
|
public void setScrapNum(Integer scrapNum)
|
||||||
{
|
{
|
||||||
this.scrapNum = scrapNum;
|
this.scrapNum = scrapNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getScrapNum()
|
public Integer getScrapNum()
|
||||||
{
|
{
|
||||||
return scrapNum;
|
return scrapNum;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ public interface RepairTestInputMapper {
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2023/12/16 20:45
|
* @date 2023/12/16 20:45
|
||||||
*/
|
*/
|
||||||
void updateMaTypeNum(@Param("typeId") String typeId, @Param("num") double num);
|
void updateMaTypeNum(@Param("typeId") String typeId, @Param("num") Integer num);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询机具状态-在库的id
|
* 查询机具状态-在库的id
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
String checkResult = scrapAudit.getCheckResult();
|
String checkResult = scrapAudit.getCheckResult();
|
||||||
List<RepairAuditDetails> auditDetailList = scrapAudit.getAuditDetailList();
|
List<RepairAuditDetails> auditDetailList = scrapAudit.getAuditDetailList();
|
||||||
List<Long> taskIdList = scrapAudit.getTaskIdList();
|
List<Long> taskIdList = scrapAudit.getTaskIdList();
|
||||||
BigDecimal b = new BigDecimal(0);
|
Integer b = 0;
|
||||||
for (Long taskId : taskIdList) {
|
for (Long taskId : taskIdList) {
|
||||||
String status = "0";
|
String status = "0";
|
||||||
TmTask task1 = taskMapper.selectTmTaskByTaskId(taskId);
|
TmTask task1 = taskMapper.selectTmTaskByTaskId(taskId);
|
||||||
|
|
@ -264,14 +264,14 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
Long typeId = scrapDetails.getTypeId();
|
Long typeId = scrapDetails.getTypeId();
|
||||||
Long maId = scrapDetails.getMaId();
|
Long maId = scrapDetails.getMaId();
|
||||||
// 创建报废任务
|
// 创建报废任务
|
||||||
BigDecimal scrapNum = scrapDetails.getScrapNum();
|
Integer scrapNum = scrapDetails.getScrapNum();
|
||||||
if (scrapNum.compareTo(b) > 0) {
|
if (scrapNum.compareTo(b) > 0) {
|
||||||
for (RepairRecord bean : repairRecord){
|
for (RepairRecord bean : repairRecord){
|
||||||
ScrapApplyDetails scrapApplyDetails = new ScrapApplyDetails();
|
ScrapApplyDetails scrapApplyDetails = new ScrapApplyDetails();
|
||||||
scrapApplyDetails.setTaskId(scrapTaskId);
|
scrapApplyDetails.setTaskId(scrapTaskId);
|
||||||
scrapApplyDetails.setTypeId(typeId);
|
scrapApplyDetails.setTypeId(typeId);
|
||||||
scrapApplyDetails.setMaId(maId);
|
scrapApplyDetails.setMaId(maId);
|
||||||
scrapApplyDetails.setScrapNum(BigDecimal.valueOf(bean.getScrapNum()));
|
scrapApplyDetails.setScrapNum(bean.getScrapNum());
|
||||||
scrapApplyDetails.setScrapType(bean.getScrapType());
|
scrapApplyDetails.setScrapType(bean.getScrapType());
|
||||||
scrapApplyDetails.setScrapSource("2");
|
scrapApplyDetails.setScrapSource("2");
|
||||||
scrapApplyDetails.setStatus("0");
|
scrapApplyDetails.setStatus("0");
|
||||||
|
|
|
||||||
|
|
@ -92,16 +92,16 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
|
||||||
if (StringHelper.isNotEmpty(dto.getMaId())) {
|
if (StringHelper.isNotEmpty(dto.getMaId())) {
|
||||||
detail.setMaId(Long.valueOf(dto.getMaId()));
|
detail.setMaId(Long.valueOf(dto.getMaId()));
|
||||||
}
|
}
|
||||||
detail.setRepairNum(new BigDecimal(dto.getRepairNum()));
|
detail.setRepairNum(dto.getRepairNum());
|
||||||
detail.setRepairedNum(new BigDecimal(dto.getRepairNum()));
|
detail.setRepairedNum(dto.getRepairNum());
|
||||||
detail.setScrapNum(new BigDecimal("0"));
|
detail.setScrapNum(0);
|
||||||
detail.setStatus("0");
|
detail.setStatus("0");
|
||||||
detail.setCreateBy(String.valueOf(userId));
|
detail.setCreateBy(String.valueOf(userId));
|
||||||
detail.setUpdateBy(String.valueOf(userId));
|
detail.setUpdateBy(String.valueOf(userId));
|
||||||
detail.setCompanyId(Math.toIntExact(dto.getCompanyId()));
|
detail.setCompanyId(Math.toIntExact(dto.getCompanyId()));
|
||||||
auditDetails.add(detail);
|
auditDetails.add(detail);
|
||||||
// 审核不通过-入库数量修改为 0
|
// 审核不通过-入库数量修改为 0
|
||||||
dto.setRepairNum("0");
|
dto.setRepairNum(0);
|
||||||
}
|
}
|
||||||
// 更新修试后入库数据
|
// 更新修试后入库数据
|
||||||
mapper.updateRepairInputDetails(dto);
|
mapper.updateRepairInputDetails(dto);
|
||||||
|
|
@ -111,8 +111,8 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
|
||||||
// 查询机具类型-现有库存
|
// 查询机具类型-现有库存
|
||||||
Map<String, Object> map = mapper.getMaTypeByNum(dto.getTypeId());
|
Map<String, Object> map = mapper.getMaTypeByNum(dto.getTypeId());
|
||||||
// 更新机具类型-库存
|
// 更新机具类型-库存
|
||||||
String repairNum = StringUtils.isNotEmpty(dto.getRepairNum()) ? dto.getRepairNum() : "0";
|
Integer repairNum = dto.getRepairNum() != null ? dto.getRepairNum() : 0;
|
||||||
double num = countNum(map.get("num"), repairNum);
|
Integer num = countNum(map.get("num"), repairNum);
|
||||||
mapper.updateMaTypeNum(dto.getTypeId(), num);
|
mapper.updateMaTypeNum(dto.getTypeId(), num);
|
||||||
int codeMachinePreStoreNum = 0;
|
int codeMachinePreStoreNum = 0;
|
||||||
if (Objects.equals("0", dto.getType())) {
|
if (Objects.equals("0", dto.getType())) {
|
||||||
|
|
@ -244,14 +244,13 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2023/12/16 20:43
|
* @date 2023/12/16 20:43
|
||||||
*/
|
*/
|
||||||
public double countNum(Object num, String repairNum) {
|
public Integer countNum(Object num, Integer repairNum) {
|
||||||
BigDecimal value = new BigDecimal(new Double(0).toString());
|
Integer value = 0;
|
||||||
BigDecimal repairNumValue = new BigDecimal(new Double(repairNum).toString());
|
value = value + repairNum;
|
||||||
value = value.add(repairNumValue);
|
|
||||||
if (Objects.nonNull(num)) {
|
if (Objects.nonNull(num)) {
|
||||||
BigDecimal numValue = new BigDecimal(new Double(String.valueOf(num)).toString());
|
int numValue = Integer.parseInt(num.toString());
|
||||||
value = value.add(numValue);
|
value = value + numValue;
|
||||||
}
|
}
|
||||||
return value.doubleValue();
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -542,7 +542,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
RepairAuditDetails details = scrapApplyDetailsMapper.getRepairAudit(bean.getParentId());
|
RepairAuditDetails details = scrapApplyDetailsMapper.getRepairAudit(bean.getParentId());
|
||||||
details.setTaskId(repairTaskId);
|
details.setTaskId(repairTaskId);
|
||||||
details.setStatus("0");
|
details.setStatus("0");
|
||||||
details.setRepairedNum(BigDecimal.valueOf(0));
|
details.setRepairedNum(0);
|
||||||
details.setScrapNum(bean.getScrapNum());
|
details.setScrapNum(bean.getScrapNum());
|
||||||
details.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
details.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||||
details.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
details.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||||
|
|
|
||||||
|
|
@ -152,9 +152,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
<!--查询机具类型-库存数量-->
|
<!--查询机具类型-库存数量-->
|
||||||
<select id="getMaTypeByNum" resultType="java.util.Map">
|
<select id="getMaTypeByNum" resultType="java.util.Map">
|
||||||
SELECT type_name AS typeName,
|
SELECT
|
||||||
num
|
mt3.type_name AS typeName,
|
||||||
FROM ma_type WHERE type_id = #{typeId}
|
CASE
|
||||||
|
mt3.manage_type
|
||||||
|
WHEN 0 THEN
|
||||||
|
IFNULL( subquery0.num, 0 ) ELSE IFNULL( mt3.num, 0 )
|
||||||
|
END AS num
|
||||||
|
FROM
|
||||||
|
ma_type mt3
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
mt.type_id,
|
||||||
|
mt2.type_name AS typeName,
|
||||||
|
mt.type_name AS typeModelName,
|
||||||
|
mm.ma_code,
|
||||||
|
count( mm.ma_id ) num
|
||||||
|
FROM
|
||||||
|
ma_machine mm
|
||||||
|
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
||||||
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||||
|
WHERE
|
||||||
|
mm.ma_code IS NOT NULL
|
||||||
|
AND mm.ma_status IN ( 15 )
|
||||||
|
GROUP BY
|
||||||
|
mt.type_id
|
||||||
|
) AS subquery0 ON subquery0.type_id = mt3.type_id
|
||||||
|
WHERE
|
||||||
|
mt3.type_id = #{typeId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--查询机具状态-在库的id-->
|
<!--查询机具状态-在库的id-->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue