优化后,可运行版本
parent
bd81c60c9e
commit
a3256cda2a
@ -1,39 +0,0 @@
|
|||||||
package com.glxp.api.admin.controller.info;
|
|
||||||
|
|
||||||
import com.glxp.api.admin.entity.info.SetupEntity;
|
|
||||||
import com.glxp.api.admin.req.info.FilterSetupRequest;
|
|
||||||
import com.glxp.api.admin.service.info.SetupService;
|
|
||||||
import com.glxp.api.common.res.BaseResponse;
|
|
||||||
import com.glxp.api.common.util.ResultVOUtils;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
public class SetupController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private SetupService setupService;
|
|
||||||
|
|
||||||
@GetMapping("/udi/info/setup")
|
|
||||||
public BaseResponse getCompanyInfo(FilterSetupRequest filterSetupRequest) {
|
|
||||||
filterSetupRequest.setId(1);
|
|
||||||
SetupEntity setupEntity = setupService.findSetup(filterSetupRequest);
|
|
||||||
if (setupEntity != null) {
|
|
||||||
return ResultVOUtils.success(setupEntity);
|
|
||||||
}
|
|
||||||
return ResultVOUtils.error(500, "设置信息为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/udi/info/setup/modify")
|
|
||||||
public BaseResponse modifyCompany(@RequestBody SetupEntity setupEntity) {
|
|
||||||
setupEntity.setId(1);
|
|
||||||
setupService.modifySetup(setupEntity);
|
|
||||||
return ResultVOUtils.success("修改成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
package com.glxp.api.admin.dao.inventory;
|
|
||||||
|
|
||||||
import com.glxp.api.admin.entity.basic.ErpStockEntity;
|
|
||||||
import com.glxp.api.admin.req.basic.FilterStockprintRequest;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface InvErpStockDao {
|
|
||||||
|
|
||||||
ErpStockEntity findByCode(@Param("code") String code, @Param("batchNo") String batchNo);
|
|
||||||
|
|
||||||
boolean insertErpStock(ErpStockEntity stockPrintEntity);
|
|
||||||
|
|
||||||
boolean insertErpStocks(@Param("erpStockEntities") List<ErpStockEntity> erpStockEntities);
|
|
||||||
|
|
||||||
boolean updateErpStock(ErpStockEntity udiInfoEntity);
|
|
||||||
|
|
||||||
boolean deleteById(@Param("id") String id);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.glxp.api.admin.entity.basic;
|
package com.glxp.api.admin.entity.inventory;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.glxp.api.admin.entity.basic;
|
package com.glxp.api.admin.entity.inventory;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -0,0 +1,228 @@
|
|||||||
|
package com.glxp.api.admin.req.basic;
|
||||||
|
|
||||||
|
public class PostSmpUdiInfoRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nameCode : 321
|
||||||
|
* packLevel :
|
||||||
|
* bhxjsl : 0
|
||||||
|
* bhzxxsbzsl : 0
|
||||||
|
* zxxsbzbhsydysl : 0
|
||||||
|
* bhxjcpbm :
|
||||||
|
* bzcj :
|
||||||
|
* deviceRecordKey :
|
||||||
|
* cpmctymc :
|
||||||
|
* cplb :
|
||||||
|
* flbm :
|
||||||
|
* ggxh :
|
||||||
|
* qxlb :
|
||||||
|
* tyshxydm :
|
||||||
|
* ylqxzcrbarmc :
|
||||||
|
* zczbhhzbapzbh :
|
||||||
|
* sjcpbm :
|
||||||
|
* versionNumber : 0
|
||||||
|
* diType : 0
|
||||||
|
* erpId :
|
||||||
|
* erpName :
|
||||||
|
* uuid : 123
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String nameCode;
|
||||||
|
private String packLevel;
|
||||||
|
private int bhxjsl;
|
||||||
|
private int bhzxxsbzsl;
|
||||||
|
private int zxxsbzbhsydysl;
|
||||||
|
private String bhxjcpbm;
|
||||||
|
private String bzcj;
|
||||||
|
private String deviceRecordKey;
|
||||||
|
private String cpmctymc;
|
||||||
|
private String cplb;
|
||||||
|
private String flbm;
|
||||||
|
private String ggxh;
|
||||||
|
private String qxlb;
|
||||||
|
private String tyshxydm;
|
||||||
|
private String ylqxzcrbarmc;
|
||||||
|
private String zczbhhzbapzbh;
|
||||||
|
private String sjcpbm;
|
||||||
|
private int versionNumber;
|
||||||
|
private int diType;
|
||||||
|
private String erpId;
|
||||||
|
private String erpName;
|
||||||
|
private String uuid;
|
||||||
|
|
||||||
|
public String getNameCode() {
|
||||||
|
return nameCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNameCode(String nameCode) {
|
||||||
|
this.nameCode = nameCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPackLevel() {
|
||||||
|
return packLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPackLevel(String packLevel) {
|
||||||
|
this.packLevel = packLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBhxjsl() {
|
||||||
|
return bhxjsl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBhxjsl(int bhxjsl) {
|
||||||
|
this.bhxjsl = bhxjsl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBhzxxsbzsl() {
|
||||||
|
return bhzxxsbzsl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBhzxxsbzsl(int bhzxxsbzsl) {
|
||||||
|
this.bhzxxsbzsl = bhzxxsbzsl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getZxxsbzbhsydysl() {
|
||||||
|
return zxxsbzbhsydysl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZxxsbzbhsydysl(int zxxsbzbhsydysl) {
|
||||||
|
this.zxxsbzbhsydysl = zxxsbzbhsydysl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBhxjcpbm() {
|
||||||
|
return bhxjcpbm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBhxjcpbm(String bhxjcpbm) {
|
||||||
|
this.bhxjcpbm = bhxjcpbm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBzcj() {
|
||||||
|
return bzcj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBzcj(String bzcj) {
|
||||||
|
this.bzcj = bzcj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceRecordKey() {
|
||||||
|
return deviceRecordKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceRecordKey(String deviceRecordKey) {
|
||||||
|
this.deviceRecordKey = deviceRecordKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCpmctymc() {
|
||||||
|
return cpmctymc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCpmctymc(String cpmctymc) {
|
||||||
|
this.cpmctymc = cpmctymc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCplb() {
|
||||||
|
return cplb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCplb(String cplb) {
|
||||||
|
this.cplb = cplb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlbm() {
|
||||||
|
return flbm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlbm(String flbm) {
|
||||||
|
this.flbm = flbm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGgxh() {
|
||||||
|
return ggxh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGgxh(String ggxh) {
|
||||||
|
this.ggxh = ggxh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQxlb() {
|
||||||
|
return qxlb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQxlb(String qxlb) {
|
||||||
|
this.qxlb = qxlb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTyshxydm() {
|
||||||
|
return tyshxydm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTyshxydm(String tyshxydm) {
|
||||||
|
this.tyshxydm = tyshxydm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getYlqxzcrbarmc() {
|
||||||
|
return ylqxzcrbarmc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYlqxzcrbarmc(String ylqxzcrbarmc) {
|
||||||
|
this.ylqxzcrbarmc = ylqxzcrbarmc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getZczbhhzbapzbh() {
|
||||||
|
return zczbhhzbapzbh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZczbhhzbapzbh(String zczbhhzbapzbh) {
|
||||||
|
this.zczbhhzbapzbh = zczbhhzbapzbh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSjcpbm() {
|
||||||
|
return sjcpbm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSjcpbm(String sjcpbm) {
|
||||||
|
this.sjcpbm = sjcpbm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getVersionNumber() {
|
||||||
|
return versionNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersionNumber(int versionNumber) {
|
||||||
|
this.versionNumber = versionNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDiType() {
|
||||||
|
return diType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDiType(int diType) {
|
||||||
|
this.diType = diType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErpId() {
|
||||||
|
return erpId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErpId(String erpId) {
|
||||||
|
this.erpId = erpId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErpName() {
|
||||||
|
return erpName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErpName(String erpName) {
|
||||||
|
this.erpName = erpName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(String uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.glxp.api.admin.req.udid;
|
package com.glxp.api.admin.req.info;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.glxp.api.admin.res.inventory;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ErpInvProductResponse {
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
private String batchNo;
|
||||||
|
private String manufacturingDate;
|
||||||
|
private String expirationDate;
|
||||||
|
private String warehouseCode;
|
||||||
|
private String warehouseName;
|
||||||
|
private String count;
|
||||||
|
}
|
@ -1,19 +0,0 @@
|
|||||||
package com.glxp.api.admin.service.info;
|
|
||||||
|
|
||||||
import com.glxp.api.admin.entity.info.SetupEntity;
|
|
||||||
import com.glxp.api.admin.req.info.FilterSetupRequest;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public interface SetupService {
|
|
||||||
|
|
||||||
SetupEntity selectSetup();
|
|
||||||
|
|
||||||
SetupEntity findSetup(FilterSetupRequest filterSetupRequest);
|
|
||||||
|
|
||||||
boolean modifySetup(SetupEntity setupEntity);
|
|
||||||
|
|
||||||
boolean insertSetup(SetupEntity setupEntity);
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
package com.glxp.api.admin.service.info.impl;
|
|
||||||
|
|
||||||
import com.glxp.api.admin.dao.info.SetupDao;
|
|
||||||
import com.glxp.api.admin.entity.info.SetupEntity;
|
|
||||||
import com.glxp.api.admin.req.info.FilterSetupRequest;
|
|
||||||
import com.glxp.api.admin.service.info.SetupService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class SetupServiceImpl implements SetupService {
|
|
||||||
@Resource
|
|
||||||
SetupDao setupDao;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SetupEntity selectSetup() {
|
|
||||||
FilterSetupRequest filterSetupRequest = new FilterSetupRequest();
|
|
||||||
filterSetupRequest.setId(1);
|
|
||||||
return setupDao.findSetup(filterSetupRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SetupEntity findSetup(FilterSetupRequest filterSetupRequest) {
|
|
||||||
return setupDao.findSetup(filterSetupRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean modifySetup(SetupEntity setupEntity) {
|
|
||||||
|
|
||||||
return setupDao.modifySetup(setupEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean insertSetup(SetupEntity setupEntity) {
|
|
||||||
return setupDao.insertSetup(setupEntity);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
package com.glxp.api.admin.service.inventory;
|
|
||||||
|
|
||||||
import com.glxp.api.admin.entity.basic.ErpStockEntity;
|
|
||||||
import com.glxp.api.admin.req.basic.FilterStockprintRequest;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface InvErpStockService {
|
|
||||||
|
|
||||||
|
|
||||||
ErpStockEntity findByCode(String nameCode,String batchNo);
|
|
||||||
|
|
||||||
boolean insertErpStock(ErpStockEntity stockPrintEntity);
|
|
||||||
|
|
||||||
boolean insertErpStocks(List<ErpStockEntity> stockPrintEntities);
|
|
||||||
|
|
||||||
boolean updateErpStock(ErpStockEntity udiInfoEntity);
|
|
||||||
|
|
||||||
boolean deleteById(String id);
|
|
||||||
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
package com.glxp.api.admin.service.inventory.impl;
|
|
||||||
|
|
||||||
import com.glxp.api.admin.dao.inventory.InvErpStockDao;
|
|
||||||
import com.glxp.api.admin.entity.basic.ErpStockEntity;
|
|
||||||
import com.glxp.api.admin.service.inventory.InvErpStockService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class InvErpStockServiceImpl implements InvErpStockService {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
InvErpStockDao erpStockDao;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ErpStockEntity findByCode(String nameCode, String batchNo) {
|
|
||||||
return erpStockDao.findByCode(nameCode, batchNo);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean insertErpStock(ErpStockEntity erpStockEntity) {
|
|
||||||
return erpStockDao.insertErpStock(erpStockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean insertErpStocks(List<ErpStockEntity> erpStockEntities) {
|
|
||||||
return erpStockDao.insertErpStocks(erpStockEntities);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean updateErpStock(ErpStockEntity erpStockEntity) {
|
|
||||||
return erpStockDao.updateErpStock(erpStockEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean deleteById(String id) {
|
|
||||||
return erpStockDao.deleteById(id);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,108 +0,0 @@
|
|||||||
package com.glxp.api.admin.thread;
|
|
||||||
|
|
||||||
import com.glxp.api.admin.entity.info.SystemParamConfigEntity;
|
|
||||||
import com.glxp.api.admin.entity.inout.ErpOrderEntity;
|
|
||||||
import com.glxp.api.admin.httpclient.ErpOrderClient;
|
|
||||||
import com.glxp.api.admin.req.inout.FilterOrderRequest;
|
|
||||||
import com.glxp.api.admin.entity.basic.ErpStockEntity;
|
|
||||||
import com.glxp.api.admin.entity.basic.UdiInfoEntity;
|
|
||||||
import com.glxp.api.admin.entity.basic.UdiRelevanceEntity;
|
|
||||||
import com.glxp.api.admin.entity.info.SetupEntity;
|
|
||||||
import com.glxp.api.admin.entity.inout.WarehouseEntity;
|
|
||||||
import com.glxp.api.admin.req.inout.WarehouseQueryRequest;
|
|
||||||
import com.glxp.api.admin.service.info.SystemParamConfigService;
|
|
||||||
import com.glxp.api.admin.service.inventory.InvErpStockService;
|
|
||||||
import com.glxp.api.admin.service.basic.UdiInfoService;
|
|
||||||
import com.glxp.api.admin.service.basic.UdiRelevanceService;
|
|
||||||
import com.glxp.api.admin.service.info.SetupService;
|
|
||||||
import com.glxp.api.admin.service.inout.CodesService;
|
|
||||||
import com.glxp.api.admin.util.DateUtil;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.scheduling.annotation.Async;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class InvDlErpStockService {
|
|
||||||
@Resource
|
|
||||||
SetupService setupService;
|
|
||||||
@Resource
|
|
||||||
InvErpStockService erpStockService;
|
|
||||||
@Resource
|
|
||||||
UdiRelevanceService udiRelevanceService;
|
|
||||||
@Resource
|
|
||||||
UdiInfoService udiInfoService;
|
|
||||||
@Resource
|
|
||||||
CodesService warehouseService;
|
|
||||||
@Resource
|
|
||||||
SystemParamConfigService systemParamConfigService;
|
|
||||||
final Logger logger = LoggerFactory.getLogger(InvDlErpStockService.class);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载ERP采购入库单所有产品信息到ERP库存表
|
|
||||||
*/
|
|
||||||
@Async
|
|
||||||
public void dlErpStock() {
|
|
||||||
SetupEntity setupEntity = setupService.selectSetup();
|
|
||||||
Integer day = setupEntity.getDlStockErpDay();
|
|
||||||
Map date = DateUtil.getDayRange(day);
|
|
||||||
Integer page = 1;
|
|
||||||
Integer limit = 20;
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
|
|
||||||
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("erp_order_query");
|
|
||||||
if (systemParamConfigEntity == null) {
|
|
||||||
logger.error("ERP出入库单据接口未定义");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
FilterOrderRequest filterOrderRequest = new FilterOrderRequest();
|
|
||||||
filterOrderRequest.setPage(page);
|
|
||||||
filterOrderRequest.setLimit(limit);
|
|
||||||
filterOrderRequest.setStartDate((String)date.get("startDate"));
|
|
||||||
filterOrderRequest.setEndDate((String)date.get("endDate"));
|
|
||||||
filterOrderRequest.setBillAction("PurchaseWareHouseIn");
|
|
||||||
List<ErpOrderEntity> erpOrderEntities = new ErpOrderClient(systemParamConfigEntity.getParamValue()).getErpOrder(filterOrderRequest);
|
|
||||||
List<ErpStockEntity> erpStockEntities = new ArrayList<>();
|
|
||||||
if (erpOrderEntities != null && erpOrderEntities.size() > 0) {
|
|
||||||
page++;
|
|
||||||
for (ErpOrderEntity erpOrderEntity : erpOrderEntities) {
|
|
||||||
//ERP数据更新
|
|
||||||
ErpStockEntity erpStockEntity = new ErpStockEntity();
|
|
||||||
erpStockEntity.setOrderId(erpOrderEntity.getErpOrderId());
|
|
||||||
erpStockEntity.setCode(erpOrderEntity.getGoodsid());
|
|
||||||
erpStockEntity.setBatchNo(erpOrderEntity.getBatchNo());
|
|
||||||
erpStockEntity.setExpirationDate(erpOrderEntity.getExpireDate());
|
|
||||||
erpStockEntity.setName(erpOrderEntity.getGoodsname());
|
|
||||||
erpStockEntity.setCount(erpOrderEntity.getCount() + "");
|
|
||||||
|
|
||||||
//本地数据更新
|
|
||||||
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(erpStockEntity.getCode());
|
|
||||||
if (udiRelevanceEntity != null) {
|
|
||||||
UdiInfoEntity udiInfoEntity = udiInfoService.findByUuid(udiRelevanceEntity.getUuid());
|
|
||||||
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
|
|
||||||
warehouseQueryRequest.setUdi(udiInfoEntity.getNameCode());
|
|
||||||
warehouseQueryRequest.setBatchNo(erpStockEntity.getBatchNo());
|
|
||||||
List<WarehouseEntity> warehouseEntities = warehouseService.findByOrderId(warehouseQueryRequest);
|
|
||||||
if (warehouseEntities != null && warehouseEntities.size() > 0) {
|
|
||||||
erpStockEntity.setManufacturingDate(warehouseEntities.get(0).getProduceDate());
|
|
||||||
erpStockEntity.setExpirationDate(warehouseEntities.get(0).getExpireDate());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
erpStockEntities.add(erpStockEntity);
|
|
||||||
erpStockService.insertErpStocks(erpStockEntities);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
||||||
|
|
||||||
<mapper namespace="com.glxp.api.admin.dao.info.SetupDao">
|
|
||||||
|
|
||||||
|
|
||||||
<select id="findSetup" parameterType="com.glxp.api.admin.req.info.FilterSetupRequest"
|
|
||||||
resultType="com.glxp.api.admin.entity.info.SetupEntity">
|
|
||||||
SELECT * FROM system_config WHERE id=#{id}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<update id="modifySetup" parameterType="com.glxp.api.admin.entity.info.SetupEntity">
|
|
||||||
|
|
||||||
UPDATE system_config
|
|
||||||
<set>
|
|
||||||
<if test="erpSaleOutModify != null">erpSaleOutModify=#{erpSaleOutModify},</if>
|
|
||||||
<if test="erpGetSaleOut != null">erpGetSaleOut=#{erpGetSaleOut},</if>
|
|
||||||
<if test="erpSaleOutSign != null">erpSaleOutSign=#{erpSaleOutSign},</if>
|
|
||||||
<if test="filterSaleOutSign != null">filterSaleOutSign=#{filterSaleOutSign},</if>
|
|
||||||
<if test="erpGetSaleOutDay != null">erpGetSaleOutDay=#{erpGetSaleOutDay},</if>
|
|
||||||
|
|
||||||
<if test="erpPruchaseModify != null">erpPruchaseModify=#{erpPruchaseModify},</if>
|
|
||||||
<if test="erpGetPurchaseIn != null">erpGetPurchaseIn=#{erpGetPurchaseIn},</if>
|
|
||||||
<if test="erpPruchaseSign != null">erpPruchaseSign=#{erpPruchaseSign},</if>
|
|
||||||
<if test="erpGetPurchaseDay != null">erpGetPurchaseDay=#{erpGetPurchaseDay},</if>
|
|
||||||
<if test="filterPurchaseSign != null">filterPurchaseSign=#{filterPurchaseSign},</if>
|
|
||||||
<if test="remark != null">remark=#{remark},</if>
|
|
||||||
<if test="forbidSameErp != null">forbidSameErp=#{forbidSameErp},</if>
|
|
||||||
<if test="returnWareHouseOut != null">returnWareHouseOut=#{returnWareHouseOut},</if>
|
|
||||||
<if test="salesWareHouseOut != null">salesWareHouseOut=#{salesWareHouseOut},</if>
|
|
||||||
<if test="returnWareHouseIn != null">returnWareHouseIn=#{returnWareHouseIn},</if>
|
|
||||||
<if test="updateErpData != null">updateErpData=#{updateErpData},</if>
|
|
||||||
<if test="dlStockErp != null">dlStockErp=#{dlStockErp},</if>
|
|
||||||
<if test="dlStockErpDay != null">dlStockErpDay=#{dlStockErpDay},</if>
|
|
||||||
</set>
|
|
||||||
WHERE id=#{id}
|
|
||||||
|
|
||||||
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<insert id="insertSetup" parameterType="com.glxp.api.admin.entity.info.SetupEntity">
|
|
||||||
insert INTO system_config(erpSaleOutModify,
|
|
||||||
erpGetSaleOut,erpSaleOutSign,filterSaleOutSign,erpGetSaleOutDay,erpPruchaseModify,
|
|
||||||
erpGetPurchaseIn,erpPruchaseSign,
|
|
||||||
erpGetPurchaseDay,filterPurchaseSign,remark,forbidSameErp,
|
|
||||||
returnWareHouseOut,salesWareHouseOut,returnWareHouseIn,updateErpData,dlStockErp,dlStockErpDay
|
|
||||||
) values
|
|
||||||
(
|
|
||||||
#{erpSaleOutModify},#{erpGetSaleOut}, #{erpSaleOutSign},
|
|
||||||
#{filterSaleOutSign}, #{erpGetSaleOutDay},#{erpPruchaseModify}, #{erpGetPurchaseIn},
|
|
||||||
#{erpPruchaseSign},
|
|
||||||
#{erpGetPurchaseDay}, #{filterPurchaseSign},
|
|
||||||
#{remark},#{forbidSameErp}
|
|
||||||
,#{returnWareHouseOut},#{salesWareHouseOut},#{returnWareHouseIn},#{updateErpData},#{dlStockErp},#{dlStockErpDay})
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
@ -1,71 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
||||||
|
|
||||||
<mapper namespace="com.glxp.api.admin.dao.inventory.InvErpStockDao">
|
|
||||||
|
|
||||||
|
|
||||||
<select id="findByCode" parameterType="Map"
|
|
||||||
resultType="com.glxp.api.admin.entity.basic.ErpStockEntity">
|
|
||||||
SELECT * FROM erpstock WHERE (
|
|
||||||
code = #{code} and batchNo = #{batchNo}) limit 1
|
|
||||||
</select>
|
|
||||||
<insert id="insertErpStock" keyProperty="id" parameterType="com.glxp.api.admin.entity.basic.ErpStockEntity">
|
|
||||||
replace INTO erpstock
|
|
||||||
(
|
|
||||||
orderId,code,batchNo,manufacturingDate,expirationDate,count,remark,name
|
|
||||||
)
|
|
||||||
values
|
|
||||||
(
|
|
||||||
#{orderId},
|
|
||||||
#{code},
|
|
||||||
#{batchNo},
|
|
||||||
#{manufacturingDate},
|
|
||||||
#{count},
|
|
||||||
#{remark},
|
|
||||||
#{name}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="insertErpStocks" keyProperty="id" parameterType="java.util.List">
|
|
||||||
replace INTO erpstock
|
|
||||||
(
|
|
||||||
orderId,code,batchNo,manufacturingDate,expirationDate,count,remark,name
|
|
||||||
)
|
|
||||||
values
|
|
||||||
|
|
||||||
<foreach collection="erpStockEntities" item="item" index="index"
|
|
||||||
separator=",">
|
|
||||||
(
|
|
||||||
#{item.orderId},
|
|
||||||
#{item.code},
|
|
||||||
#{item.batchNo},
|
|
||||||
#{item.manufacturingDate},
|
|
||||||
#{item.expirationDate},
|
|
||||||
#{item.count},
|
|
||||||
#{item.remark},
|
|
||||||
#{item.name}
|
|
||||||
)
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<delete id="deleteById" parameterType="Map">
|
|
||||||
DELETE FROM erpstock WHERE id = #{id}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<update id="updateErpStock" parameterType="com.glxp.api.admin.entity.basic.ErpStockEntity">
|
|
||||||
UPDATE erpstock
|
|
||||||
<set>
|
|
||||||
<if test="orderId != null">orderId=#{orderId},</if>
|
|
||||||
<if test="code != null">code=#{code},</if>
|
|
||||||
<if test="batchNo != null">batchNo=#{batchNo},</if>
|
|
||||||
<if test="manufacturingDate != null">manufacturingDate=#{manufacturingDate},</if>
|
|
||||||
<if test="expirationDate != null">expirationDate=#{expirationDate},</if>
|
|
||||||
<if test="count != null">count=#{count},</if>
|
|
||||||
<if test="remark != null">remark=#{remark},</if>
|
|
||||||
<if test="name != null">name=#{name},</if>
|
|
||||||
</set>
|
|
||||||
WHERE id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue