质检单问题修改

jg-waiwang-pro
CJYXTX\27961 7 months ago
parent 537e4e0ada
commit 8ab9d4678b

@ -8,7 +8,11 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.engine.entity.FlowTaskNodeEntity;
import jnpf.engine.service.FlowTaskNodeService;
import jnpf.engine.service.FlowTaskService;
import jnpf.exception.DataException;
import jnpf.mapper.VoucherProductMapper;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
@ -17,7 +21,10 @@ import jnpf.model.warehousinginspection.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
@ -83,6 +90,14 @@ public class WarehousingInspectionController {
@Autowired
private ConfigValueUtil configValueUtil;
@Autowired
private FlowTaskService flowTaskService;
@Autowired
private FlowTaskNodeService flowTaskNodeService;
@Autowired
private VoucherService voucherService;
@Autowired
private VoucherProductService voucherProductService;
@ -423,7 +438,49 @@ public class WarehousingInspectionController {
WarehousingInspectionEntity entity= warehousingInspectionService.getInfo(id);
if(entity!=null){
try{
warehousingInspectionService.saveOrUpdate(warehousingInspectionForm,id,false);
FlowTaskEntity flowTaskEntity = flowTaskService.getById(id);
if (flowTaskEntity==null){
warehousingInspectionService.saveOrUpdate(warehousingInspectionForm,id,false);
}else {
QueryWrapper<FlowTaskNodeEntity> flowTaskNodeEntityQueryWrapper = new QueryWrapper<>();
flowTaskNodeEntityQueryWrapper.lambda().eq(FlowTaskNodeEntity::getNodeCode, flowTaskEntity.getThisStepId());
flowTaskNodeEntityQueryWrapper.lambda().eq(FlowTaskNodeEntity::getTaskId, flowTaskEntity.getId());
List<FlowTaskNodeEntity> flowTaskNodeEntityList = flowTaskNodeService.list(flowTaskNodeEntityQueryWrapper);
//审批结果
if(flowTaskNodeEntityList != null && "end".equals(flowTaskNodeEntityList.get(0).getNodeNext())){
//修改质检单
warehousingInspectionService.saveOrUpdate(warehousingInspectionForm,id,false);
//修改凭证主表
QueryWrapper<VoucherEntity> voucherEntityQueryWrapper = new QueryWrapper<>();
voucherEntityQueryWrapper.lambda().eq(VoucherEntity::getId,warehousingInspectionForm.getWarehousingInspectionVoucherList().get(0).getVoucheId());
List<VoucherEntity> voucherEntityList = voucherService.list(voucherEntityQueryWrapper);
for (VoucherEntity voucherEntity:voucherEntityList){
voucherEntity.setLastModifyUserId(warehousingInspectionForm.getLastModifyUserId());
voucherEntity.setLastModifyTime(new Date());
voucherService.saveOrUpdate(voucherEntity);
}
//修改凭证子表
QueryWrapper<VoucherProductEntity> voucherProductEntityQueryWrapper = new QueryWrapper<>();
voucherProductEntityQueryWrapper.lambda().eq(VoucherProductEntity::getVoucherId,warehousingInspectionForm.getWarehousingInspectionVoucherList().get(0).getVoucheId());
voucherProductEntityQueryWrapper.lambda().eq(VoucherProductEntity::getProductId,warehousingInspectionForm.getWarehousingInspectionProductList().get(0).getProductId());
List<VoucherProductEntity> voucherProductEntityList = voucherProductService.list(voucherProductEntityQueryWrapper);
for (WarehousingInspectionConclusionModel warehousingInspectionConclusionModel:warehousingInspectionForm.getWarehousingInspectionConclusionList()){
BigDecimal grossWeight =new BigDecimal(warehousingInspectionConclusionModel.getGrossWeight());
BigDecimal tareWeight =new BigDecimal(warehousingInspectionConclusionModel.getTareWeight());
BigDecimal buckleWeight =new BigDecimal(warehousingInspectionConclusionModel.getBuckleWeight());
BigDecimal netWeight =new BigDecimal(warehousingInspectionConclusionModel.getNetWeight());
for (VoucherProductEntity voucherProduct:voucherProductEntityList){
voucherProduct.setGrossWeight(grossWeight);
voucherProduct.setTareWeight(tareWeight);
voucherProduct.setBuckleWeight(buckleWeight);
voucherProduct.setNetWeight(netWeight);
voucherProduct.setLastModifyUserId(warehousingInspectionForm.getCreatorUserId());
voucherProduct.setLastModifyTime(new Date());
voucherProductService.saveOrUpdate(voucherProduct);
}
}
}
}
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}

@ -869,9 +869,9 @@ export default {
const e = this.dataForm.warehousingInspectionConclusionList[i];
if (!e.netWeight) {
this.$message({
message: '净重(自动计算)不能为空',
message: '净重(自动计算)不能为空,请输入质检后的毛,皮,扣',
type: 'error',
duration: 1000
duration: 2500
});
isOk = false
break

Loading…
Cancel
Save