成套抱杆机具验收

This commit is contained in:
liang.chao 2024-04-23 17:36:00 +08:00
parent 74d7fc2e87
commit 5490fd2e8f
5 changed files with 24 additions and 0 deletions

View File

@ -12,4 +12,5 @@ public class MachinePart {
private String unitName; private String unitName;
private String typeName; private String typeName;
private Integer partNum; private Integer partNum;
private Integer typeId;
} }

View File

@ -7,6 +7,7 @@ import com.bonus.sgzb.base.api.domain.MaMachineLabel;
import com.bonus.sgzb.base.api.domain.MaType; import com.bonus.sgzb.base.api.domain.MaType;
import com.bonus.sgzb.material.domain.InputApplyDetails; import com.bonus.sgzb.material.domain.InputApplyDetails;
import com.bonus.sgzb.material.domain.MaInputRecord; import com.bonus.sgzb.material.domain.MaInputRecord;
import com.bonus.sgzb.material.domain.MachinePart;
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo; import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -277,4 +278,6 @@ public interface PurchaseMacodeInfoMapper {
* @return * @return
*/ */
int selectPurchaseCheckDetailsStatus(Long taskId); int selectPurchaseCheckDetailsStatus(Long taskId);
int updateMaTypeNum(MachinePart wholeSetDetail);
} }

View File

@ -13,6 +13,7 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.*; import com.bonus.sgzb.material.domain.*;
import com.bonus.sgzb.material.mapper.*; import com.bonus.sgzb.material.mapper.*;
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService; import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService;
import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.material.vo.EquipmentNumberVO; import com.bonus.sgzb.material.vo.EquipmentNumberVO;
@ -39,6 +40,9 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
@Resource @Resource
private TaskMapper taskMapper; private TaskMapper taskMapper;
@Autowired
private IPurchaseCheckInfoService purchaseCheckInfoService;
@Resource @Resource
private BmQrcodeInfoMapper qrcodeInfoMapper; private BmQrcodeInfoMapper qrcodeInfoMapper;
@ -298,6 +302,17 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
.add(maType.getNum() == null ? new BigDecimal(0) : maType.getNum())); .add(maType.getNum() == null ? new BigDecimal(0) : maType.getNum()));
purchaseMacodeInfoMapper.updateTypeByTypeId(maType); purchaseMacodeInfoMapper.updateTypeByTypeId(maType);
//判断是否是成套机具是的话配件库存也要增加
if ("2".equals(maType.getManageType())){
PurchaseCheckInfo purchaseCheckInfo = new PurchaseCheckInfo();
purchaseCheckInfo.setPurchaseNum(maInputRecord.getInputNum().toString());
purchaseCheckInfo.setTypeId(maInputRecord.getTypeId());
List<MachinePart> wholeSetDetails = purchaseCheckInfoService.getWholeSetDetails(purchaseCheckInfo);
for (MachinePart wholeSetDetail : wholeSetDetails) {
purchaseMacodeInfoMapper.updateMaTypeNum(wholeSetDetail);
}
}
BigDecimal inputNum = checkDetailsMapper.selectInputNumByTypeId(taskId, typeId); BigDecimal inputNum = checkDetailsMapper.selectInputNumByTypeId(taskId, typeId);
PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails(); PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails();
purchaseCheckDetails.setTaskId(taskId); purchaseCheckDetails.setTaskId(taskId);

View File

@ -312,6 +312,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getWholeSetDetails" resultType="com.bonus.sgzb.material.domain.MachinePart"> <select id="getWholeSetDetails" resultType="com.bonus.sgzb.material.domain.MachinePart">
SELECT SELECT
mt2.type_name AS typeModelName, mt2.type_name AS typeModelName,
mt2.type_id as typeId,
mt3.type_name AS typeName, mt3.type_name AS typeName,
aa.part_num * #{purchaseNum} AS partNum, aa.part_num * #{purchaseNum} AS partNum,
mt2.unit_name as unitName mt2.unit_name as unitName

View File

@ -534,4 +534,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and type_id = #{typeId} and type_id = #{typeId}
and ma_code = #{maCode} and ma_code = #{maCode}
</update> </update>
<update id="updateMaTypeNum">
UPDATE ma_type
SET num = ifnull( num, 0 ) + #{partNum} WHERE type_id = #{typeId}
</update>
</mapper> </mapper>