|
@@ -5,22 +5,32 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
+import com.muchinfo.mtp.proto.BankMI2;
|
|
|
|
|
+import com.muchinfo.mtp.proto.Common;
|
|
|
|
|
+import com.muchinfo.mtp.proto.WarehouseReceiptMI1;
|
|
|
import com.muchinfo.mtp3century.service.ICommonService;
|
|
import com.muchinfo.mtp3century.service.ICommonService;
|
|
|
import com.muchinfo.mtp3century.service.IWarehouseService;
|
|
import com.muchinfo.mtp3century.service.IWarehouseService;
|
|
|
import com.muchinfo.mtp3common.enumtype.Constants;
|
|
import com.muchinfo.mtp3common.enumtype.Constants;
|
|
|
|
|
+import com.muchinfo.mtp3common.enumtype.FunCodeConstants;
|
|
|
import com.muchinfo.mtp3common.enumtype.MessageType;
|
|
import com.muchinfo.mtp3common.enumtype.MessageType;
|
|
|
import com.muchinfo.mtp3common.enumtype.SysConstants;
|
|
import com.muchinfo.mtp3common.enumtype.SysConstants;
|
|
|
import com.muchinfo.mtp3common.utils.DateTimeUtils;
|
|
import com.muchinfo.mtp3common.utils.DateTimeUtils;
|
|
|
import com.muchinfo.mtp3common.vo.AjaxResult;
|
|
import com.muchinfo.mtp3common.vo.AjaxResult;
|
|
|
|
|
+import com.muchinfo.mtp3common.vo.Calculator;
|
|
|
import com.muchinfo.mtp3common.vo.PageResult;
|
|
import com.muchinfo.mtp3common.vo.PageResult;
|
|
|
|
|
+import com.muchinfo.mtp3common.vo.ProtoHelper;
|
|
|
import com.muchinfo.mtp3interface.mapper.*;
|
|
import com.muchinfo.mtp3interface.mapper.*;
|
|
|
import com.muchinfo.mtp3pojos.entity.*;
|
|
import com.muchinfo.mtp3pojos.entity.*;
|
|
|
import com.muchinfo.mtp3common.utils.SerialNumberUtils;
|
|
import com.muchinfo.mtp3common.utils.SerialNumberUtils;
|
|
|
import com.muchinfo.mtp3pojos.vo.LineTreeNode;
|
|
import com.muchinfo.mtp3pojos.vo.LineTreeNode;
|
|
|
|
|
+import com.muchinfo.mtp3pojos.vo.ProtoErrorCodes;
|
|
|
import com.muchinfo.mtp3pojos.vo.common.OrganSelectResult;
|
|
import com.muchinfo.mtp3pojos.vo.common.OrganSelectResult;
|
|
|
import com.muchinfo.mtp3pojos.vo.warehouse.*;
|
|
import com.muchinfo.mtp3pojos.vo.warehouse.*;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
+import org.springframework.amqp.core.Message;
|
|
|
|
|
+import org.springframework.amqp.core.MessageProperties;
|
|
|
|
|
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -63,8 +73,10 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|
|
private IWrstandardfactoryitemMapper iWrstandardfactoryitemMapper;
|
|
private IWrstandardfactoryitemMapper iWrstandardfactoryitemMapper;
|
|
|
@Resource
|
|
@Resource
|
|
|
private IWrholdlbMapper iWrholdlbMapper;
|
|
private IWrholdlbMapper iWrholdlbMapper;
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private RabbitTemplate rabbitTemplate;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private IUseraccountMapper iUseraccountMapper;
|
|
|
@Override
|
|
@Override
|
|
|
public PageResult<WarehouseQueryResult> query(WarehouseQueryParam param, HttpServletRequest request) {
|
|
public PageResult<WarehouseQueryResult> query(WarehouseQueryParam param, HttpServletRequest request) {
|
|
|
Systemmanager systemmanager = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
|
|
Systemmanager systemmanager = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
|
|
@@ -348,7 +360,7 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public AjaxResult querywhlist(Long userid, Long wrstandardid, HttpServletRequest request) {
|
|
public AjaxResult querywhlist(Long userid, Long wrstandardid, HttpServletRequest request) {
|
|
|
- List<WhlistQueryResult> results = iWroutinapplyMapper.querywhlist(userid,wrstandardid);
|
|
|
|
|
|
|
+ List<WhlistQueryResult> results = iWroutinapplyMapper.querywhlist(userid, wrstandardid);
|
|
|
return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"), results);
|
|
return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"), results);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -372,7 +384,7 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|
|
vo.setFirstaudittime(new Date());
|
|
vo.setFirstaudittime(new Date());
|
|
|
vo.setSecondauditid(systemmanager.getAutoid());
|
|
vo.setSecondauditid(systemmanager.getAutoid());
|
|
|
vo.setSecondaudittime(new Date());
|
|
vo.setSecondaudittime(new Date());
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
vo.setApplystatus(1);
|
|
vo.setApplystatus(1);
|
|
|
vo.setApplytype(2);
|
|
vo.setApplytype(2);
|
|
|
}
|
|
}
|
|
@@ -391,12 +403,12 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|
|
|
|
|
|
|
Long applyid = SerialNumberUtils.getSerialNumber(SerialNumberUtils.prefix_wroutin);
|
|
Long applyid = SerialNumberUtils.getSerialNumber(SerialNumberUtils.prefix_wroutin);
|
|
|
vo.setApplyid(applyid);
|
|
vo.setApplyid(applyid);
|
|
|
- Wrstandard wr = iWrstandardMapper.selectOne(new QueryWrapper<Wrstandard>().eq("wrstandardid",param.getWrstandardid()));
|
|
|
|
|
|
|
+ Wrstandard wr = iWrstandardMapper.selectOne(new QueryWrapper<Wrstandard>().eq("wrstandardid", param.getWrstandardid()));
|
|
|
vo.setWrstandardcode(wr.getWrstandardcode());
|
|
vo.setWrstandardcode(wr.getWrstandardcode());
|
|
|
vo.setDeliverygoodsid(wr.getDeliverygoodsid());
|
|
vo.setDeliverygoodsid(wr.getDeliverygoodsid());
|
|
|
Integer inqty = 0;
|
|
Integer inqty = 0;
|
|
|
List<WrHoldLBResult> wrHoldLBs = param.getResultList();
|
|
List<WrHoldLBResult> wrHoldLBs = param.getResultList();
|
|
|
- if(CollectionUtils.isNotEmpty(wrHoldLBs)){
|
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(wrHoldLBs)) {
|
|
|
for (WrHoldLBResult wrHoldLBo : wrHoldLBs) {
|
|
for (WrHoldLBResult wrHoldLBo : wrHoldLBs) {
|
|
|
inqty += wrHoldLBo.getOutqty();
|
|
inqty += wrHoldLBo.getOutqty();
|
|
|
Wroutindetail wd = new Wroutindetail();
|
|
Wroutindetail wd = new Wroutindetail();
|
|
@@ -409,8 +421,7 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|
|
wd.setUpdatorid(vo.getCreatorid());
|
|
wd.setUpdatorid(vo.getCreatorid());
|
|
|
if (wrHoldLBo.getWrfactortypeid() != null) {
|
|
if (wrHoldLBo.getWrfactortypeid() != null) {
|
|
|
wd.setWrfactortypeid(wrHoldLBo.getWrfactortypeid());
|
|
wd.setWrfactortypeid(wrHoldLBo.getWrfactortypeid());
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
|
|
+ } else {
|
|
|
Wrholdlb wrHoldLB = iWrholdlbMapper.selectOne(new QueryWrapper<Wrholdlb>()
|
|
Wrholdlb wrHoldLB = iWrholdlbMapper.selectOne(new QueryWrapper<Wrholdlb>()
|
|
|
.eq("ladingbillid", wrHoldLBo.getLadingbillid())
|
|
.eq("ladingbillid", wrHoldLBo.getLadingbillid())
|
|
|
.eq("subnum", wrHoldLBo.getSubnum()));
|
|
.eq("subnum", wrHoldLBo.getSubnum()));
|
|
@@ -421,7 +432,7 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|
|
if ("5".equals(sm)) {
|
|
if ("5".equals(sm)) {
|
|
|
wd.setOutrealqty(Long.valueOf(wrHoldLBo.getOutqty()));
|
|
wd.setOutrealqty(Long.valueOf(wrHoldLBo.getOutqty()));
|
|
|
iWroutindetailMapper.insert(wd);
|
|
iWroutindetailMapper.insert(wd);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
iWroutindetailMapper.insert(wd);
|
|
iWroutindetailMapper.insert(wd);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -438,7 +449,7 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|
|
@Override
|
|
@Override
|
|
|
public PageResult<WarehouseReceiptResult> receiptquery(WarehouseReceiptParam param, HttpServletRequest request) {
|
|
public PageResult<WarehouseReceiptResult> receiptquery(WarehouseReceiptParam param, HttpServletRequest request) {
|
|
|
Systemmanager systemmanager = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
|
|
Systemmanager systemmanager = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
|
|
|
- if (!SysConstants.SYS_TYPE_MANAGE.equals(systemmanager.getReletype())){ //如果不是平台管理员
|
|
|
|
|
|
|
+ if (!SysConstants.SYS_TYPE_MANAGE.equals(systemmanager.getReletype())) { //如果不是平台管理员
|
|
|
param.setAreauserid(systemmanager.getAreauserid());
|
|
param.setAreauserid(systemmanager.getAreauserid());
|
|
|
}
|
|
}
|
|
|
param.setWarehousecode(param.getWarehousecode() == null ? null : param.getWarehousecode().trim());
|
|
param.setWarehousecode(param.getWarehousecode() == null ? null : param.getWarehousecode().trim());
|
|
@@ -456,6 +467,171 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|
|
return pageResult;
|
|
return pageResult;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public AjaxResult dealreceipt(WarehouseReceiptAddParam param, HttpServletRequest request) {
|
|
|
|
|
+ Systemmanager systemmanager = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
|
|
|
|
|
+ if (param.getAutoid() != null) {
|
|
|
|
|
+ Warehouseinfo wh = iWarehouseinfoMapper.selectOne(new QueryWrapper<Warehouseinfo>().eq("autoid", param.getAutoid()));
|
|
|
|
|
+ String oldWarehousename = wh.getWarehousename();
|
|
|
|
|
+ if (!param.getWarehousename().equals(wh.getWarehousename())) {
|
|
|
|
|
+ Warehouseinfo current = iWarehouseinfoMapper.selectOne(new QueryWrapper<Warehouseinfo>().eq("warehousename", param.getWarehousename().trim()));
|
|
|
|
|
+ if (Objects.isNull(current)) {
|
|
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.WAREHOUSE_ERROR_CODE_03.getCode(), request.getHeader("Accept-Language"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ wh.setAreauserid(param.getAreauserid());
|
|
|
|
|
+ wh.setWarehousename(param.getWarehousename());
|
|
|
|
|
+ wh.setWarehousetype(param.getWarehousetype());
|
|
|
|
|
+ wh.setCountryid(param.getCountryid());
|
|
|
|
|
+ wh.setProvinceid(param.getProvinceid());
|
|
|
|
|
+ wh.setCityid(param.getCityid());
|
|
|
|
|
+ wh.setDistrictid(param.getDistrictid());
|
|
|
|
|
+ wh.setAddress(param.getAddress());
|
|
|
|
|
+ // 审核拒绝的修改后状态变为待审核
|
|
|
|
|
+ if (wh.getWarehousestatus() == 4 || wh.getWarehousestatus() == 2)
|
|
|
|
|
+ wh.setWarehousestatus(3);
|
|
|
|
|
+ wh.setHasvideo(param.getHasvideo());
|
|
|
|
|
+ wh.setVideourl(param.getVideourl());
|
|
|
|
|
+ wh.setContactname(param.getContactname());
|
|
|
|
|
+ wh.setContactnum(param.getContactnum());
|
|
|
|
|
+ iWarehouseinfoMapper.updateById(wh);
|
|
|
|
|
+ if (!oldWarehousename.equals(param.getWarehousename())) {
|
|
|
|
|
+ List<Dgfactoryitem> dGFactoryItemList = iDgfactoryitemMapper.selectList(new QueryWrapper<Dgfactoryitem>().eq("warehouseid", wh.getAutoid()));
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dGFactoryItemList)) {
|
|
|
|
|
+ for (Dgfactoryitem dgFactoryItem : dGFactoryItemList) {
|
|
|
|
|
+ dgFactoryItem.setDgfactoryitemvalue(wh.getWarehousename());
|
|
|
|
|
+ iDgfactoryitemMapper.updateById(dgFactoryItem);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ sendWRFactorTypeNameUpdateReqMsg(wh, systemmanager);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (param.getWarehousecode().length() > 10) {
|
|
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.WAREHOUSE_ERROR_CODE_01.getCode(), request.getHeader("Accept-Language"));
|
|
|
|
|
+ }
|
|
|
|
|
+ Warehouseinfo wh = null;
|
|
|
|
|
+ wh = iWarehouseinfoMapper.selectOne(new QueryWrapper<Warehouseinfo>().eq("warehousecode", param.getWarehousecode().trim()));
|
|
|
|
|
+ if (Objects.nonNull(wh)) {
|
|
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.WAREHOUSE_ERROR_CODE_02.getCode(), request.getHeader("Accept-Language"));
|
|
|
|
|
+ }
|
|
|
|
|
+ wh = iWarehouseinfoMapper.selectOne(new QueryWrapper<Warehouseinfo>().eq("warehousename", param.getWarehousename().trim()));
|
|
|
|
|
+ if (Objects.nonNull(wh)) {
|
|
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.WAREHOUSE_ERROR_CODE_03.getCode(), request.getHeader("Accept-Language"));
|
|
|
|
|
+ }
|
|
|
|
|
+ wh = new Warehouseinfo();
|
|
|
|
|
+ wh.setWarehousecode(param.getWarehousecode().trim());
|
|
|
|
|
+ wh.setWarehousename(param.getWarehousename().trim());
|
|
|
|
|
+ wh.setWarehousetype(param.getWarehousetype());
|
|
|
|
|
+ wh.setAreauserid(param.getAreauserid());
|
|
|
|
|
+ // 仓库状态 - 1:正常 2:注销 3:待审核 4:审核拒绝
|
|
|
|
|
+ wh.setWarehousestatus(3);
|
|
|
|
|
+ wh.setCountryid(param.getCountryid());
|
|
|
|
|
+ wh.setProvinceid(param.getProvinceid());
|
|
|
|
|
+ wh.setCityid(param.getCityid());
|
|
|
|
|
+ wh.setDistrictid(param.getDistrictid());
|
|
|
|
|
+ wh.setAddress(param.getAddress());
|
|
|
|
|
+ wh.setCreatetime(new Date());
|
|
|
|
|
+ wh.setHasvideo(param.getHasvideo());
|
|
|
|
|
+ wh.setVideourl(param.getVideourl());
|
|
|
|
|
+ wh.setContactname(param.getContactname());
|
|
|
|
|
+ wh.setContactnum(param.getContactnum());
|
|
|
|
|
+ iWarehouseinfoMapper.insert(wh);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public AjaxResult<WarehouseReceiptDetailResult> receiptDetail(Long warehouseid, Integer isaudit, HttpServletRequest request) {
|
|
|
|
|
+ Systemmanager systemmanager = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
|
|
|
|
|
+ if (!iCommonService.checkUserAccountRole(systemmanager, warehouseid)) {
|
|
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.MESSAGE_ERROR_CODE_SYSTEM003.getCode(), request.getHeader("Accept-Language"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Warehouseinfo current = iWarehouseinfoMapper.selectOne(new QueryWrapper<Warehouseinfo>().eq("autoid", warehouseid));
|
|
|
|
|
+ WarehouseReceiptDetailResult result = new WarehouseReceiptDetailResult();
|
|
|
|
|
+ BeanUtils.copyProperties(current, result);
|
|
|
|
|
+ if(current.getAreauserid() != null){
|
|
|
|
|
+ Useraccount ognz = iUseraccountMapper.selectOne(new QueryWrapper<Useraccount>().eq("userid",current.getAreauserid()));
|
|
|
|
|
+ if(ognz==null){
|
|
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.WAREHOUSE_ERROR_CODE_04.getCode(), request.getHeader("Accept-Language"));
|
|
|
|
|
+ }
|
|
|
|
|
+ result.setAreaname(ognz.getAccountname());
|
|
|
|
|
+ }
|
|
|
|
|
+ if(current.getDistrictid() != null){
|
|
|
|
|
+ Division area = iDivisionMapper.selectOne(new QueryWrapper<Division>().eq("autoid",current.getDistrictid()));
|
|
|
|
|
+ result.setDetailaddress(area.getPathname() +" "+ current.getAddress());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ result.setDetailaddress(current.getAddress());
|
|
|
|
|
+ }
|
|
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"),result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public AjaxResult receiptaudit(WarehouseReceiptAuditParam param, HttpServletRequest request) {
|
|
|
|
|
+ Warehouseinfo warehouseInfo = iWarehouseinfoMapper.selectOne(new QueryWrapper<Warehouseinfo>().eq("autoid", param.getAutoid()));
|
|
|
|
|
+ warehouseInfo.setWarehousestatus(param.getAuditflag());
|
|
|
|
|
+ if (param.getMsg() != null) {
|
|
|
|
|
+ warehouseInfo.setRemark(param.getMsg());
|
|
|
|
|
+ }
|
|
|
|
|
+ iWarehouseinfoMapper.updateById(warehouseInfo);
|
|
|
|
|
+ return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public AjaxResult receiptlogff(Long autoid, HttpServletRequest request) {
|
|
|
|
|
+ if (iDeliverygoodsMapper.selectCount(new QueryWrapper<Deliverygoods>().eq("categoryid", autoid)) > 0) {
|
|
|
|
|
+ return AjaxResult.error(Constants.Error_Code_Design, MessageType.WAREHOUSE_ERROR_CODE_05.getCode(), request.getHeader("Accept-Language"));
|
|
|
|
|
+ }
|
|
|
|
|
+ Warehouseinfo warehoueInfo = iWarehouseinfoMapper.selectOne(new QueryWrapper<Warehouseinfo>().eq("autoid", autoid));
|
|
|
|
|
+ warehoueInfo.setWarehousestatus(2);
|
|
|
|
|
+ iWarehouseinfoMapper.updateById(warehoueInfo);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void sendWRFactorTypeNameUpdateReqMsg(Warehouseinfo wh, Systemmanager systemmanager) {
|
|
|
|
|
+ WarehouseReceiptMI1.WRFactorTypeNameUpdateReq.Builder builder = WarehouseReceiptMI1.WRFactorTypeNameUpdateReq.newBuilder();
|
|
|
|
|
+ WarehouseReceiptMI1.WRCommon.Builder common = WarehouseReceiptMI1.WRCommon.newBuilder();
|
|
|
|
|
+ Long uuid = SerialNumberUtils.getNewSerialNumber(SerialNumberUtils.prefix_warehouse);
|
|
|
|
|
+ if (wh.getAreauserid() != null) {
|
|
|
|
|
+ common.setUserID(wh.getAreauserid());
|
|
|
|
|
+ }
|
|
|
|
|
+ common.setRelatedOrderID(uuid);
|
|
|
|
|
+ common.setTradeID(wh.getAutoid());
|
|
|
|
|
+ Common.MessageHead.Builder hd = Common.MessageHead.newBuilder();
|
|
|
|
|
+ hd.setFunCode(FunCodeConstants.FunCode_Trade_WRFactorTypeNameUpdateReq);
|
|
|
|
|
+ hd.setClientTime(System.currentTimeMillis());
|
|
|
|
|
+ hd.setResponseTopic(SysConstants.RabbitWRRegisterRspKey);
|
|
|
|
|
+ hd.setMarketID(Constants.SPEICAL_MARKET_WR);
|
|
|
|
|
+ hd.setUUID(uuid.toString());
|
|
|
|
|
+ hd.setUserID(systemmanager.getAutoid().intValue());
|
|
|
|
|
+ builder.setHeader(hd);
|
|
|
|
|
+ builder.setCommon(common);
|
|
|
|
|
+
|
|
|
|
|
+ byte[] body = ProtoHelper.getNTAS(builder.build().toByteArray(), FunCodeConstants.FunCode_Trade_WRFactorTypeNameUpdateReq);
|
|
|
|
|
+ Calculator ca = SerialNumberUtils.createCalculator(uuid);
|
|
|
|
|
+ rabbitTemplate.send(SysConstants.RabbitWRKey, new Message(body, new MessageProperties()));
|
|
|
|
|
+ log.info("sendWRFactorTypeNameUpdateReqMsg:{}", builder.build());
|
|
|
|
|
+
|
|
|
|
|
+ synchronized (ca) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ ca.wait(10000);
|
|
|
|
|
+ Object rsp_ = ca.obj;
|
|
|
|
|
+ if (rsp_ != null) {
|
|
|
|
|
+ WarehouseReceiptMI1.WRFactorTypeNameUpdateRsp rsp = (WarehouseReceiptMI1.WRFactorTypeNameUpdateRsp) rsp_;
|
|
|
|
|
+ if (rsp.getRetCode() != 0) {
|
|
|
|
|
+ String errDesc = ProtoErrorCodes.resultMsg(rsp.getRetCode());
|
|
|
|
|
+ log.error("仓单品种修改更新历史数据失败,失败原因:" + errDesc);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
|
+ log.error("消息发送失败,失败原因:" + e.getMessage());
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ SerialNumberUtils.lockMap.remove(uuid);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private List<LineTreeNode> getChildren(List<Deliverygoods> dgList, Long categoryid) {
|
|
private List<LineTreeNode> getChildren(List<Deliverygoods> dgList, Long categoryid) {
|
|
|
List<LineTreeNode> tnlist = new ArrayList<>();
|
|
List<LineTreeNode> tnlist = new ArrayList<>();
|
|
|
for (Deliverygoods dg : dgList) {
|
|
for (Deliverygoods dg : dgList) {
|