hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/mouldcheck/service/impl/ModCheckServiceImpl.java
@@ -17,6 +17,7 @@ import com.thhy.mobile.modules.biz.pipeinfo.entity.MaterialInfo; import com.thhy.mobile.modules.biz.pipeinfo.entity.PipeInfo; import com.thhy.mobile.modules.biz.pipeinfo.mapper.PipeInfoMapper; import com.thhy.mobile.modules.biz.steelcheck.entity.SteelStockRecord; import com.thhy.mobile.modules.biz.steelproduce.entity.ProduceDto; import com.thhy.mobile.modules.biz.steelproduce.entity.SteelProduce; import com.thhy.mobile.modules.biz.steelproduce.mapper.SteelProduceMapper; @@ -141,6 +142,10 @@ if(compareResult){//匹配成功 //更改钢筋笼产品入模状态 steelProduceMapper.updateisModel(new ProduceDto(1,modCheckDto.getProduceNumber())); //钢筋笼库存记录 SteelStockRecord steelStockRecord = new SteelStockRecord(steelProduce,true); steelStockRecord.setModCheckId(mouldCheck.getModCheckId()); steelStockMapper.insertSteelStockRecord(steelStockRecord); //减掉钢筋笼库存 steelStockMapper.updateMinusStock(new SteelStock(steelProduce)); //更新模具循环次数 hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/steelcheck/entity/SteelStockRecord.java
对比新文件 @@ -0,0 +1,82 @@ package com.thhy.mobile.modules.biz.steelcheck.entity; import com.thhy.general.annotations.Idkey; import com.thhy.mobile.modules.biz.steelproduce.entity.SteelProduce; import lombok.Data; import java.io.Serializable; import java.util.Date; @Data public class SteelStockRecord implements Serializable { @Idkey private String recordId; private String steelRecordId; private String modCheckId; /** * 块ID */ private String blockId; private Date createTime; /** * 项目ID */ private String proId; /** * 配筋ID */ private String reinforcementId; /** * 尺寸 */ private String sizeId; /** * 库存 */ private double stock; private int type; public SteelStockRecord() { } public SteelStockRecord(SteelProduce steelProduce) { this.proId = steelProduce.getProId(); this.sizeId = steelProduce.getSizeId(); this.reinforcementId = steelProduce.getReinforcementId(); this.blockId = steelProduce.getBlockNum(); this.type = 1; this.stock = 1; } public SteelStockRecord(SteelProduce steelProduce,boolean plus) { this.proId = steelProduce.getProId(); this.sizeId = steelProduce.getSizeId(); this.reinforcementId = steelProduce.getReinforcementId(); this.blockId = steelProduce.getBlockNum(); this.type = 2; this.stock = 1; } } hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/steelcheck/service/impl/SteelCheckServiceImpl.java
@@ -7,10 +7,7 @@ import com.thhy.general.exception.BasicException; import com.thhy.general.utils.DeepCopyUtils; import com.thhy.general.utils.UserInfoUtils; import com.thhy.mobile.modules.biz.steelcheck.entity.CheckFile; import com.thhy.mobile.modules.biz.steelcheck.entity.SteelCheckDto; import com.thhy.mobile.modules.biz.steelcheck.entity.SteelCheckListVo; import com.thhy.mobile.modules.biz.steelcheck.entity.UpdateCheckResultDto; import com.thhy.mobile.modules.biz.steelcheck.entity.*; import com.thhy.mobile.modules.biz.steelcheck.service.SteelCheckService; import com.thhy.mobile.modules.biz.steelcheckrecord.entity.SteelCheckRecord; import com.thhy.mobile.modules.biz.steelcheckrecord.mapper.SteelCheckRecordMapper; @@ -72,7 +69,10 @@ steelCheckRecord.setSteelProduceNum(produceNum); steelCheckRecord.setCreateUser(userInfo.getUserId()); recordMapper.insert(steelCheckRecord); //增加钢筋笼库存 //增加钢筋笼库存记录 SteelStockRecord steelStockRecord = new SteelStockRecord(steelProduce); steelStockRecord.setSteelRecordId(steelCheckRecord.getCheckId()); steelStockMapper.insertSteelStockRecord(steelStockRecord); int stockRecord = steelStockMapper.countStockByPSRB(new SteelStock(steelProduce)); if(stockRecord>0){ //增加钢筋笼库存 @@ -137,7 +137,10 @@ } //更新住状态 steelProduceMapper.updateQualified(new SteelProduce(updateCheckResultDto.getSteelProduceNum(), steelCheckRecord.getCheckResult(),userInfo.getUserId())); //合格状态————————>不合格 if (steelCheckRecord.getCheckResult()!=3) { //减【钢筋笼】库存就记录删除标志 steelStockMapper.updateSteelStockRecordByCheckId(2,steelCheckRecord.getCheckId()); //减【钢筋笼】库存 steelStockMapper.updateMinusStock(new SteelStock(steelProduce)); //加【钢筋】库存记录 @@ -150,6 +153,8 @@ } //合格状态————————>报废 if(qualified==1&&updateCheckResultDto.getCheckResult()==3){ //减【钢筋笼】库存就记录删除标志 steelStockMapper.updateSteelStockRecordByCheckId(2,steelCheckRecord.getCheckId()); //减【钢筋笼】库存 steelStockMapper.updateMinusStock(new SteelStock(steelProduce)); } @@ -192,6 +197,9 @@ //更新住状态 steelProduceMapper.updateQualified(new SteelProduce(updateCheckResultDto.getSteelProduceNum(), 1,userInfo.getUserId())); //钢筋笼】库存就记录删除标志改为未删除 steelStockMapper.updateSteelStockRecordByCheckId(1,steelCheckRecord.getCheckId()); //加【钢筋笼】库存 steelStockMapper.updatePlusStock(new SteelStock(steelProduce)); //钢筋消耗的理论耗量 List<SteelConsume> steelConsumeList = steelStockMapper.queryByPSRB(new SteelStock(steelProduce)); hd/pipe/mobile/src/main/java/com/thhy/mobile/modules/biz/steelstock/mapper/SteelStockMapper.java
@@ -1,8 +1,10 @@ package com.thhy.mobile.modules.biz.steelstock.mapper; import com.thhy.mobile.modules.biz.steelcheck.entity.SteelStockRecord; import com.thhy.mobile.modules.biz.steelstock.entity.SteelConsume; import com.thhy.mobile.modules.biz.steelstock.entity.SteelStock; import com.thhy.mobile.modules.biz.steelstock.entity.SteelStockListVo; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; import java.io.Serializable; @@ -46,4 +48,8 @@ void updateMinusSteelStock(SteelConsume steelConsume); void updatePlusSteelStock(SteelConsume steelConsume); void insertSteelStockRecord(SteelStockRecord steelStockRecord); void updateSteelStockRecordByCheckId(@Param("isUse") int isUse,@Param("checkRecordId") String stockRecordId); } hd/pipe/mobile/src/main/resources/mapping/SteelStockMapper.xml
@@ -239,4 +239,76 @@ update sys_steel set stock = (stock+#{needNum}) where steel_id = #{steelId} </update> <insert id="insertSteelStockRecord"> insert into t_steel_stock_record <trim prefix="(" suffix=")" suffixOverrides=","> <if test="recordId !=null and recordId !=''"> record_id, </if> <if test="checkRecordId !=null and checkRecordId !=''"> check_record_id, </if> <if test="modCheckId !=null and modCheckId !=''"> mod_check_id, </if> <if test="proId !=null and proId !=''"> pro_id, </if> <if test="sizeId !=null and sizeId !=''"> size_id, </if> <if test="reinforcementId !=null and reinforcementId !=''"> reinforcement_id, </if> <if test="blockId !=null and blockId !=''"> block_id, </if> <if test="stock !=null and stock !=''"> stock, </if> <if test="createTime !=null and createTime !=''"> create_time, </if> <if test="type !=null"> type, </if> </trim> <trim prefix=" values (" suffix=")" suffixOverrides=","> <if test="recordId !=null and recordId !=''"> #{recordId}, </if> <if test="checkRecordId !=null and checkRecordId !=''"> #{checkRecordId}, </if> <if test="modCheckId !=null and modCheckId !=''"> #{modCheckId}, </if> <if test="proId !=null and proId !=''"> #{proId}, </if> <if test="sizeId !=null and sizeId !=''"> #{sizeId}, </if> <if test="reinforcementId !=null and reinforcementId !=''"> #{reinforcementId}, </if> <if test="blockId !=null and blockId !=''"> #{blockId}, </if> <if test="stock !=null and stock !=''"> #{stock}, </if> <if test="createTime !=null and createTime !=''"> #{createTime}, </if> <if test="type !=null"> #{type}, </if> </trim> </insert> <update id="updateSteelStockRecordByCheckId"> update t_steel_stock_record set is_use = #{isUse} where check_record_id = #{checkRecordId} </update> </mapper>