|
|
@ -33,6 +33,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
|
import com.yxt.wms.biz.inventory.wmsinventoryprofitout.WmsInventoryProfitout; |
|
|
|
import com.yxt.wms.biz.inventory.wmsinventoryprofitout.flowable.*; |
|
|
|
import com.yxt.wms.biz.inventory.wmsinventoryrecord.InventoryRecordDto; |
|
|
|
import com.yxt.wms.biz.inventory.wmsinventoryrecord.WmsInventoryRecordService; |
|
|
|
import com.yxt.wms.biz.inventory.wmsotheroutapply.flowable.*; |
|
|
|
import com.yxt.wms.biz.inventory.wmsotheroutdetail.WmsOtheroutDetailDetailsVo; |
|
|
|
import com.yxt.wms.biz.inventory.wmsotheroutdetail.WmsOtheroutDetailDto; |
|
|
@ -92,6 +94,8 @@ public class WmsOtheroutApplyService extends MybatisBaseService<WmsOtheroutApply |
|
|
|
private WmsOtheroutDetailService wmsOtheroutDetailService; |
|
|
|
@Autowired |
|
|
|
private SysUserRoleFeign sysUserRoleFeign; |
|
|
|
@Autowired |
|
|
|
private WmsInventoryRecordService wmsInventoryRecordService; |
|
|
|
|
|
|
|
public PagerVo<WmsOtheroutApplyVo> listPageVo(PagerQuery<WmsOtheroutApplyQuery> pq) { |
|
|
|
WmsOtheroutApplyQuery query = pq.getParams(); |
|
|
@ -164,7 +168,7 @@ public class WmsOtheroutApplyService extends MybatisBaseService<WmsOtheroutApply |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public String saveOrUpdateDto(WmsOtheroutApplyDto dto){ |
|
|
|
public String saveOrUpdateDto(WmsOtheroutApplyDto dto) { |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
List<WmsOtheroutDetailDto> otheroutDetailList = dto.getOtheroutDetailList(); |
|
|
|
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(dto.getDeptSid()).getData(); |
|
|
@ -200,7 +204,7 @@ public class WmsOtheroutApplyService extends MybatisBaseService<WmsOtheroutApply |
|
|
|
return dtoSid; |
|
|
|
} |
|
|
|
|
|
|
|
public String insertByDto(WmsOtheroutApplyDto dto){ |
|
|
|
public String insertByDto(WmsOtheroutApplyDto dto) { |
|
|
|
WmsOtheroutApply entity = new WmsOtheroutApply(); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
entity.setNodeState("待提交"); |
|
|
@ -208,7 +212,7 @@ public class WmsOtheroutApplyService extends MybatisBaseService<WmsOtheroutApply |
|
|
|
return entity.getSid(); |
|
|
|
} |
|
|
|
|
|
|
|
public void updateByDto(WmsOtheroutApplyDto dto){ |
|
|
|
public void updateByDto(WmsOtheroutApplyDto dto) { |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
|
return; |
|
|
@ -218,7 +222,7 @@ public class WmsOtheroutApplyService extends MybatisBaseService<WmsOtheroutApply |
|
|
|
baseMapper.updateById(entity); |
|
|
|
} |
|
|
|
|
|
|
|
public WmsOtheroutApplyDetailsVo fetchDetailsVoBySid(String sid){ |
|
|
|
public WmsOtheroutApplyDetailsVo fetchDetailsVoBySid(String sid) { |
|
|
|
WmsOtheroutApply entity = fetchBySid(sid); |
|
|
|
WmsOtheroutApplyDetailsVo vo = new WmsOtheroutApplyDetailsVo(); |
|
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
@ -274,7 +278,7 @@ public class WmsOtheroutApplyService extends MybatisBaseService<WmsOtheroutApply |
|
|
|
bv.setFormVariables(variables); |
|
|
|
if (r == 1) { |
|
|
|
//ToDo:流程定义id
|
|
|
|
bv.setModelId(ProcDefEnum.WMSINVENTORYPROFITOUT.getProDefId()); |
|
|
|
bv.setModelId(ProcDefEnum.WMSOTHEROUTAPPLY.getProDefId()); |
|
|
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowFeign.startProcess(bv); |
|
|
|
if (!voResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(voResultBean.getMsg()); |
|
|
@ -375,7 +379,44 @@ public class WmsOtheroutApplyService extends MybatisBaseService<WmsOtheroutApply |
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
|
|
|
|
List<WmsOtheroutDetailDetailsVo> wmsOtheroutDetailDetailsVos = wmsOtheroutDetailService.selByMainSid(businessSid); |
|
|
|
for (WmsOtheroutDetailDetailsVo wmsOtheroutDetailDetailsVo : wmsOtheroutDetailDetailsVos) { |
|
|
|
InventoryRecordDto inventoryRecordDto = new InventoryRecordDto(); |
|
|
|
inventoryRecordDto.setCreateBySid(wmsOtheroutApply.getCreateBySid()); |
|
|
|
inventoryRecordDto.setGoodsID(wmsOtheroutDetailDetailsVo.getGoodsID()); |
|
|
|
inventoryRecordDto.setSourceBillSid(businessSid); |
|
|
|
inventoryRecordDto.setBillNo(wmsOtheroutApply.getBillNo()); |
|
|
|
inventoryRecordDto.setBillType("0"); |
|
|
|
inventoryRecordDto.setBusTypeKey("19"); |
|
|
|
inventoryRecordDto.setBusTypeValue("其他出库"); |
|
|
|
inventoryRecordDto.setGoodsSpuSid(wmsOtheroutDetailDetailsVo.getGoodsSpuSid()); |
|
|
|
inventoryRecordDto.setGoodsSpuName(wmsOtheroutDetailDetailsVo.getGoodsSpuName()); |
|
|
|
inventoryRecordDto.setGoodsSkuSid(wmsOtheroutDetailDetailsVo.getGoodsSkuSid()); |
|
|
|
inventoryRecordDto.setGoodsSkuTitle(wmsOtheroutDetailDetailsVo.getGoodsSkuTitle()); |
|
|
|
inventoryRecordDto.setGoodsSkuCode(wmsOtheroutDetailDetailsVo.getGoodsSkuCode()); |
|
|
|
inventoryRecordDto.setGoodsSkuOwnSpec(wmsOtheroutDetailDetailsVo.getGoodsSkuOwnSpec()); |
|
|
|
inventoryRecordDto.setUnit(wmsOtheroutDetailDetailsVo.getUnit()); |
|
|
|
inventoryRecordDto.setCount(wmsOtheroutDetailDetailsVo.getOutCount().toString()); |
|
|
|
inventoryRecordDto.setWarehouseSid(wmsOtheroutDetailDetailsVo.getWarehouseSid()); |
|
|
|
inventoryRecordDto.setWarehouseName(wmsOtheroutDetailDetailsVo.getWarehouseName()); |
|
|
|
inventoryRecordDto.setWarehouseRackSid(wmsOtheroutDetailDetailsVo.getWarehouseRackSid()); |
|
|
|
inventoryRecordDto.setWarehouseRackCode(wmsOtheroutDetailDetailsVo.getWarehouseRackCode()); |
|
|
|
inventoryRecordDto.setCost(wmsOtheroutDetailDetailsVo.getInCost().toString()); |
|
|
|
inventoryRecordDto.setTaxRate(""); |
|
|
|
inventoryRecordDto.setAmount(wmsOtheroutDetailDetailsVo.getOutCount().multiply(wmsOtheroutDetailDetailsVo.getInCost()).toString()); |
|
|
|
inventoryRecordDto.setHandlerSid(wmsOtheroutApply.getCreateBySid()); |
|
|
|
inventoryRecordDto.setHandlerName(wmsOtheroutApply.getCreateByName()); |
|
|
|
inventoryRecordDto.setCreateOrgSid(wmsOtheroutApply.getCreateOrgSid()); |
|
|
|
inventoryRecordDto.setUseOrgSid(wmsOtheroutApply.getDeptSid()); |
|
|
|
inventoryRecordDto.setManufactorBillNo(""); |
|
|
|
inventoryRecordDto.setSupplierSid(""); |
|
|
|
inventoryRecordDto.setSupplierName(""); |
|
|
|
inventoryRecordDto.setManufacturerName(wmsOtheroutDetailDetailsVo.getManufacturerName()); |
|
|
|
inventoryRecordDto.setManufacturerSid(wmsOtheroutDetailDetailsVo.getManufacturerSid()); |
|
|
|
inventoryRecordDto.setPreBillSid(wmsOtheroutDetailDetailsVo.getSid()); |
|
|
|
inventoryRecordDto.setPreBillNo(wmsOtheroutApply.getBillNo()); |
|
|
|
wmsInventoryRecordService.saveInventoryRecord(inventoryRecordDto); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//极光推送
|
|
|
|
wmsOtheroutApply = fetchBySid(businessSid); |
|
|
|