代码备份(基础信息转json)

version1
anthonyywj2 3 years ago
parent c95a3ccf7b
commit 5e43d9f6fa

@ -67,22 +67,22 @@ public class IOOrderStatusController {
return ResultVOUtils.success(dlOrderResponses);
}
//更新订单
@PostMapping("/spms/inout/order/deleteStatus")
public BaseResponse deleteStatus(@RequestBody OrderStatusFilterRequest orderStatusFilterRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
boolean b = ioOrderStatusService.deleteByOrderId(orderStatusFilterRequest.getOrderId());
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
return ResultVOUtils.success("更新成功");
}
// //更新订单
// @PostMapping("/spms/inout/order/deleteStatus")
// public BaseResponse deleteStatus(@RequestBody OrderStatusFilterRequest orderStatusFilterRequest,
// BindingResult bindingResult) {
//
// if (bindingResult.hasErrors()) {
// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
// }
// boolean b = ioOrderStatusService.deleteByOrderId(orderStatusFilterRequest.getOrderId());
// if (!b) {
// return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
// }
// return ResultVOUtils.success("更新成功");
// }
@PostMapping("/spms/inout/order/updateStatus")
@PostMapping("/spms/inout/order/deleteStatus")
public BaseResponse updateStatus(@RequestBody IOOrderStatusEntity orderStatusFilterRequest,
BindingResult bindingResult) {

@ -2,15 +2,19 @@ package com.glxp.sale.admin.controller.sync;
import com.github.pagehelper.PageInfo;
import com.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
import com.glxp.sale.admin.entity.sync.UdiInfoEntity;
import com.glxp.sale.admin.entity.sync.UdiInfoImportDetailEntity;
import com.glxp.sale.admin.entity.sync.UdiInfoImportLogEntity;
import com.glxp.sale.admin.entity.sync.UdiRelevanceEntity;
import com.glxp.sale.admin.http.PostSmpHttp;
import com.glxp.sale.admin.req.info.DeleteRequest;
import com.glxp.sale.admin.req.sync.FilterUdiInfoRequest;
import com.glxp.sale.admin.req.sync.FilterUdiIpLogRequest;
import com.glxp.sale.admin.req.sync.PostUdiInfoRequest;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.sync.UdiRelevanceExportJsonResponse;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.service.sync.UdiInfoImportDetailService;
import com.glxp.sale.admin.service.sync.UdiInfoImportLogService;
@ -119,43 +123,43 @@ public class UdiInfoImportLogController {
return ResultVOUtils.error(500, "删除成功");
}
//产品信息接口上传
//UDI管理系统产品信息接口上传
@PostMapping("/udiwms/basic/products/upload")
public BaseResponse postUdiInfo(@RequestBody PostUdiInfoRequest postUdiInfoRequest, BindingResult bindingResult) {
public BaseResponse postUdiInfo(@RequestBody UdiRelevanceExportJsonResponse postUdiInfoRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String value = systemParamConfigService.selectValueByParamKey("enable_direct");
if ("1".equals(value)) {
return postSmpHttp.postUdiInfo(postUdiInfoRequest);
postSmpHttp.postUdiInfo(postUdiInfoRequest);
return ResultVOUtils.error(500, "稍等片刻!");
} else {
String genKey = postUdiInfoRequest.getGenKey();
if (genKey == null) {
genKey = CustomUtil.getId();
}
String genKey = CustomUtil.getId();
UdiInfoImportLogEntity udiInfoImportLogEntity = udiInfoImportLogService.selectByGenKey(genKey);
List<UdiInfoImportDetailEntity> udiInfoImportEntities = postUdiInfoRequest.getDatas();
if (udiInfoImportEntities != null) {
for (UdiInfoImportDetailEntity udiInfoImportEntity : udiInfoImportEntities) {
udiInfoImportEntity.setGenKeyFk(genKey);
udiInfoImportEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
udiInfoImportEntity.setUpdateTime(new java.util.Date());
udiInfoImportService.insertUdiInfoImport(udiInfoImportEntity);
if (postUdiInfoRequest.getUdiInfoEntities() != null) {
for (UdiInfoEntity udiInfoEntity : postUdiInfoRequest.getUdiInfoEntities()) {
udiInfoEntity.setGenKeyFk(genKey);
}
}
if (udiInfoImportLogEntity == null) {
udiInfoImportLogEntity = new UdiInfoImportLogEntity();
udiInfoImportLogEntity.setGenKey(genKey);
udiInfoImportLogEntity.setDataType(BasicProcessStatus.DATA_TYPE_UDI);
udiInfoImportLogEntity.setFromType("接口上传");
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
udiInfoImportLogService.insertImportLog(udiInfoImportLogEntity);
} else {
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity);
if (postUdiInfoRequest.getCompanyProductRelevanceEntities() != null) {
for (CompanyProductRelevanceEntity udiInfoEntity : postUdiInfoRequest.getCompanyProductRelevanceEntities()) {
udiInfoEntity.setGenKeyFk(genKey);
}
}
if (postUdiInfoRequest.getUdiRelevanceEntities() != null) {
for (UdiRelevanceEntity udiInfoEntity : postUdiInfoRequest.getUdiRelevanceEntities()) {
udiInfoEntity.setGenKeyFk(genKey);
}
}
udiInfoImportLogEntity = new UdiInfoImportLogEntity();
udiInfoImportLogEntity.setGenKey(genKey);
udiInfoImportLogEntity.setDataType(BasicProcessStatus.DATA_TYPE_UDI);
udiInfoImportLogEntity.setFromType("接口上传");
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
udiInfoImportLogService.insertImportLog(udiInfoImportLogEntity);
udiInfoImportService.importJsonData(postUdiInfoRequest, genKey);
return ResultVOUtils.success("上传成功");
}
@ -163,29 +167,33 @@ public class UdiInfoImportLogController {
}
//产品信息接口上传
//供应商自助平台产品信息接口上传
@PostMapping("/spms/basic/products/upload")
public BaseResponse uploadUdiInfo(@RequestBody PostUdiInfoRequest postUdiInfoRequest, BindingResult bindingResult) {
public BaseResponse uploadUdiInfo(@RequestBody UdiRelevanceExportJsonResponse postUdiInfoRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
String value = systemParamConfigService.selectValueByParamKey("enable_direct");
if ("1".equals(value)) {
return postSmpHttp.postUdiInfo(postUdiInfoRequest);
// postSmpHttp.postUdiInfo(postUdiInfoRequest);
return ResultVOUtils.error(500, "稍等片刻!");
} else {
String genKey = postUdiInfoRequest.getGenKey();
if (genKey == null) {
genKey = CustomUtil.getId();
}
String genKey = CustomUtil.getId();
UdiInfoImportLogEntity udiInfoImportLogEntity = udiInfoImportLogService.selectByGenKey(genKey);
List<UdiInfoImportDetailEntity> udiInfoImportEntities = postUdiInfoRequest.getDatas();
if (udiInfoImportEntities != null) {
for (UdiInfoImportDetailEntity udiInfoImportEntity : udiInfoImportEntities) {
udiInfoImportEntity.setGenKeyFk(genKey);
udiInfoImportEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS);
udiInfoImportEntity.setUpdateTime(new java.util.Date());
udiInfoImportService.insertUdiInfoImport(udiInfoImportEntity);
if (postUdiInfoRequest.getUdiInfoEntities() != null) {
for (UdiInfoEntity udiInfoEntity : postUdiInfoRequest.getUdiInfoEntities()) {
udiInfoEntity.setGenKeyFk(genKey);
}
}
if (postUdiInfoRequest.getCompanyProductRelevanceEntities() != null) {
for (CompanyProductRelevanceEntity udiInfoEntity : postUdiInfoRequest.getCompanyProductRelevanceEntities()) {
udiInfoEntity.setGenKeyFk(genKey);
}
}
if (postUdiInfoRequest.getUdiRelevanceEntities() != null) {
for (UdiRelevanceEntity udiInfoEntity : postUdiInfoRequest.getUdiRelevanceEntities()) {
udiInfoEntity.setGenKeyFk(genKey);
}
}
if (udiInfoImportLogEntity == null) {
@ -196,6 +204,7 @@ public class UdiInfoImportLogController {
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
udiInfoImportLogService.insertImportLog(udiInfoImportLogEntity);
udiInfoImportService.importJsonData(postUdiInfoRequest, genKey);
} else {
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity);

@ -7,8 +7,10 @@ import com.glxp.sale.admin.http.PostSmpHttp;
import com.glxp.sale.admin.req.sync.*;
import com.glxp.sale.admin.res.sync.ErpOrderResponse;
import com.glxp.sale.admin.res.sync.ErpProductsResponse;
import com.glxp.sale.admin.res.sync.UdiRelevanceExportJsonResponse;
import com.glxp.sale.admin.service.param.SystemParamConfigService;
import com.glxp.sale.admin.service.sync.*;
import com.glxp.sale.admin.thread.BasicGenExcelService;
import com.glxp.sale.common.enums.ResultEnum;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
@ -54,6 +56,8 @@ public class UdiwmsPostDirectController {
ThrProductsImportLogService thrProductsImportLogService;
@Resource
ThrProductsImportDetailService thrProductsImportDetailService;
@Resource
BasicGenExcelService basicGenExcelService;
@PostMapping("/udisp/sync/postUdiInfo")
public BaseResponse postUdiInfo(@RequestBody PostUdiInfoRequest postUdiInfoRequest,
@ -64,10 +68,8 @@ public class UdiwmsPostDirectController {
}
FilterUdiIpLogRequest filterUdiIpLogRequest = new FilterUdiIpLogRequest();
filterUdiIpLogRequest.setGenKey(postUdiInfoRequest.getGenKey());
List<UdiInfoImportDetailEntity> udiInfoImportDetailEntityList = udiInfoImportDetailService.filterUdiInfoImport(filterUdiIpLogRequest);
PostUdiInfoRequest postUdiInfoRequest1 = new PostUdiInfoRequest();
postUdiInfoRequest1.setDatas(udiInfoImportDetailEntityList);
BaseResponse baseResponse = postSmpHttp.postUdiInfo(postUdiInfoRequest1);
UdiRelevanceExportJsonResponse udiRelevanceExportJsonResponse = basicGenExcelService.exportJsonUdiInfo(postUdiInfoRequest.getGenKey());
BaseResponse baseResponse = postSmpHttp.postUdiInfo(udiRelevanceExportJsonResponse);
UdiInfoImportLogEntity udiInfoImportLogEntity = udiInfoImportLogService.selectByGenKey(postUdiInfoRequest.getGenKey());
if (baseResponse.getCode() == 20000) {
udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);

@ -0,0 +1,42 @@
package com.glxp.sale.admin.dao.sync;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.sync.UdiRelevanceEntity;
import com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest;
import com.glxp.sale.admin.req.sync.CompanyProductRelevanceRequest;
import com.glxp.sale.admin.res.sync.CompanyProductRelevanceResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface CompanyProductRelevanceDao {
List<CompanyProductRelevanceResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest);
List<CompanyProductRelevanceEntity> filterCompanyProductRelevance(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest);
CompanyProductRelevanceEntity findCompanyProductRelevance(Long CustomerId);
CompanyProductRelevanceEntity findCompanyProductRelevanceByProductId(String productId);
CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(@Param("udiRlIdFk") String udiRlIdFk, @Param("customerId") String customerId);
CompanyProductRelevanceEntity findCompanyProductRelevanceByProductUuid(CompanyProductRelevanceEntity companyProductRelevanceEntity);
List<CompanyProductRelevanceEntity> getCompanyProductRelevance(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest);
boolean updateCompanyProductRelevance(CompanyProductRelevanceEntity companyCertEntity);
boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyCertEntity);
boolean deleteById(String id);
boolean deleteByRlId(String id);
void importComapnyUdiRelevance(@Param("udiRelevanceEntities") List<UdiRelevanceEntity> udiRelevanceEntities);
}

@ -0,0 +1,51 @@
package com.glxp.sale.admin.dao.sync;
import com.glxp.sale.admin.entity.sync.UdiInfoEntity;
import com.glxp.sale.admin.req.sync.FilterUdiInfoRequest;
import com.glxp.sale.admin.res.sync.UdiRelevanceResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface UdiInfoDao {
List<UdiInfoEntity> filterUdiInfo(FilterUdiInfoRequest filterUdiInfoRequest);
List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiInfoRequest filterUdiInfoRequest);
UdiInfoEntity findByNameCode(@Param("nameCode") String nameCode);
UdiInfoEntity findById(@Param("id") String id);
UdiInfoEntity findByUuid(@Param("uuid") String uuid);
List<UdiInfoEntity> findByUuids(@Param("uuid") String uuid);
boolean insertUdiInfo(UdiInfoEntity udiInfoEntity);
boolean insertUdiInfos(@Param("udiInfoEntities") List<UdiInfoEntity> udiInfoEntities);
boolean updateUdiInfo(UdiInfoEntity udiInfoEntity);
boolean deleteById(@Param("id") String id);
boolean deleteByUuid(@Param("uuid") String uuid);
/**
* UUID
*
* @param uuids
* @return
*/
List<UdiInfoEntity> batchSelectByUuid(@Param("uuids") List<String> uuids);
/**
*
*
* @param udiInfoEntities
*/
void importUdiInfo(@Param("udiInfoEntities") List<UdiInfoEntity> udiInfoEntities);
}

@ -0,0 +1,53 @@
package com.glxp.sale.admin.dao.sync;
import com.glxp.sale.admin.entity.sync.UdiRelevanceEntity;
import com.glxp.sale.admin.req.sync.FilterUdiInfoRequest;
import com.glxp.sale.admin.res.sync.UdiRelevanceResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface UdiRelevanceDao {
List<UdiRelevanceResponse> filterUdiRelevance(FilterUdiInfoRequest filterUdiInfoRequest);
List<UdiRelevanceResponse> filterUdiGp(FilterUdiInfoRequest filterUdiInfoRequest);
// UdiRelevanceResponse selectUdiByUUid
List<UdiRelevanceEntity> selectByUuid(@Param("uuid") String uuid);
UdiRelevanceEntity selectById(@Param("id") String id);
UdiRelevanceEntity selectByThirdId(FilterUdiInfoRequest filterUdiInfoRequest);
List<UdiRelevanceEntity> filterEntity(FilterUdiInfoRequest filterUdiInfoRequest);
boolean insertUdiRelevance(UdiRelevanceEntity udiRelevanceEntity);
boolean updateUdiRelevance(UdiRelevanceEntity udiRelevanceEntity);
boolean deleteById(@Param("id") String id);
boolean deleteByIds(@Param("ids") List<String> id);
boolean deleteByUuid(@Param("uuid") String uuid);
/**
* UUID
*
* @param uuids
* @return
*/
List<UdiRelevanceEntity> batchSelectByUuid(@Param("uuids") List<String> uuids);
/**
*
*
* @param udiRelevanceEntities
*/
void importUdiRelevance(@Param("udiRelevanceEntities") List<UdiRelevanceEntity> udiRelevanceEntities);
}

@ -19,5 +19,6 @@ public class CompanyProductRelevanceEntity {
private String auditStatus;
private String productUuid;
private Integer udiRlIdFk;
private String genKeyFk;
private Integer gid;
}

@ -0,0 +1,15 @@
package com.glxp.sale.admin.entity.sync;
import lombok.Data;
@Data
public class BasicThirdSysEntity {
private String id;
private String thirdId;
private String thirdName;
private Boolean enabled;
private String remark;
private String guideUrl;
private String thridUrl;
private Boolean mainSys;
}

@ -0,0 +1,398 @@
package com.glxp.sale.admin.entity.sync;
import lombok.Data;
@Data
public class UdiInfoEntity {
private Integer id;
private String nameCode;
private String packRatio;
private String packLevel;
private Integer bhxjsl;
private Integer bhzxxsbzsl;
private Integer zxxsbzbhsydysl;
private String bhxjcpbm;
private String sjcpbm; //
private String bzcj;
private String addType;
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 ylqxzcrbarywmc;
private String sydycpbs;
private String uuid;
private int versionNumber;
private int diType;
private String thirdId;
private String thirdName;
private String ybbm;
private String sptm;
private String manufactory;
private String measname;
private Integer productType;
private Integer gid;
//本地生成信息
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
private String udi;
private String code;
private Integer count;
private String warehouseCode;
private String udplatCode;
private String relId;//关联ID主键
private Integer status;
private String supId;
private Boolean isCheck;
private String genKeyFk;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNameCode() {
return nameCode;
}
public void setNameCode(String nameCode) {
this.nameCode = nameCode;
}
public String getPackRatio() {
return packRatio;
}
public void setPackRatio(String packRatio) {
this.packRatio = packRatio;
}
public String getPackLevel() {
return packLevel;
}
public void setPackLevel(String packLevel) {
this.packLevel = packLevel;
}
public Integer getBhxjsl() {
if (bhxjsl == null || bhxjsl == 0) {
return 1;
}
return bhxjsl;
}
public void setBhxjsl(Integer bhxjsl) {
this.bhxjsl = bhxjsl;
}
public Integer getBhzxxsbzsl() {
if (bhzxxsbzsl == null || bhzxxsbzsl == 0) {
return 1;
}
return bhzxxsbzsl;
}
public String getSptm() {
return sptm;
}
public void setSptm(String sptm) {
this.sptm = sptm;
}
public String getManufactory() {
return manufactory;
}
public void setManufactory(String manufactory) {
this.manufactory = manufactory;
}
public String getMeasname() {
return measname;
}
public void setMeasname(String measname) {
this.measname = measname;
}
public void setBhzxxsbzsl(Integer bhzxxsbzsl) {
this.bhzxxsbzsl = bhzxxsbzsl;
}
public Integer getZxxsbzbhsydysl() {
if (zxxsbzbhsydysl == null || zxxsbzbhsydysl == 0) {
return 1;
}
return zxxsbzbhsydysl;
}
public void setZxxsbzbhsydysl(Integer zxxsbzbhsydysl) {
this.zxxsbzbhsydysl = zxxsbzbhsydysl;
}
public String getBhxjcpbm() {
return bhxjcpbm;
}
public void setBhxjcpbm(String bhxjcpbm) {
this.bhxjcpbm = bhxjcpbm;
}
public String getSjcpbm() {
return sjcpbm;
}
public void setSjcpbm(String sjcpbm) {
this.sjcpbm = sjcpbm;
}
public String getBzcj() {
return bzcj;
}
public void setBzcj(String bzcj) {
this.bzcj = bzcj;
}
public String getAddType() {
return addType;
}
public void setAddType(String addType) {
this.addType = addType;
}
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 getYlqxzcrbarywmc() {
return ylqxzcrbarywmc;
}
public void setYlqxzcrbarywmc(String ylqxzcrbarywmc) {
this.ylqxzcrbarywmc = ylqxzcrbarywmc;
}
public String getSydycpbs() {
return sydycpbs;
}
public void setSydycpbs(String sydycpbs) {
this.sydycpbs = sydycpbs;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
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 getThirdId() {
return thirdId;
}
public void setThirdId(String thirdId) {
this.thirdId = thirdId;
}
public String getThirdName() {
return thirdName;
}
public void setThirdName(String thirdName) {
this.thirdName = thirdName;
}
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public String getProduceDate() {
return produceDate;
}
public void setProduceDate(String produceDate) {
this.produceDate = produceDate;
}
public String getExpireDate() {
return expireDate;
}
public void setExpireDate(String expireDate) {
this.expireDate = expireDate;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
public String getUdi() {
return udi;
}
public void setUdi(String udi) {
this.udi = udi;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Integer getCount() {
if (count == null)
return 1;
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public String getWarehouseCode() {
return warehouseCode;
}
public void setWarehouseCode(String warehouseCode) {
this.warehouseCode = warehouseCode;
}
public String getYbbm() {
return ybbm;
}
public void setYbbm(String ybbm) {
this.ybbm = ybbm;
}
public Boolean getCheck() {
return isCheck;
}
public void setCheck(Boolean check) {
isCheck = check;
}
public Integer getProductType() {
return productType;
}
public void setProductType(Integer productType) {
this.productType = productType;
}
}

@ -0,0 +1,41 @@
package com.glxp.sale.admin.entity.sync;
import lombok.Data;
@Data
public class UdiRelevanceEntity {
private String id;
private String thirdId;
private String thirdName;
private String uuid;
private Boolean isUseDy;
private String updateTime;
private String thirdId1;
private String thirdId2;
private String thirdId3;
private String thirdId4;
private String thirdName1;
private String thirdName2;
private String thirdName3;
private String thirdName4;
private String manufactory;
private String measname;
private String ybbm;
private String sptm;
private Boolean isDisable;
private Boolean isLock;
private String mainId;
private String mainName;
private Integer lockStatus;
private String udplatCode;
private Boolean isAdavence;
private String genKeyFk;
private Integer gid;
public Integer getLockStatus() {
if (lockStatus == null)
return 1;
return lockStatus;
}
}

@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.glxp.sale.admin.req.sync.*;
import com.glxp.sale.admin.res.PageSimpleResponse;
import com.glxp.sale.admin.res.sync.UdiRelevanceExportJsonResponse;
import com.glxp.sale.admin.res.sync.UdiRelevanceResponse;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@ -18,9 +20,23 @@ public class PostSmpHttp {
@Value("${SPMS_IP}")
private String spmsUrl;
@Value("${API_KEY}")
private String apiKey;
@Value("${API_SECRET}")
private String apiSecret;
public HttpHeaders getHeaders() {
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
headers.add("api_key", apiKey);
headers.add("secret_key", apiSecret);
return headers;
}
public BaseResponse<String> postOrder(PostThrOrderRequest postThrOrderRequest) {
String result = UHttpClient.postJson(spmsUrl+"/udiwms/thrsys/postOrderDetail", postThrOrderRequest);
String result = UHttpClient.postJson(spmsUrl + "/udiwms/thrsys/postOrderDetail", postThrOrderRequest, getHeaders());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -28,8 +44,8 @@ public class PostSmpHttp {
}
public BaseResponse<String> postUdiInfo(PostUdiInfoRequest postUdiInfoRequest) {
String result = UHttpClient.postJson(spmsUrl+"/udiwms/basic/products/upload", postUdiInfoRequest);
public BaseResponse<String> postUdiInfo(UdiRelevanceExportJsonResponse udiRelevanceExportJsonResponse) {
String result = UHttpClient.postJson(spmsUrl + "/udiwms/basic/products/sync/upload", udiRelevanceExportJsonResponse, getHeaders());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
@ -39,7 +55,7 @@ public class PostSmpHttp {
public BaseResponse<String> postThrProducts(PostThrProductsRequest postThrProductsRequest) {
String result = UHttpClient.postJson(spmsUrl+"/udiwms/thrsys/postThrProducts", postThrProductsRequest);
String result = UHttpClient.postJson(spmsUrl + "/udiwms/thrsys/postThrProducts", postThrProductsRequest, getHeaders());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -48,8 +64,7 @@ public class PostSmpHttp {
public BaseResponse<String> postCorp(PostCorpsRequest postCorpsRequest) {
String result = UHttpClient.postJson(spmsUrl+"/udiwms/basic/corps/upload", postCorpsRequest);
String result = UHttpClient.postJson(spmsUrl + "/udiwms/basic/corps/upload", postCorpsRequest, getHeaders());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -61,7 +76,7 @@ public class PostSmpHttp {
paramMap.put("page", filterUdiInfoRequest.getPage());
paramMap.put("limit", filterUdiInfoRequest.getLimit());
paramMap.put("lastUpdateTime", filterUdiInfoRequest.getLastUpdateTime());
String response = UHttpClient.mipsGet(spmsUrl + "/udiwms/basic/products/download", paramMap);
String response = UHttpClient.mipsGetHead(spmsUrl + "/udiwms/basic/products/download", paramMap, getHeaders());
try {
BaseResponse<PageSimpleResponse<UdiRelevanceResponse>> udiDlDeviceResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<UdiRelevanceResponse>>>() {

@ -12,6 +12,7 @@ import com.glxp.sale.admin.res.sync.UdiRelevanceResponse;
import com.glxp.sale.common.res.BaseResponse;
import com.glxp.sale.common.util.ResultVOUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@ -23,10 +24,23 @@ public class SpGetHttp {
@Value("${SPMS_IP}")
private String spmsUrl;
@Value("${API_KEY}")
private String apiKey;
@Value("${API_SECRET}")
private String apiSecret;
public HttpHeaders getHeaders() {
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
headers.add("api_key", apiKey);
headers.add("secret_key", apiSecret);
return headers;
}
public BaseResponse<PageSimpleResponse<IOOrderStatusEntity>> getOrderStatus() {
Map<String, Object> paramMap = new HashMap<>(16);
String response = UHttpClient.mipsGet(spmsUrl + "/spms/inout/order/status", paramMap);
String response = UHttpClient.mipsGetHead(spmsUrl + "/spms/inout/order/status", paramMap, getHeaders());
try {
BaseResponse<PageSimpleResponse<IOOrderStatusEntity>> data =
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<IOOrderStatusEntity>>>() {
@ -43,7 +57,7 @@ public class SpGetHttp {
public BaseResponse<List<DlOrderResponse>> getOrders(String orderId) {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("status", 1);
String response = UHttpClient.mipsGet(spmsUrl + "/spms/inout/order/dlByStatus", paramMap);
String response = UHttpClient.mipsGetHead(spmsUrl + "/spms/inout/order/dlByStatus", paramMap, getHeaders());
try {
BaseResponse<List<DlOrderResponse>> data =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<DlOrderResponse>>>() {
@ -59,7 +73,8 @@ public class SpGetHttp {
public BaseResponse<String> postOrder(String orderId) {
OrderStatusFilterRequest orderStatusFilterRequest = new OrderStatusFilterRequest();
orderStatusFilterRequest.setOrderId(orderId);
String result = UHttpClient.postJson(spmsUrl + "/spms/inout/order/deleteStatus", orderStatusFilterRequest);
orderStatusFilterRequest.setStatus(2);
String result = UHttpClient.postJson(spmsUrl + "/spms/inout/order/deleteStatus", orderStatusFilterRequest, getHeaders());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});

@ -5,6 +5,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
@ -52,6 +54,19 @@ public class UHttpClient {
return response;
}
public static String postJson(String url, Object object, HttpHeaders headers) {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setConnectTimeout(600000);
factory.setReadTimeout(20000);
RestTemplate restTemplate = new RestTemplate(factory);
String json = JSONObject.toJSON(object).toString();
logger.info(url + "\n" + json);
HttpEntity<String> httpEntity = new HttpEntity<>(json, headers);
String response = restTemplate.postForObject(url, httpEntity, String.class);
logger.info(response);
return response;
}
public static String mipsGet(String url, Map params) {
StringBuffer stringBuffer = new StringBuffer(url);
if (params instanceof Map) {
@ -94,4 +109,43 @@ public class UHttpClient {
String response = restTemplate.getForObject(accessTokenRequestUrl, String.class);
return response;
}
public static String mipsGetHead(String url, Map params, HttpHeaders headers) {
headers.add("Content-Type", "application/json");
if(params!=null){
StringBuffer stringBuffer = new StringBuffer(url);
if (params instanceof Map) {
Iterator iterator = ((Map) params).entrySet().iterator();
if (iterator.hasNext()) {
stringBuffer.append("?");
Object element;
while (iterator.hasNext()) {
element = iterator.next();
Map.Entry<String, Object> entry = (Map.Entry) element;
if (entry.getValue() != null) {
stringBuffer.append(element).append("&");
}
url = stringBuffer.substring(0, stringBuffer.length() - 1);
}
}
} else {
throw new RuntimeException("url请求:" + url + "请求参数有误不是map类型");
}
}
RestTemplate restTemplate = new RestTemplate();
String accessTokenRequestUrl = url;//"http://127.0.0.1:9997/mips/druginfo/list";
logger.info(accessTokenRequestUrl);
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(headers), String.class);
// String response = restTemplate.getForObject(accessTokenRequestUrl, String.class, new HttpEntity<String>(headers));
return response.getBody();
}
}

@ -6,7 +6,11 @@ import lombok.Data;
@Data
public class FilterCompanyProductRelevanceRequest extends ListPageRequest {
private Long customerId;
private Long productId;
private String productUuid;
private String udiRlIdFk;
private String unitFk;
private String genKeyFk;
}

@ -0,0 +1,50 @@
package com.glxp.sale.admin.req.sync;
import com.glxp.sale.admin.req.ListPageRequest;
import lombok.Data;
@Data
public class CompanyProductRelevanceRequest extends ListPageRequest {
private String ylqxzcrbarmc;
private String cpmctymc;
private String nameCode;
private String uuid;
private String ggxh;
private String thirdId;
private String id;
private String thirdId1;
private String thirdId2;
private String thirdId3;
private String thirdId4;
private String thirdCode;
private String thirdSys;
private String lastUpdateTime;
private String zczbhhzbapzbh;
private Integer diType;
private String unionCode;
private String udiCode;
private String thrPiId;
private Boolean isCheck;
private Integer filterType; //0:全部1.对照完成2.未对照DI3.未对照产品编码4.未对照其他产品编码
private String customerId;
private String auditStatus;
private String companyName;
private Integer lockStatus;
private Boolean isAdavence;
private String unitFk;
private String corpId;
private String billType;
}

@ -0,0 +1,14 @@
package com.glxp.sale.admin.req.sync;
import com.glxp.sale.admin.req.ListPageRequest;
import lombok.Data;
@Data
public class FilterBasicThirdSysRequest extends ListPageRequest {
private String thirdId;
private String thirdName;
private Boolean enabled;
private Boolean mainSys;
}

@ -37,7 +37,7 @@ public class FilterUdiInfoRequest extends ListPageRequest {
private Integer filterType; //0:全部1.对照完成2.未对照DI3.未对照产品编码4.未对照其他产品编码
private Integer dataType;
private String genKeyFk;
private String customerId;

@ -0,0 +1,61 @@
package com.glxp.sale.admin.res.sync;
import lombok.Data;
@Data
public class CompanyProductRelevanceResponse {
private int id;
private Integer rlId;
private String thirdId;
private String thirdName;
private String uuid;
private String nameCode;
private String packLevel;
private String packRatio;
private Integer bhxjsl;
private Integer bhzxxsbzsl;
private Integer zxxsbzbhsydysl;
private String bhxjcpbm;
private String sjcpbm; //
private String bzcj;
private String deviceRecordKey;
private int isUseDy;
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 ylqxzcrbarywmc;
private String sydycpbs;
private int versionNumber;
private int diType;
private String thirdId1;
private String thirdId2;
private String thirdId3;
private String thirdId4;
private String thirdName1;
private String thirdName2;
private String thirdName3;
private String thirdName4;
private String ybbm;
private String sptm;
private String manufactory;
private String measname;
private long customerId;
private String auditStatus;
private Boolean isLock;
private Integer lockStatus;
private String companyName;
private String mainId;
private String mainName;
private Boolean isAdavence;
}

@ -0,0 +1,28 @@
package com.glxp.sale.admin.res.sync;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.sync.UdiInfoEntity;
import com.glxp.sale.admin.entity.sync.UdiRelevanceEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
*
*/
@Data
public class UdiRelevanceExportJsonResponse {
List<UdiInfoEntity> udiInfoEntities;
List<UdiRelevanceEntity> udiRelevanceEntities;
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities;
public UdiRelevanceExportJsonResponse() {
this.udiInfoEntities = new ArrayList<>();
this.udiRelevanceEntities = new ArrayList<>();
this.companyProductRelevanceEntities = new ArrayList<>();
}
}

@ -0,0 +1,36 @@
package com.glxp.sale.admin.service.sync;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest;
import com.glxp.sale.admin.req.sync.CompanyProductRelevanceRequest;
import com.glxp.sale.admin.res.sync.CompanyProductRelevanceResponse;
import java.util.List;
public interface CompanyProductRelevanceService {
List<CompanyProductRelevanceResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest);
List<CompanyProductRelevanceEntity> filterCompanyProductRelevance(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest);
CompanyProductRelevanceEntity findCompanyProductRelevance(Long CustomerId);
CompanyProductRelevanceEntity findCompanyProductRelevanceByProductId(String productId);
CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(String udiRlIdFk, String customerId);
CompanyProductRelevanceEntity findByUdiRlIdUnitFk(String udiRlIdFk, String unitFk);
CompanyProductRelevanceEntity findCompanyProductRelevanceByProductUuid(CompanyProductRelevanceEntity companyProductRelevanceEntity);
List<CompanyProductRelevanceEntity> getCompanyProductRelevance(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest);
boolean updateCompanyProductRelevance(CompanyProductRelevanceEntity companyCertEntity);
boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyCertEntity);
boolean deleteById(String id);
boolean deleteByRlId(String id);
}

@ -1,9 +1,10 @@
package com.glxp.sale.admin.service.sync;
import com.glxp.sale.admin.entity.sync.UdiInfoImportDetailEntity;
import com.glxp.sale.admin.req.sync.FilterUdiIpLogRequest;
import com.glxp.sale.admin.res.sync.UdiRelevanceExportJsonResponse;
import org.springframework.scheduling.annotation.Async;
import java.util.List;
@ -22,4 +23,8 @@ public interface UdiInfoImportDetailService {
boolean deleteById(String id);
boolean deleteByGenkey(String genKey);
@Async
void importJsonData(UdiRelevanceExportJsonResponse udiRelevanceExportJsonResponse,String genKey);
}

@ -0,0 +1,37 @@
package com.glxp.sale.admin.service.sync;
import com.glxp.sale.admin.entity.sync.UdiInfoEntity;
import com.glxp.sale.admin.req.sync.FilterUdiInfoRequest;
import com.glxp.sale.admin.res.sync.UdiRelevanceResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface UdiInfoService {
List<UdiInfoEntity> filterUdiInfo(FilterUdiInfoRequest filterUdiInfoRequest);
List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiInfoRequest filterUdiInfoRequest);
List<UdiInfoEntity> filterAllUdiInfo(FilterUdiInfoRequest filterUdiInfoRequest);
UdiInfoEntity findByNameCode(String nameCode);
UdiInfoEntity findById(@Param("id") String id);
UdiInfoEntity findByUuid(String uuid);
List<UdiInfoEntity> findByUuids(String uuid);
boolean insertUdiInfo(UdiInfoEntity udiInfoEntity);
boolean insertUdiInfos(List<UdiInfoEntity> udiInfoEntities);
boolean updateUdiInfo(UdiInfoEntity udiInfoEntity);
boolean deleteById(String id);
boolean deleteByUuid(String uuid);
}

@ -0,0 +1,42 @@
package com.glxp.sale.admin.service.sync;
import com.glxp.sale.admin.entity.sync.UdiRelevanceEntity;
import com.glxp.sale.admin.req.sync.FilterUdiInfoRequest;
import com.glxp.sale.admin.res.sync.UdiRelevanceResponse;
import java.util.List;
public interface UdiRelevanceService {
List<UdiRelevanceResponse> filterUdiRelevance(FilterUdiInfoRequest filterUdiInfoRequest);
List<UdiRelevanceEntity> filterUdiEntity(FilterUdiInfoRequest filterUdiInfoRequest);
UdiRelevanceResponse selectByNameCode(String nameCode);
List<UdiRelevanceResponse> selectAllByNameCode(String nameCode);
boolean isExit();
List<UdiRelevanceResponse> filterUdiGp(FilterUdiInfoRequest filterUdiInfoRequest);
boolean isExitByUuid(String uuid);
List<UdiRelevanceEntity> selectByUuid(String uuid);
UdiRelevanceEntity selectById(String id);
UdiRelevanceResponse selectGroupById(String id);
boolean insertUdiRelevance(UdiRelevanceEntity udiRelevanceEntity);
boolean deleteById(String id);
boolean deleteByIds(List<String> id);
boolean deleteByUuid(String uuid);
}

@ -0,0 +1,110 @@
package com.glxp.sale.admin.service.sync.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.dao.sync.CompanyProductRelevanceDao;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest;
import com.glxp.sale.admin.req.sync.CompanyProductRelevanceRequest;
import com.glxp.sale.admin.res.sync.CompanyProductRelevanceResponse;
import com.glxp.sale.admin.service.sync.CompanyProductRelevanceService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class CompanyProductRelevanceServiceImpl implements CompanyProductRelevanceService {
@Resource
CompanyProductRelevanceDao companyProductRelevanceDao;
@Override
public List<CompanyProductRelevanceResponse> filterUdiGp(CompanyProductRelevanceRequest basicInstrumentMaintainRequest) {
if (basicInstrumentMaintainRequest == null) {
return Collections.emptyList();
}
if (basicInstrumentMaintainRequest.getPage() != null) {
int offset = (basicInstrumentMaintainRequest.getPage() - 1) * basicInstrumentMaintainRequest.getLimit();
PageHelper.offsetPage(offset, basicInstrumentMaintainRequest.getLimit());
}
List<CompanyProductRelevanceResponse> data = companyProductRelevanceDao.filterUdiGp(basicInstrumentMaintainRequest);
return data;
}
@Override
public List<CompanyProductRelevanceEntity> filterCompanyProductRelevance(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest) {
if (filterCompanyProductRelevanceRequest == null) {
return Collections.emptyList();
}
if (filterCompanyProductRelevanceRequest.getPage() != null) {
int offset = (filterCompanyProductRelevanceRequest.getPage() - 1) * filterCompanyProductRelevanceRequest.getLimit();
PageHelper.offsetPage(offset, filterCompanyProductRelevanceRequest.getLimit());
}
return companyProductRelevanceDao.filterCompanyProductRelevance(filterCompanyProductRelevanceRequest);
}
@Override
public CompanyProductRelevanceEntity findCompanyProductRelevance(Long CustomerId) {
return companyProductRelevanceDao.findCompanyProductRelevance(CustomerId);
}
@Override
public List<CompanyProductRelevanceEntity> getCompanyProductRelevance(FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest) {
if (filterCompanyProductRelevanceRequest == null) {
return Collections.emptyList();
}
int offset = (filterCompanyProductRelevanceRequest.getPage() - 1) * filterCompanyProductRelevanceRequest.getLimit();
PageHelper.offsetPage(offset, filterCompanyProductRelevanceRequest.getLimit());
List<CompanyProductRelevanceEntity> companyEntities = companyProductRelevanceDao.getCompanyProductRelevance(filterCompanyProductRelevanceRequest);
return companyEntities;
}
@Override
public CompanyProductRelevanceEntity findCompanyProductRelevanceByProductId(String productId) {
return companyProductRelevanceDao.findCompanyProductRelevanceByProductId(productId);
}
@Override
public CompanyProductRelevanceEntity findCompanyProductRelevanceByUdiRlIdFk(String udiRlIdFk, String customerId) {
return companyProductRelevanceDao.findCompanyProductRelevanceByUdiRlIdFk(udiRlIdFk, customerId);
}
@Override
public CompanyProductRelevanceEntity findByUdiRlIdUnitFk(String udiRlIdFk, String unitFk) {
FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest();
filterCompanyProductRelevanceRequest.setUdiRlIdFk(udiRlIdFk);
filterCompanyProductRelevanceRequest.setUnitFk(unitFk);
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities = companyProductRelevanceDao.filterCompanyProductRelevance(filterCompanyProductRelevanceRequest);
if (companyProductRelevanceEntities.size() > 0) {
return companyProductRelevanceEntities.get(0);
}
return null;
}
@Override
public CompanyProductRelevanceEntity findCompanyProductRelevanceByProductUuid(CompanyProductRelevanceEntity companyProductRelevanceEntity) {
return companyProductRelevanceDao.findCompanyProductRelevanceByProductUuid(companyProductRelevanceEntity);
}
@Override
public boolean updateCompanyProductRelevance(CompanyProductRelevanceEntity companyProductRelevanceEntity) {
return companyProductRelevanceDao.updateCompanyProductRelevance(companyProductRelevanceEntity);
}
@Override
public boolean insertCompanyProductRelevance(CompanyProductRelevanceEntity companyProductRelevanceEntity) {
return companyProductRelevanceDao.insertCompanyProductRelevance(companyProductRelevanceEntity);
}
@Override
public boolean deleteById(String id) {
return companyProductRelevanceDao.deleteById(id);
}
@Override
public boolean deleteByRlId(String id) {
return companyProductRelevanceDao.deleteByRlId(id);
}
}

@ -1,10 +1,18 @@
package com.glxp.sale.admin.service.sync.impl;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.dao.sync.CompanyProductRelevanceDao;
import com.glxp.sale.admin.dao.sync.UdiInfoDao;
import com.glxp.sale.admin.dao.sync.UdiInfoImportDetailDao;
import com.glxp.sale.admin.dao.sync.UdiRelevanceDao;
import com.glxp.sale.admin.entity.sync.UdiInfoImportDetailEntity;
import com.glxp.sale.admin.entity.sync.UdiInfoImportLogEntity;
import com.glxp.sale.admin.req.sync.FilterUdiIpLogRequest;
import com.glxp.sale.admin.res.sync.UdiRelevanceExportJsonResponse;
import com.glxp.sale.admin.service.sync.UdiInfoImportDetailService;
import com.glxp.sale.admin.service.sync.UdiInfoImportLogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -16,7 +24,14 @@ public class UdiInfoImportDetailServiceImpl implements UdiInfoImportDetailServic
@Resource
UdiInfoImportDetailDao udiInfoImportDao;
@Resource
UdiInfoDao udiInfoDao;
@Resource
UdiRelevanceDao udiRelevanceDao;
@Resource
CompanyProductRelevanceDao companyProductRelevanceDao;
@Resource
UdiInfoImportLogService udiInfoImportLogService;
@Override
public List<UdiInfoImportDetailEntity> filterUdiInfoImport(FilterUdiIpLogRequest filterInCodeLogRequest) {
@ -57,4 +72,24 @@ public class UdiInfoImportDetailServiceImpl implements UdiInfoImportDetailServic
public boolean deleteByGenkey(String genKey) {
return udiInfoImportDao.deleteByGenkey(genKey);
}
@Override
public void importJsonData(UdiRelevanceExportJsonResponse udiRelevanceExportJsonResponse, String genKey) {
if (CollUtil.isNotEmpty(udiRelevanceExportJsonResponse.getUdiInfoEntities())) {
udiInfoDao.importUdiInfo(udiRelevanceExportJsonResponse.getUdiInfoEntities());
}
if (CollUtil.isNotEmpty(udiRelevanceExportJsonResponse.getUdiRelevanceEntities())) {
udiRelevanceDao.importUdiRelevance(udiRelevanceExportJsonResponse.getUdiRelevanceEntities());
}
if (CollUtil.isNotEmpty(udiRelevanceExportJsonResponse.getCompanyProductRelevanceEntities())) {
companyProductRelevanceDao.importComapnyUdiRelevance(udiRelevanceExportJsonResponse.getUdiRelevanceEntities());
}
// UdiInfoImportLogEntity udiInfoImportLogEntity = udiInfoImportLogService.selectByGenKey(genKey);
// udiInfoImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
// udiInfoImportLogService.updateImportLog(udiInfoImportLogEntity);
}
}

@ -0,0 +1,104 @@
package com.glxp.sale.admin.service.sync.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.dao.sync.UdiInfoDao;
import com.glxp.sale.admin.entity.sync.UdiInfoEntity;
import com.glxp.sale.admin.req.sync.FilterUdiInfoRequest;
import com.glxp.sale.admin.res.sync.UdiRelevanceResponse;
import com.glxp.sale.admin.service.sync.UdiInfoService;
import com.glxp.sale.admin.util.FilterUdiUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class UdiInfoServiceImpl implements UdiInfoService {
@Resource
UdiInfoDao udiInfoDao;
@Override
public List<UdiInfoEntity> filterUdiInfo(FilterUdiInfoRequest filterUdiInfoRequest) {
if (filterUdiInfoRequest == null) {
return Collections.emptyList();
}
if(filterUdiInfoRequest.getPage()!=null){
int offset = (filterUdiInfoRequest.getPage() - 1) * filterUdiInfoRequest.getLimit();
PageHelper.offsetPage(offset, filterUdiInfoRequest.getLimit());
}
List<UdiInfoEntity> data = udiInfoDao.filterUdiInfo(filterUdiInfoRequest);
return data;
}
@Override
public List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiInfoRequest filterUdiInfoRequest) {
if (filterUdiInfoRequest == null) {
return Collections.emptyList();
}
if (filterUdiInfoRequest.getPage() != null) {
int offset = (filterUdiInfoRequest.getPage() - 1) * filterUdiInfoRequest.getLimit();
PageHelper.offsetPage(offset, filterUdiInfoRequest.getLimit());
}
List<UdiRelevanceResponse> data = udiInfoDao.filterUdiInfo2(filterUdiInfoRequest);
return data;
}
@Override
public List<UdiInfoEntity> filterAllUdiInfo(FilterUdiInfoRequest filterUdiInfoRequest) {
if (filterUdiInfoRequest == null) {
return Collections.emptyList();
}
List<UdiInfoEntity> data = udiInfoDao.filterUdiInfo(filterUdiInfoRequest);
return data;
}
@Override
public UdiInfoEntity findByNameCode(String nameCode) {
String prefix = FilterUdiUtils.getDiStr(nameCode);
return udiInfoDao.findByNameCode(prefix);
}
@Override
public UdiInfoEntity findById(String id) {
return udiInfoDao.findById(id);
}
@Override
public UdiInfoEntity findByUuid(String uuid) {
return udiInfoDao.findByUuid(uuid);
}
@Override
public List<UdiInfoEntity> findByUuids(String uuid) {
return udiInfoDao.findByUuids(uuid);
}
@Override
public boolean insertUdiInfo(UdiInfoEntity udiInfoEntity) {
return udiInfoDao.insertUdiInfo(udiInfoEntity);
}
@Override
public boolean insertUdiInfos(List<UdiInfoEntity> udiInfoEntities) {
return udiInfoDao.insertUdiInfos(udiInfoEntities);
}
@Override
public boolean updateUdiInfo(UdiInfoEntity udiInfoEntity) {
return udiInfoDao.updateUdiInfo(udiInfoEntity);
}
@Override
public boolean deleteById(String id) {
return udiInfoDao.deleteById(id);
}
@Override
public boolean deleteByUuid(String uuid) {
return udiInfoDao.deleteByUuid(uuid);
}
}

@ -0,0 +1,137 @@
package com.glxp.sale.admin.service.sync.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.dao.sync.UdiRelevanceDao;
import com.glxp.sale.admin.entity.sync.BasicThirdSysEntity;
import com.glxp.sale.admin.entity.sync.UdiRelevanceEntity;
import com.glxp.sale.admin.req.sync.FilterUdiInfoRequest;
import com.glxp.sale.admin.res.sync.UdiRelevanceResponse;
import com.glxp.sale.admin.service.sync.UdiRelevanceService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class UdiRelevanceServiceImpl implements UdiRelevanceService {
@Resource
UdiRelevanceDao udiRelevanceDao;
@Override
public List<UdiRelevanceResponse> filterUdiRelevance(FilterUdiInfoRequest filterUdiInfoRequest) {
if (filterUdiInfoRequest == null) {
return Collections.emptyList();
}
if (filterUdiInfoRequest.getPage() != null) {
int offset = (filterUdiInfoRequest.getPage() - 1) * filterUdiInfoRequest.getLimit();
PageHelper.offsetPage(offset, filterUdiInfoRequest.getLimit());
}
List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiRelevance(filterUdiInfoRequest);
return data;
}
@Override
public List<UdiRelevanceEntity> filterUdiEntity(FilterUdiInfoRequest filterUdiInfoRequest) {
List<UdiRelevanceEntity> data = udiRelevanceDao.filterEntity(filterUdiInfoRequest);
return data;
}
@Override
public UdiRelevanceResponse selectByNameCode(String nameCode) {
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setNameCode(nameCode);
List<UdiRelevanceResponse> udiRelevanceResponses = filterUdiRelevance(filterUdiInfoRequest);
if (udiRelevanceResponses != null && udiRelevanceResponses.size() > 0)
return udiRelevanceResponses.get(0);
return null;
}
@Override
public List<UdiRelevanceResponse> selectAllByNameCode(String nameCode) {
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setNameCode(nameCode);
List<UdiRelevanceResponse> udiRelevanceResponses = filterUdiRelevance(filterUdiInfoRequest);
return udiRelevanceResponses;
}
@Override
public boolean isExit() {
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setPage(1);
filterUdiInfoRequest.setLimit(1);
List<UdiRelevanceResponse> data = filterUdiRelevance(filterUdiInfoRequest);
if (data != null && data.size() > 0) {
return true;
}
return false;
}
@Override
public List<UdiRelevanceResponse> filterUdiGp(FilterUdiInfoRequest filterUdiInfoRequest) {
if (filterUdiInfoRequest == null) {
return Collections.emptyList();
}
if (filterUdiInfoRequest.getPage() != null) {
int offset = (filterUdiInfoRequest.getPage() - 1) * filterUdiInfoRequest.getLimit();
PageHelper.offsetPage(offset, filterUdiInfoRequest.getLimit());
}
List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiGp(filterUdiInfoRequest);
return data;
}
@Override
public boolean isExitByUuid(String uuid) {
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceDao.selectByUuid(uuid);
if (udiRelevanceEntities != null && !udiRelevanceEntities.isEmpty()) {
return true;
}
return false;
}
@Override
public List<UdiRelevanceEntity> selectByUuid(String uuid) {
return udiRelevanceDao.selectByUuid(uuid);
}
@Override
public UdiRelevanceEntity selectById(String id) {
return udiRelevanceDao.selectById(id);
}
@Override
public UdiRelevanceResponse selectGroupById(String id) {
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setId(id);
filterUdiInfoRequest.setDiType(1);
List<UdiRelevanceResponse> data = udiRelevanceDao.filterUdiRelevance(filterUdiInfoRequest);
if (data != null && data.size() > 0)
return data.get(0);
return null;
}
@Override
public boolean insertUdiRelevance(UdiRelevanceEntity udiRelevanceEntity) {
return udiRelevanceDao.insertUdiRelevance(udiRelevanceEntity);
}
@Override
public boolean deleteById(String id) {
return udiRelevanceDao.deleteById(id);
}
@Override
public boolean deleteByIds(List<String> ids) {
return udiRelevanceDao.deleteByIds(ids);
}
@Override
public boolean deleteByUuid(String uuid) {
return udiRelevanceDao.deleteByUuid(uuid);
}
}

@ -0,0 +1,64 @@
package com.glxp.sale.admin.thread;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.file.FileWriter;
import cn.hutool.json.JSONUtil;
import com.glxp.sale.admin.constant.BasicProcessStatus;
import com.glxp.sale.admin.dao.sync.UdiInfoDao;
import com.glxp.sale.admin.dao.sync.UdiRelevanceDao;
import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity;
import com.glxp.sale.admin.entity.sync.CorpImportDetailEntity;
import com.glxp.sale.admin.entity.sync.UdiInfoEntity;
import com.glxp.sale.admin.entity.sync.UdiInfoImportDetailEntity;
import com.glxp.sale.admin.entity.sync.UdiRelevanceEntity;
import com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest;
import com.glxp.sale.admin.req.sync.FilterUdiInfoRequest;
import com.glxp.sale.admin.req.sync.PostCorpsRequest;
import com.glxp.sale.admin.req.sync.PostUdiInfoRequest;
import com.glxp.sale.admin.res.sync.UdiRelevanceExportJsonResponse;
import com.glxp.sale.admin.res.sync.UdiRelevanceResponse;
import com.glxp.sale.admin.service.sync.CompanyProductRelevanceService;
import com.glxp.sale.admin.service.sync.UdiInfoService;
import com.glxp.sale.admin.service.sync.UdiRelevanceService;
import com.glxp.sale.admin.util.ExcelUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
public class BasicGenExcelService {
@Resource
UdiRelevanceService udiRelevanceService;
@Resource
UdiInfoService udiInfoService;
@Resource
private CompanyProductRelevanceService companyProductRelevanceService;
public UdiRelevanceExportJsonResponse exportJsonUdiInfo(String genKey) {
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setGenKeyFk(genKey);
List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceService.filterUdiEntity(filterUdiInfoRequest);
FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest();
filterCompanyProductRelevanceRequest.setGenKeyFk(genKey);
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities = companyProductRelevanceService.filterCompanyProductRelevance(filterCompanyProductRelevanceRequest);
List<UdiInfoEntity> udiInfoEntities = udiInfoService.filterUdiInfo(filterUdiInfoRequest);
UdiRelevanceExportJsonResponse exportData = new UdiRelevanceExportJsonResponse();
exportData.setCompanyProductRelevanceEntities(companyProductRelevanceEntities);
exportData.setUdiInfoEntities(udiInfoEntities);
exportData.setUdiRelevanceEntities(udiRelevanceEntities);
return exportData;
}
}

@ -21,6 +21,7 @@ import com.glxp.sale.admin.util.DateUtil;
import com.glxp.sale.common.res.BaseResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -45,6 +46,19 @@ public class DataImportService {
@Value("${SPMS_IP}")
private String spmsUrl;
@Value("${API_KEY}")
private String apiKey;
@Value("${API_SECRET}")
private String apiSecret;
public HttpHeaders getHeaders() {
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
headers.add("api_key", apiKey);
headers.add("secret_key", apiSecret);
return headers;
}
// //接收第三方上传或文件导入数据
@Async
@ -120,7 +134,7 @@ public class DataImportService {
paramMap.put("page", page);
paramMap.put("limit", limit);
paramMap.put("lastUpdateTime", lastUpdateTime);
String response = UHttpClient.mipsGet(spmsUrl + "/udiwms/basic/products/download", paramMap);
String response = UHttpClient.mipsGetHead(spmsUrl + "/udiwms/basic/products/download", paramMap, getHeaders());
try {
BaseResponse<PageSimpleResponse<UdiRelevanceResponse>> udiDlDeviceResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<UdiRelevanceResponse>>>() {

@ -60,47 +60,50 @@ public class DlSpOrderService {
if (dlOrderResponses != null && dlOrderResponses.size() > 0) {
for (DlOrderResponse dlOrderResponse : dlOrderResponses) {
OrderEntity orderEntity = dlOrderResponse.getOrderEntity();
IOOrderStatusEntity temp = ioOrderStatusService.findByOrderId(orderEntity.getId());
if (temp == null) {//避免重复操作插入
if (Integer.parseInt(stausConfig.getParamValue()) == 1) {
IOOrderStatusEntity orderStatusEntity = new IOOrderStatusEntity();
orderStatusEntity.setOrderId(orderEntity.getId());
orderStatusEntity.setUpdateTime(new Date());
orderStatusEntity.setStatus(1);
ioOrderStatusService.insertOrderStatus(orderStatusEntity);
List<WarehouseEntity> codes = dlOrderResponse.getCodes();
orderService.insertOrder(orderEntity);
codesService.insertWarehouses(codes);
}
if(orderEntity!=null){
IOOrderStatusEntity temp = ioOrderStatusService.findByOrderId(orderEntity.getId());
if (temp == null) {//避免重复操作插入
if (Integer.parseInt(stausConfig.getParamValue()) == 1) {
IOOrderStatusEntity orderStatusEntity = new IOOrderStatusEntity();
orderStatusEntity.setOrderId(orderEntity.getId());
orderStatusEntity.setUpdateTime(new Date());
orderStatusEntity.setStatus(1);
ioOrderStatusService.insertOrderStatus(orderStatusEntity);
List<WarehouseEntity> codes = dlOrderResponse.getCodes();
orderService.insertOrder(orderEntity);
codesService.insertWarehouses(codes);
}
if (Integer.parseInt(folderConfig.getParamValue()) == 1) {
String fileName = filePath + "/" + "扫码单据" + orderEntity.getId() + ".json";
String backFileName = backFilePath + "/" + "扫码单据" + orderEntity.getId() + ".json";
List<PostOrderRequest.PostOrder> postOrders = new ArrayList<>();
PostOrderRequest postOrderRequest = new PostOrderRequest();
List<WarehouseEntity> warehouseEntityList = dlOrderResponse.getCodes();
PostOrderRequest.PostOrder postOrder = new PostOrderRequest.PostOrder();
postOrder.setCodes(warehouseEntityList);
postOrder.setBillType(orderEntity.getAction());
postOrders.add(postOrder);
postOrderRequest.setPostOrders(postOrders);
String json = JSONObject.toJSON(postOrderRequest).toString();
FileUtils.makeDirectory(filePath);
FileUtils.makeDirectory(backFilePath);
FileUtils.SaveFileAs(json, fileName);
FileUtils.SaveFileAs(json, backFileName);
ThrImportLogEntity thrImportLogEntity = new ThrImportLogEntity();
thrImportLogEntity.setGenKey(CustomUtil.getUUId());
thrImportLogEntity.setImportType(1);
thrImportLogEntity.setUpdateTime(new Date());
thrImportLogEntity.setFilePath(fileName);
thrImportLogEntity.setBackFilePath(backFileName);
thrImportLogEntity.setOrderId(orderEntity.getId());
thrImportLogService.insertImportLog(thrImportLogEntity);
if (Integer.parseInt(folderConfig.getParamValue()) == 1) {
String fileName = filePath + "/" + "扫码单据" + orderEntity.getId() + ".json";
String backFileName = backFilePath + "/" + "扫码单据" + orderEntity.getId() + ".json";
List<PostOrderRequest.PostOrder> postOrders = new ArrayList<>();
PostOrderRequest postOrderRequest = new PostOrderRequest();
List<WarehouseEntity> warehouseEntityList = dlOrderResponse.getCodes();
PostOrderRequest.PostOrder postOrder = new PostOrderRequest.PostOrder();
postOrder.setCodes(warehouseEntityList);
postOrder.setBillType(orderEntity.getAction());
postOrders.add(postOrder);
postOrderRequest.setPostOrders(postOrders);
String json = JSONObject.toJSON(postOrderRequest).toString();
FileUtils.makeDirectory(filePath);
FileUtils.makeDirectory(backFilePath);
FileUtils.SaveFileAs(json, fileName);
FileUtils.SaveFileAs(json, backFileName);
ThrImportLogEntity thrImportLogEntity = new ThrImportLogEntity();
thrImportLogEntity.setGenKey(CustomUtil.getUUId());
thrImportLogEntity.setImportType(1);
thrImportLogEntity.setUpdateTime(new Date());
thrImportLogEntity.setFilePath(fileName);
thrImportLogEntity.setBackFilePath(backFileName);
thrImportLogEntity.setOrderId(orderEntity.getId());
thrImportLogService.insertImportLog(thrImportLogEntity);
}
spGetHttp.postOrder(orderEntity.getId());
}
spGetHttp.postOrder(orderEntity.getId());
}
}
}

@ -0,0 +1,273 @@
package com.glxp.sale.admin.util;
import com.glxp.sale.admin.entity.sync.UdiInfoEntity;
import com.glxp.sale.admin.entity.sync.WarehouseEntity;
/**
* @author
* @date 2020/9/22.
*/
public class FilterUdiUtils {
private static final String TAG = "FilterUdiUtils";
public static UdiEntity getUdi(String data) {
if (data != null && data.length() > 2) {
if (data.substring(0, 2).equals("MA")) {
return getZGCUdi(data);
} else if (data.substring(0, 2).equals("01")) {
return getGS1Udi(data);
} else if (data.substring(0, 1).equals("#")) {
return getGLXPUdi(data);
}
}
return null;
}
public static UdiEntity getGS1Udi(String data) {
String batchNo = "";
String produceDate = "";
String expireDate = "";
String serialNo = null;
String udi = "";
UdiEntity udiEntity = null;
if (data.length() >= 16) {
udi = data.substring(2, 16);
if (data.length() >= 18 && data.substring(16, 18).equals("10")) {
if (data.contains("\u001D")) {
String[] splits = data.split("\u001D");
String front = splits[0];
batchNo = front.substring(18, front.length());
String last = splits[1];
boolean b = last.length() >= 18 && last.substring(16, 18).equals("21");
if ((last != null && last.length() >= 2) && last.substring(0, 2).equals("11")) {
produceDate = last.substring(2, 8);
if (last.length() >= 10 && last.substring(8, 10).equals("17")) {
expireDate = last.substring(10, 16);
if (b) {
serialNo = last.substring(18, last.length());
} else {
serialNo = null;
}
}
} else if ((last != null && last.length() >= 2) && last.substring(0, 2).equals("17")) {
expireDate = last.substring(2, 8);
if (last.length() >= 10 && last.substring(8, 10).equals("11")) {
produceDate = last.substring(10, 16);
if (b) {
serialNo = last.substring(18, last.length());
} else {
serialNo = null;
}
}
} else if ((last != null && last.length() >= 2) && last.substring(0, 2).equals("21")) {
serialNo = last.substring(2, last.length());
}
} else {
batchNo = data.substring(18);
}
} else if (data.length() >= 18 && data.substring(16, 18).equals("11")) {
produceDate = data.substring(18, 24);
if (data.length() >= 26 && data.substring(24, 26).equals("17")) {
expireDate = data.substring(26, 32);
if (data.length() >= 34 && data.substring(32, 34).equals("10")) {
if (data.contains("\u001D")) {
String[] splits = data.split("\u001D");
batchNo = splits[0].substring(34, splits[0].length());
serialNo = splits[1].substring(2);
} else {
batchNo = data.substring(34, data.length());
}
}
} else if (data.length() >= 26 && data.substring(24, 26).equals("10")) {
if (data.contains("\u001D")) {
String[] splits = data.split("\u001D");
batchNo = splits[0].substring(26, splits[0].length());
String last = splits[1];
if (last.substring(0, 2).equals("17")) {
expireDate = last.substring(2, 8);
if (last.length() >= 10) {
serialNo = last.substring(10, last.length());
}
} else if (last.substring(0, 2).equals("21")) {
serialNo = last.substring(2, last.length());
}
} else {
batchNo = data.substring(26, data.length());
}
} else if (data.length() >= 26 && data.substring(24, 26).equals("21")) {
serialNo = data.substring(26);
}
} else if (data.length() >= 18 && data.substring(16, 18).equals("17")) {
expireDate = data.substring(18, 24);
if (data.length() >= 26 && data.substring(24, 26).equals("11")) {
produceDate = data.substring(26, 32);
if (data.length() >= 34 && data.substring(32, 34).equals("10")) {
if (data.contains("\u001D")) {
String[] splits = data.split("\u001D");
batchNo = splits[0].substring(34, splits[0].length());
serialNo = splits[1].substring(2);
} else {
batchNo = data.substring(34, data.length());
}
}
} else if (data.length() >= 26 && data.substring(24, 26).equals("10")) {
if (data.contains("\u001D")) {
String[] splits = data.split("\u001D");
batchNo = splits[0].substring(26);
String last = splits[1];
if (last.substring(0, 2).equals("11")) {
produceDate = last.substring(2, 8);
if (last.length() > 8 && last.substring(8, 10).equals("21")) {
serialNo = last.substring(10);
}
} else if (last.substring(0, 2).equals("21")) {
serialNo = last.substring(2);
}
} else {
batchNo = data.substring(26, data.length());
}
} else if (data.length() >= 26 && data.substring(24, 26).equals("21")) {
serialNo = data.substring(26);
}
} else if (data.length() >= 18 && data.substring(16, 18).equals("21")) {
serialNo = data.substring(18);
}
udiEntity = new UdiEntity();
udiEntity.setUdi(udi);
udiEntity.setBatchNo(batchNo);
udiEntity.setExpireDate(expireDate);
udiEntity.setProduceDate(produceDate);
udiEntity.setSerialNo(serialNo);
}
return udiEntity;
}
public static UdiEntity getZGCUdi(String data) {
String batchNo = "";
String produceDate = "";
String expireDate = "";
String serialNo = null;
String udi = data;
String[] spilts = data.split("[.]");
if (spilts != null && spilts.length >= 5) {
for (int i = 0; i < 5; i++) {
udi = udi + "." + spilts[i];
}
udi = udi.substring(1);
for (int i = 0; i < spilts.length; i++) {
String tempStr = spilts[i];
if (tempStr != null && tempStr.length() > 1 && tempStr.substring(0, 1).equals("P")) {
produceDate = tempStr.substring(1);
} else if (tempStr != null && tempStr.length() > 1 && tempStr.substring(0, 1).equals("L")) {
batchNo = tempStr.substring(1);
} else if (tempStr != null && tempStr.length() > 1 && tempStr.substring(0, 1).equals("E")) {
expireDate = tempStr.substring(1);
} else if (tempStr != null && tempStr.length() > 1 && tempStr.substring(0, 1).equals("S")) {
serialNo = tempStr.substring(1);
}
}
}
UdiEntity udiEntity = new UdiEntity();
udiEntity.setBatchNo(batchNo);
udiEntity.setExpireDate(expireDate);
udiEntity.setProduceDate(produceDate);
udiEntity.setUdi(udi);
udiEntity.setSerialNo(serialNo);
return udiEntity;
}
public static UdiEntity getGLXPUdi(String data) {
String batchNo = "";
String produceDate = "";
String expireDate = "";
String serialNo = null;
String udi = "";
String[] spilts = data.split("#");
if (spilts != null && spilts.length >= 5) {
udi = spilts[1];
produceDate = spilts[2];
expireDate = spilts[3];
batchNo = spilts[4];
if (spilts.length > 6) {
serialNo = spilts[5];
if (serialNo != null && serialNo.equals("")) {
serialNo = null;
}
}
}
UdiEntity udiEntity = new UdiEntity();
udiEntity.setBatchNo(batchNo);
udiEntity.setExpireDate(expireDate);
udiEntity.setProduceDate(produceDate);
udiEntity.setUdi(udi);
udiEntity.setSerialNo(serialNo);
return udiEntity;
}
public static String getDiStr(String data) {
String prefix = "";
if (data != null && data.length() > 2) {
if (data.substring(0, 2).equals("MA")) {
String[] spilts = data.split("[.]");
if (spilts != null && spilts.length >= 5) {
for (int i = 0; i < 5; i++) {
prefix = prefix + "." + spilts[i];
}
prefix = prefix.substring(1);
}
} else if (data.substring(0, 2).equals("01") && data.length() >= 16) {
prefix = data.substring(2, 16);
} else if (data.substring(0, 1).equals("#")) {
String[] spilts = data.split("#");
if (spilts != null && spilts.length >= 1)
prefix = spilts[1];
}
}
if (prefix.equals(""))
return data;
return prefix;
}
public static UdiInfoEntity transUdi(UdiInfoEntity data) {
UdiEntity udiEntity = getUdi(data.getCode());
if (udiEntity != null) {
data.setBatchNo(udiEntity.getBatchNo());
data.setProduceDate(udiEntity.getProduceDate());
data.setExpireDate(udiEntity.getExpireDate());
data.setSerialNo(udiEntity.getSerialNo());
data.setUdi(udiEntity.getUdi());
}
return data;
}
public static String transGlxpStr(String code) {
UdiEntity udiEntity = getUdi(code);
String udiCode = "#" + udiEntity.getUdi() + "#" + udiEntity.getProduceDate() + "#" + udiEntity.getExpireDate() +
"#" + udiEntity.getBatchNo() + "#" + udiEntity.getSerialNo() + "#" + "#";
return udiCode;
}
public static String transGlxpNoSerStr(WarehouseEntity warehouseEntity) {
String udiCode = "#" + warehouseEntity.getNameCode() + "#" + warehouseEntity.getProduceDate() + "#" + warehouseEntity.getExpireDate() +
"#" + warehouseEntity.getBatchNo() + "#" + "#" + "#";
return udiCode;
}
public static String transGlxpNoSerStr(UdiEntity warehouseEntity) {
String udiCode = "#" + warehouseEntity.getUdi() + "#" + warehouseEntity.getProduceDate() + "#" + warehouseEntity.getExpireDate() +
"#" + warehouseEntity.getBatchNo() + "#" + "#" + "#";
return udiCode;
}
}

@ -0,0 +1,65 @@
package com.glxp.sale.admin.util;
/**
* @author
* @date 2020/9/22.
*/
public class UdiEntity {
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
private String udi;
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public String getProduceDate() {
return produceDate;
}
public void setProduceDate(String produceDate) {
this.produceDate = produceDate;
}
public String getExpireDate() {
return expireDate;
}
public void setExpireDate(String expireDate) {
this.expireDate = expireDate;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
public String getUdi() {
return udi;
}
public void setUdi(String udi) {
this.udi = udi;
}
@Override
public String toString() {
return "UdiEntity{" +
"batchNo='" + batchNo + '\'' +
", produceDate='" + produceDate + '\'' +
", expireDate='" + expireDate + '\'' +
", serialNo='" + serialNo + '\'' +
", udi='" + udi + '\'' +
'}';
}
}

@ -6,7 +6,7 @@ spring.datasource.username=root
#spring.datasource.password=root
spring.datasource.password=123456
#server.servlet.context-path=
#logging.level.com.glxp.sale.admin.dao=debug
logging.level.com.glxp.sale.admin.dao=debug
# \u8DE8\u57DF\u8BBE\u7F6E
cors.allowed-origins=*
cors.allowed-headers=Content-Type,ADMIN_ID,ADMIN_TOKEN
@ -22,8 +22,11 @@ server.connectionTimeout=180000
#logging.level.com.glxp.sale.admin.dao=debug
# \u8F93\u51FA\u65E5\u5FD7\u5230\u9879\u76EE\u6839\u76EE\u5F55\u4E0B\u7684springboot.log\u6587\u4EF6\u4E2D // \u914D\u7F6E logback-spring.xml\u65F6 \u6B64\u65E5\u5FD7\u8F93\u51FA\u65B9\u5F0F\u4F1A\u88AB\u8986\u76D6\u3002
logging.file=D:/1s/udiwms/udiwms.log
#logging.file=/www/glxpdata/spsyc/
file_path=D:/1s/udiwms/sp/order/sync
#file_path=/share/order/sync
back_file_path=D:/1s/udiwms/sp/order/sync/sync_back
#back_file_path=/share/order/sync_back
#UDI\u6570\u636E\u4E0B\u8F7D
UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server
#UCLOD\u670D\u52A1
@ -43,6 +46,8 @@ spring.jackson.time-zone=GMT+8
#UDIWMS_IP=http://139.159.187.130:8080/UDI_WMS_MC
UDIWMS_IP=http://127.0.0.1:9991
SPMS_IP=http://127.0.0.1:9996
API_KEY=1101
API_SECRET=zBITspLNvuoEd4FaamlSoqxRHmNsmQ9L
#SPMS_IP=http://139.159.187.130:8080/SPMS_SERVER
##端口号
# Redis数据库索引默认为0

@ -11,14 +11,16 @@
<!--<property name="LOG_INFO_HOME" value="/Users/riemann/Documents/log" />-->
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!-- ConsoleAppender , 将日志输出到控制台 . 有encoder和target两个子节点 -->
<appender name="CONSOLE-LOG" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
@ -38,7 +40,7 @@
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天一归档 -->
<fileNamePattern>d:/1s/udiwms/logs/${LOG_INFO_HOME}//%d{yyyy-MM-dd}_%i.log
<fileNamePattern>/www/glxpdata/spsync/logs/${LOG_INFO_HOME}//%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
@ -59,7 +61,7 @@
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天一归档 -->
<fileNamePattern>d:/1s/udiwms/logs/${LOG_ERROR_HOME}//%d{yyyy-MM-dd}_%i.log
<fileNamePattern>/www/glxpdata/spsync/logs/${LOG_ERROR_HOME}//%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
@ -78,14 +80,14 @@
level : 日志级别 ,有以下值TRACE, DEBUG, INFO, WARN, ERROR, ALL, OFF , 不区分大小写
additivity : 是否向上级logger传递日志信息 , 默认为ture . (如果上级logger也输出日志 , 则会输出两份 . 所以通常情况下配置为false)
-->
<logger name="org.springframework.web" level="INFO" />
<logger name="org.springframework" level="INFO" />
<logger name="com.riemann.springbootdemo" level="DEBUG" />
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springframework" level="INFO"/>
<logger name="com.riemann.springbootdemo" level="DEBUG"/>
<!-- root本身也是一个logger节点(相当于name="root"的logger) , 但仅能配置一个 , 是所有logger的父级(可以理解为Java中的Object) , 只有一个level属性, 默认值DEBUG -->
<root level="INFO">
<appender-ref ref="CONSOLE-LOG" />
<appender-ref ref="INFO-LOG" />
<appender-ref ref="ERROR-LOG" />
<appender-ref ref="CONSOLE-LOG"/>
<appender-ref ref="INFO-LOG"/>
<appender-ref ref="ERROR-LOG"/>
</root>
</configuration>

@ -0,0 +1,276 @@
<?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.sale.admin.dao.sync.CompanyProductRelevanceDao">
<select id="filterCompanyProductRelevance"
parameterType="com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest"
resultType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
select * from company_product_relevance
<where>
<if test="customerId != '' and customerId!=null">
and customerId = #{customerId}
</if>
<if test="udiRlIdFk != '' and udiRlIdFk!=null">
and udiRlIdFk = #{udiRlIdFk}
</if>
<if test="unitFk != null and unitFk != ''">
and unitFk = #{unitFk}
</if>
</where>
ORDER BY id DESC
</select>
<select id="filterUdiGp" parameterType="com.glxp.sale.admin.req.sync.CompanyProductRelevanceRequest"
resultType="com.glxp.sale.admin.res.sync.CompanyProductRelevanceResponse">
select
company_product_relevance.id,company_product_relevance.customerId,company_product_relevance.auditStatus,
basic_udirel.thirdId,basic_udirel.thirdName,basic_udirel.id rlId,
basic_udirel.isUseDy, basic_udirel.isLock,
basic_udirel.thirdId1,basic_udirel.thirdId2,
basic_udirel.thirdId3,basic_udirel.thirdId4,
basic_udirel.thirdName1,basic_udirel.thirdName2,
basic_udirel.thirdName3,basic_udirel.thirdName4,
basic_udirel.ybbm,basic_udirel.sptm,
basic_udirel.manufactory,basic_udirel.measname,basic_udirel.lockStatus,
basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,basic_products.bhxjsl,
basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,basic_products.bhxjcpbm,
basic_products.bzcj,basic_products.addType,
basic_products.deviceRecordKey,basic_products.cpmctymc,
basic_products.cplb,basic_products.flbm,basic_products.ggxh,basic_products.qxlb,
basic_products.tyshxydm,basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,basic_products.sydycpbs,basic_products.uuid,
basic_products.sjcpbm,basic_products.versionNumber,basic_products.diType,
customer_info.companyName, basic_udirel.mainId,basic_udirel.mainName,basic_udirel.isAdavence
FROM company_product_relevance
inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id
inner JOIN basic_products
ON basic_udirel.uuid = basic_products.uuid
inner JOIN customer_info on customer_info.customerId = company_product_relevance.customerId
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
</if>
<if test="unionCode != '' and unionCode != null">
and (
nameCode LIKE concat('%',#{unionCode},'%')
or basic_udirel.ybbm LIKE concat('%',#{unionCode},'%')
or basic_udirel.sptm LIKE concat('%',#{unionCode},'%')
)
</if>
<if test="thrPiId != '' and thrPiId != null">
and (
thirdId LIKE concat('%',#{thrPiId},'%')
or thirdId1 LIKE concat('%',#{thrPiId},'%')
or thirdId2 LIKE concat('%',#{thrPiId},'%')
or thirdId3 LIKE concat('%',#{thrPiId},'%')
or thirdId4 LIKE concat('%',#{thrPiId},'%')
)
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh},'%')
</if>
<if test="diType != '' and diType != null">
AND diType =#{diType}
</if>
<if test="filterType != null and filterType == 1">
AND (thirdId <![CDATA[<>]]> '' or thirdId1 <![CDATA[<>]]> '' or thirdId2 <![CDATA[<>]]> '' or
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '' )
and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 2">
AND basic_products.flbm is NULL
</if>
<if test="filterType != null and filterType == 3">
AND thirdId is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 4">
AND thirdId1 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 5">
AND thirdId2 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 6">
AND thirdId3 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 7">
AND thirdId4 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="customerId != '' and customerId != null">
AND company_product_relevance.customerId = #{customerId}
</if>
<if test="auditStatus != '' and auditStatus != null">
AND company_product_relevance.auditStatus = #{auditStatus}
</if>
<if test="id != '' and id != null">
AND basic_udirel.id = #{id}
</if>
<if test="companyName != '' and companyName != null">
AND customer_info.companyName = #{companyName}
</if>
<if test="lockStatus != '' and lockStatus != null">
AND basic_udirel.lockStatus = #{lockStatus}
</if>
<if test="isAdavence != '' and isAdavence != null">
AND basic_udirel.isAdavence = #{isAdavence}
</if>
<if test="unitFk != null and unitFk != ''">
and unitFk = #{unitFk}
</if>
</where>
ORDER BY updateTime DESC
</select>
<select id="findCompanyProductRelevance" parameterType="java.lang.Long"
resultType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
SELECT *
FROM company_product_relevance
where customerId = #{customerId}
</select>
<select id="findCompanyProductRelevanceByProductId" parameterType="java.lang.String"
resultType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
SELECT *
FROM company_product_relevance
where productId = #{productId}
</select>
<select id="findCompanyProductRelevanceByUdiRlIdFk" parameterType="java.lang.String"
resultType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
SELECT *
FROM company_product_relevance
where udiRlIdFk = #{udiRlIdFk}
and customerId = #{customerId}
</select>
<select id="findCompanyProductRelevanceByProductUuid"
parameterType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity"
resultType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
SELECT * FROM company_product_relevance
<where>
<if test="customerId != null and customerId != ''">
and customerId = #{customerId}
</if>
<if test="productId != null and productId != ''">
and productId = #{productId}
</if>
<if test="productUuid != null and productUuid != ''">
and productUuid = #{productUuid}
</if>
<if test="unitFk != null and unitFk != ''">
and unitFk = #{unitFk}
</if>
</where>
</select>
<select id="getCompanyProductRelevance"
parameterType="com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest"
resultType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
SELECT * FROM company_product_relevance
<where>
<if test="customerId != null and customerId != ''">
and customerId = #{customerId}
</if>
<if test="productId != null and productId != ''">
and productId = #{productId}
</if>
<if test="productUuid != null and productUuid != ''">
and productUuid = #{productUuid}
</if>
<if test="unitFk != null and unitFk != ''">
and unitFk = #{unitFk}
</if>
</where>
</select>
<update id="updateCompanyProductRelevance"
parameterType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
UPDATE company_product_relevance
<set>
<if test="customerId != null">customerId=#{customerId},</if>
<if test="productId != null">name=#{name},</if>
<if test="enterpriseId != null">tel=#{tel},</if>
<if test="registrationId != null">phone=#{phone},</if>
<if test="create_time != null">create_time=#{create_time},</if>
<if test="update_time != null">update_time=#{update_time},</if>
<if test="auditStatus != null">auditStatus=#{auditStatus},</if>
<if test="productUuid != null">productUuid=#{productUuid},</if>
<if test="udiRlIdFk != null">udiRlIdFk=#{udiRlIdFk},</if>
<if test="unitFk != null">unitFk=#{unitFk},</if>
</set>
WHERE id = #{id}
</update>
<insert id="insertCompanyProductRelevance"
parameterType="com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity">
replace
INTO company_product_relevance(customerId,productId,enterpriseId,registrationId,
create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk) values
(
#{customerId},
#{productId},
#{enterpriseId},
#{registrationId},
#{create_time},
#{update_time},
#{auditStatus},
#{productUuid},
#{udiRlIdFk},
#{unitFk}
)
</insert>
<insert id="importComapnyUdiRelevance" parameterType="java.util.List">
replace into basic_udirel (id, customerId, productId, enterpriseId, create_time, update_time, auditStatus,
productUuid, udiRlIdFk,unitFk,genKeyFk)
values
<foreach collection="companyProductRelevanceEntities" item="item" index="index" separator=",">
(#{item.id},
#{item.customerId},
#{item.productId},
#{item.enterpriseId},
#{item.registrationId},
#{item.create_time},
#{item.update_time},
#{item.auditStatus},
#{item.productUuid},
#{item.udiRlIdFk},
#{item.unitFk},#{item.genKeyFk})
</foreach>
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM company_product_relevance
WHERE id = #{id}
</delete>
<delete id="deleteByRlId" parameterType="Map">
DELETE
FROM company_product_relevance
WHERE udiRlIdFk = #{id}
</delete>
</mapper>

@ -0,0 +1,280 @@
<?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.sale.admin.dao.sync.UdiInfoDao">
<select id="filterUdiInfo" parameterType="com.glxp.sale.admin.req.sync.FilterUdiInfoRequest"
resultType="com.glxp.sale.admin.entity.sync.UdiInfoEntity">
SELECT * FROM basic_products
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
</if>
<if test="genKeyFk != '' and genKeyFk != null">
AND genKeyFk = #{genKeyFk}
</if>
</where>
</select>
<select id="filterUdiInfo2" parameterType="com.glxp.sale.admin.req.sync.FilterUdiInfoRequest"
resultType="com.glxp.sale.admin.res.sync.UdiRelevanceResponse">
SELECT basic_products.id,
basic_udirel.thirdId,basic_udirel.thirdName,basic_udirel.isUseDy,
basic_udirel.thirdId1,basic_udirel.thirdId2,basic_udirel.thirdId3,basic_udirel.thirdId4,
basic_udirel.ybbm,basic_udirel.sptm,basic_udirel.isDisable,
basic_udirel.thirdName1,basic_udirel.thirdName2,basic_udirel.thirdName3,basic_udirel.thirdName4,
basic_udirel.manufactory,basic_udirel.measname,basic_udirel.udplatCode,
basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,
basic_products.bhxjsl,basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,basic_products.bzcj,basic_products.addType,basic_products.deviceRecordKey,
basic_products.cpmctymc,basic_products.cplb,basic_products.flbm,basic_products.ggxh,basic_products.qxlb,
basic_products.tyshxydm,basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,basic_products.uuid,basic_products.sjcpbm,basic_products.versionNumber,basic_products.diType
FROM (company_product_relevance
inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id)
inner JOIN basic_products
ON basic_udirel.uuid = basic_products.uuid
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
</if>
<if test="unionCode != '' and unionCode != null">
or nameCode LIKE concat('%',#{unionCode},'%')
or basic_udirel.ybbm LIKE concat('%',#{unionCode},'%')
or basic_udirel.sptm LIKE concat('%',#{unionCode},'%')
</if>
<if test="thrPiId != '' and thrPiId != null">
or thirdId LIKE concat('%',#{thrPiId},'%')
or thirdId1 LIKE concat('%',#{thrPiId},'%')
or thirdId2 LIKE concat('%',#{thrPiId},'%')
or thirdId3 LIKE concat('%',#{thrPiId},'%')
or thirdId4 LIKE concat('%',#{thrPiId},'%')
</if>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh},'%')
</if>
<if test="customerId != '' and customerId != null">
AND company_product_relevance.customerId = #{customerId}
</if>
</where>
ORDER BY updateTime DESC
</select>
<!--// AND company_product_relevance.auditStatus = 1-->
<select id="findById" parameterType="java.lang.String"
resultType="com.glxp.sale.admin.entity.sync.UdiInfoEntity">
SELECT *
FROM basic_products
WHERE (id = #{id}) limit 1
</select>
<select id="findByUuid" parameterType="java.lang.String"
resultType="com.glxp.sale.admin.entity.sync.UdiInfoEntity">
SELECT * FROM basic_products WHERE (
uuid = #{uuid} ) limit 1
</select>
<select id="findByUuids" parameterType="java.lang.String"
resultType="com.glxp.sale.admin.entity.sync.UdiInfoEntity">
SELECT * FROM basic_products WHERE (
uuid = #{uuid} )
</select>
<select id="findByNameCode" parameterType="java.lang.String"
resultType="com.glxp.sale.admin.entity.sync.UdiInfoEntity">
SELECT * FROM basic_products WHERE (
nameCode = #{nameCode} ) limit 1
</select>
<insert id="insertUdiInfo" keyProperty="id" parameterType="com.glxp.sale.admin.entity.sync.UdiInfoEntity">
replace INTO basic_products
(
nameCode,packRatio,packLevel,bhxjsl,
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,addType,deviceRecordKey,
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
,diType,productType,genKeyFk)
values
(
#{nameCode},
#{packRatio},
#{packLevel},
#{bhxjsl},
#{bhzxxsbzsl},
#{zxxsbzbhsydysl},
#{bhxjcpbm},
#{bzcj},
#{addType},
#{deviceRecordKey},
#{cpmctymc},
#{cplb},
#{flbm},
#{ggxh},
#{qxlb},
#{tyshxydm},
#{ylqxzcrbarmc},
#{zczbhhzbapzbh},
#{ylqxzcrbarywmc},
#{uuid},
#{sjcpbm},
#{versionNumber},
#{diType},#{productType},#{genKeyFk}
)
</insert>
<insert id="insertUdiInfos" keyProperty="id" parameterType="java.util.List">
replace INTO basic_products
(
nameCode,packRatio,packLevel,bhxjsl,
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,addType,deviceRecordKey,
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
,diType,productType,genKeyFk
)
values
<foreach collection="udiInfoEntities" item="item" index="index"
separator=",">
(
#{item.nameCode},
#{item.packRatio},
#{item.packLevel},
#{item.bhxjsl},
#{item.bhzxxsbzsl},
#{item.zxxsbzbhsydysl},
#{item.bhxjcpbm},
#{item.bzcj},
#{item.addType},
#{item.deviceRecordKey},
#{item.cpmctymc},
#{item.cplb},
#{item.flbm},
#{item.ggxh},
#{item.qxlb},
#{item.tyshxydm},
#{item.ylqxzcrbarmc},
#{item.zczbhhzbapzbh},
#{item.ylqxzcrbarywmc},
#{item.uuid},
#{item.sjcpbm},
#{item.versionNumber},
#{item.diType},#{item.productType},#{item.genKeyFk}
)
</foreach>
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM basic_products WHERE id = #{id}
</delete>
<delete id="deleteByUuid" parameterType="Map">
DELETE FROM basic_products WHERE uuid = #{uuid}
</delete>
<update id="updateUdiInfo" parameterType="com.glxp.sale.admin.entity.sync.UdiInfoEntity">
UPDATE basic_products
<trim prefix="set" suffixOverrides=",">
<if test="packRatio != null">packRatio=#{packRatio},</if>
<if test="packLevel != null">packLevel=#{packLevel},</if>
<if test="bhxjsl != null">bhxjsl=#{bhxjsl},</if>
<if test="bhzxxsbzsl != null">bhzxxsbzsl=#{bhzxxsbzsl},</if>
<if test="zxxsbzbhsydysl != null">zxxsbzbhsydysl=#{zxxsbzbhsydysl},</if>
<if test="bhxjcpbm != null">bhxjcpbm=#{bhxjcpbm},</if>
<if test="bzcj != null">bzcj=#{bzcj},</if>
<if test="addType != null">addType=#{addType},</if>
<if test="deviceRecordKey != null">deviceRecordKey=#{deviceRecordKey},</if>
<if test="cpmctymc != null">cpmctymc=#{cpmctymc},</if>
<if test="cplb != null">cplb=#{cplb},</if>
<if test="flbm != null">flbm=#{flbm},</if>
<if test="ggxh != null">ggxh=#{ggxh},</if>
<if test="qxlb != null">qxlb=#{qxlb},</if>
<if test="tyshxydm != null">tyshxydm=#{tyshxydm},</if>
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
<if test="ylqxzcrbarywmc != null">ylqxzcrbarywmc=#{ylqxzcrbarywmc},</if>
<if test="uuid != null">uuid=#{uuid},</if>
<if test="sjcpbm != null">sjcpbm=#{sjcpbm},</if>
<if test="versionNumber != null">versionNumber=#{versionNumber},</if>
<if test="sptm != null">sptm=#{sptm},</if>
<if test="manufactory != null">manufactory=#{manufactory},</if>
<if test="ybbm != null">ybbm=#{ybbm},</if>
<if test="measname != null">measname=#{measname},</if>
<if test="diType != null">diType=#{diType},</if>
<if test="productType != null">productType=#{productType},</if>
</trim>
WHERE nameCode = #{nameCode}
</update>
<select id="batchSelectByUuid" resultType="com.glxp.sale.admin.entity.sync.UdiInfoEntity">
select *
from basic_products where uuid in
<foreach collection="uuids" item="item" separator="," index="index" open="(" close=")">
#{item}
</foreach>
</select>
<insert id="importUdiInfo" parameterType="java.util.List">
replace into basic_products
(id, nameCode, packRatio, packLevel, bhxjsl, bhzxxsbzsl, zxxsbzbhsydysl, bhxjcpbm, bzcj, addType,
deviceRecordKey, cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm, ylqxzcrbarmc, zczbhhzbapzbh,
ylqxzcrbarywmc, sydycpbs, uuid, sjcpbm, versionNumber, diType, ybbm, sptm, manufactory, measname,
productType,genKeyFk) values
<foreach collection="udiInfoEntities" item="item" index="index" separator=",">
(#{item.id},
#{item.nameCode},
#{item.packRatio},
#{item.packLevel},
#{item.bhxjsl},
#{item.bhzxxsbzsl},
#{item.zxxsbzbhsydysl},
#{item.bhxjcpbm},
#{item.bzcj},
#{item.addType},
#{item.deviceRecordKey},
#{item.cpmctymc},
#{item.cplb},
#{item.flbm},
#{item.ggxh},
#{item.qxlb},
#{item.tyshxydm},
#{item.ylqxzcrbarmc},
#{item.zczbhhzbapzbh},
#{item.ylqxzcrbarywmc},
#{item.sydycpbs},
#{item.uuid},
#{item.sjcpbm},
#{item.versionNumber},
#{item.diType},
#{item.ybbm},
#{item.sptm},
#{item.manufactory},
#{item.measname},
#{item.productType},#{item.genKeyFk})
</foreach>
</insert>
</mapper>

@ -0,0 +1,354 @@
<?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.sale.admin.dao.sync.UdiRelevanceDao">
<select id="filterUdiRelevance" parameterType="com.glxp.sale.admin.req.sync.FilterUdiInfoRequest"
resultType="com.glxp.sale.admin.res.sync.UdiRelevanceResponse">
select
basic_udirel.id,
basic_udirel.thirdId,basic_udirel.thirdName,basic_udirel.isUseDy,
basic_udirel.thirdId1,basic_udirel.thirdId2,basic_udirel.thirdId3,basic_udirel.thirdId4,
basic_udirel.thirdName1,basic_udirel.thirdName2,basic_udirel.thirdName3,basic_udirel.thirdName4,
basic_udirel.manufactory,basic_udirel.measname,basic_udirel.ybbm,basic_udirel.sptm,
basic_udirel.isDisable, basic_udirel.isLock,basic_udirel.lockStatus,basic_udirel.udplatCode,
basic_udirel.isAdavence,
basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,
basic_products.bhxjsl,basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,basic_products.bzcj,
basic_products.addType,basic_products.deviceRecordKey,
basic_products.cpmctymc,basic_products.cplb,
basic_products.flbm,basic_products.ggxh,basic_products.qxlb,basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh,basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,basic_products.uuid,basic_products.sjcpbm,basic_products.versionNumber,
basic_products.diType,basic_products.productType
FROM basic_udirel
inner JOIN basic_products
ON basic_products.uuid = basic_udirel.uuid
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId LIKE concat(#{thirdId},'%')
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
</if>
<if test="id != '' and id != null">
AND basic_udirel.id = #{id}
</if>
<if test="udplatCode != '' and udplatCode != null">
AND basic_udirel.udplatCode = #{udplatCode}
</if>
<if test=" diType != null">
AND basic_products.diType= #{diType}
</if>
<if test="lockStatus != '' and lockStatus != null">
AND basic_udirel.lockStatus = #{lockStatus}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh},'%')
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
<if test="mainId != '' and mainId != null">
AND mainId = #{mainId}
</if>
<if test="isAdavence != '' and isAdavence != null">
AND isAdavence = #{isAdavence}
</if>
</where>
ORDER BY updateTime DESC
</select>
<select id="filterUdiGp" parameterType="com.glxp.sale.admin.req.sync.FilterUdiInfoRequest"
resultType="com.glxp.sale.admin.res.sync.UdiRelevanceResponse">
select
basic_udirel.id,
basic_udirel.thirdId,basic_udirel.thirdName,basic_udirel.isUseDy,
basic_udirel.thirdId1,basic_udirel.thirdId2,basic_udirel.thirdId3,basic_udirel.thirdId4,
basic_udirel.ybbm,basic_udirel.sptm,basic_udirel.isDisable, basic_udirel.isLock,basic_udirel.lockStatus,
basic_udirel.thirdName1,basic_udirel.thirdName2,basic_udirel.thirdName3,basic_udirel.thirdName4,
basic_udirel.manufactory,basic_udirel.measname,basic_udirel.udplatCode,
basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,basic_products.bhxjsl,
basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,basic_products.bhxjcpbm,basic_products.bzcj,
basic_products.addType,basic_products.deviceRecordKey,basic_products.cpmctymc,basic_products.cplb,
basic_products.flbm,basic_products.ggxh,basic_products.qxlb,basic_products.tyshxydm,basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,basic_products.ylqxzcrbarywmc,basic_products.sydycpbs,basic_products.uuid,
basic_products.sjcpbm,basic_products.versionNumber,basic_products.diType,
basic_udirel.mainId,basic_udirel.mainName,basic_udirel.isAdavence
FROM basic_products
right JOIN basic_udirel
ON basic_products.uuid = basic_udirel.uuid
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
</if>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat(#{cpmctymc},'%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat(#{nameCode},'%')
</if>
<if test="unionCode != '' and unionCode != null">
and (
nameCode LIKE concat('%',#{unionCode},'%')
or basic_udirel.ybbm LIKE concat('%',#{unionCode},'%')
or basic_udirel.sptm LIKE concat('%',#{unionCode},'%'))
</if>
<if test="thrPiId != '' and thrPiId != null">
and ( thirdId LIKE concat('%',#{thrPiId},'%')
or thirdId1 LIKE concat('%',#{thrPiId},'%')
or thirdId2 LIKE concat('%',#{thrPiId},'%')
or thirdId3 LIKE concat('%',#{thrPiId},'%')
or thirdId4 LIKE concat('%',#{thrPiId},'%'))
</if>
<if test="uuid != '' and uuid != null">
AND basic_udirel.uuid = #{uuid}
</if>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
<if test="udplatCode != '' and udplatCode != null">
AND udplatCode = #{udplatCode}
</if>
<if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh},'%')
</if>
<if test="diType != '' and diType != null">
AND diType =#{diType}
</if>
<if test="filterType != null and filterType == 1">
AND (thirdId <![CDATA[<>]]> '' or thirdId1 <![CDATA[<>]]> '' or thirdId2 <![CDATA[<>]]> '' or
thirdId3 <![CDATA[<>]]> '' or thirdId4 <![CDATA[<>]]> '' )
and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 2">
AND basic_products.flbm is NULL
</if>
<if test="filterType != null and filterType == 3">
AND thirdId is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 4">
AND thirdId1 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 5">
AND thirdId2 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 6">
AND thirdId3 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 7">
AND thirdId4 is NULL and basic_products.flbm <![CDATA[<>]]> ''
</if>
<if test="lockStatus != '' and lockStatus != null">
AND basic_udirel.lockStatus = #{lockStatus}
</if>
<if test="mainId != '' and mainId != null">
AND mainId = #{mainId}
</if>
<if test="id != '' and id != null">
AND basic_udirel.id = #{id}
</if>
</where>
ORDER BY updateTime DESC
</select>
<!-- GROUP BY
uuid,basic_udirel.thirdId,basic_udirel.thirdId1,basic_udirel.thirdId2,basic_udirel.thirdId3,basic_udirel.thirdId4-->
<select id="selectByUuid" parameterType="java.lang.String"
resultType="com.glxp.sale.admin.entity.sync.UdiRelevanceEntity">
select * FROM basic_udirel
<where>
<if test="uuid != '' and uuid != null">
AND uuid = #{uuid}
</if>
</where>
</select>
<select id="selectById" parameterType="java.lang.String"
resultType="com.glxp.sale.admin.entity.sync.UdiRelevanceEntity">
select *
FROM basic_udirel
WHERE id = #{id}
</select>
<select id="selectByThirdId" parameterType="com.glxp.sale.admin.req.sync.FilterUdiInfoRequest"
resultType="com.glxp.sale.admin.entity.sync.UdiRelevanceEntity">
select * FROM basic_udirel
<where>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
</if>
<if test="thirdId1 != '' and thirdId1 != null">
AND thirdId1 = #{thirdId1}
</if>
<if test="thirdId2 != '' and thirdId2 != null">
AND thirdId2 = #{thirdId2}
</if>
<if test="thirdId3 != '' and thirdId3 != null">
AND thirdId3 = #{thirdId3}
</if>
<if test="thirdId4 != '' and thirdId4 != null">
AND thirdId4 = #{thirdId4}
</if>
<if test="mainId != '' and mainId != null">
AND mainId = #{mainId}
</if>
</where>
limit 1
</select>
<select id="filterEntity" parameterType="com.glxp.sale.admin.req.sync.FilterUdiInfoRequest"
resultType="com.glxp.sale.admin.entity.sync.UdiRelevanceEntity">
select * FROM basic_udirel
<where>
<if test="genKeyFk != '' and genKeyFk != null">
AND genKeyFk = #{genKeyFk}
</if>
</where>
</select>
<insert id="insertUdiRelevance" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.sync.UdiRelevanceEntity">
replace
INTO basic_udirel
(
thirdId,thirdName,uuid,isUseDy,updateTime,
thirdId1,thirdId2,thirdId3,thirdId4,thirdName1,thirdName2,thirdName3,thirdName4,manufactory,measname,ybbm,sptm,isDisable,isLock
,mainId,mainName,lockStatus,udplatCode,isAdavence
)
values
(
#{thirdId},
#{thirdName},
#{uuid},
#{isUseDy},
#{updateTime},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{manufactory},
#{measname},
#{ybbm},
#{sptm},
#{isDisable},
#{isLock},
#{mainId},
#{mainName},
#{lockStatus},
#{udplatCode},
#{isAdavence}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_udirel
WHERE id = #{id}
</delete>
<delete id="deleteByIds" parameterType="java.util.List">
DELETE FROM basic_udirel WHERE id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<delete id="deleteByUuid" parameterType="Map">
DELETE
FROM basic_udirel
WHERE uuid = #{uuid}
</delete>
<update id="updateUdiRelevance" parameterType="com.glxp.sale.admin.entity.sync.UdiRelevanceEntity">
UPDATE basic_udirel
<trim prefix="set" suffixOverrides=",">
<if test="thirdId != null">thirdId=#{thirdId},</if>
<if test="thirdName != null">thirdName=#{thirdName},</if>
<if test="uuid != null">uuid=#{uuid},</if>
<if test="isUseDy != null">isUseDy=#{isUseDy},</if>
<if test="thirdId1 != null">thirdId1=#{thirdId1},</if>
<if test="thirdId2 != null">thirdId2=#{thirdId2},</if>
<if test="thirdId3 != null">thirdId3=#{thirdId3},</if>
<if test="thirdId4 != null">thirdId4=#{thirdId4},</if>
<if test="thirdName1 != null">thirdName1=#{thirdName1},</if>
<if test="thirdName2 != null">thirdName2=#{thirdName2},</if>
<if test="thirdName3 != null">thirdName3=#{thirdName3},</if>
<if test="thirdName4 != null">thirdName4=#{thirdName4},</if>
<if test="manufactory != null">manufactory=#{manufactory},</if>
<if test="measname != null">measname=#{measname},</if>
<if test="ybbm != null">ybbm=#{ybbm},</if>
<if test="sptm != null">sptm=#{sptm},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="isDisable != null">isDisable=#{isDisable},</if>
<if test="isLock != null">isLock=#{isLock},</if>
<if test="mainId != null">mainId=#{mainId},</if>
<if test="lockStatus != null">lockStatus=#{lockStatus},</if>
<if test="mainName != null">mainName=#{mainName},</if>
<if test="udplatCode != null">udplatCode=#{udplatCode},</if>
<if test="isAdavence != null">isAdavence=#{isAdavence},</if>
</trim>
WHERE id = #{id}
</update>
<select id="batchSelectByUuid" resultType="com.glxp.sale.admin.entity.sync.UdiRelevanceEntity">
select *
from basic_udirel where uuid in
<foreach collection="uuids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<insert id="importUdiRelevance" parameterType="java.util.List">
replace into basic_udirel (id, thirdId, thirdName, uuid, isUseDy, updateTime, thirdId1, thirdId2, thirdId3,
thirdId4, thirdName1, thirdName2, thirdName3, thirdName4, ybbm, sptm, manufactory,
measname, isDisable, mainId, mainName, udplatCode,genKeyFk)
values
<foreach collection="udiRelevanceEntities" item="item" index="index" separator=",">
(#{item.id},
#{item.thirdId},
#{item.thirdName},
#{item.uuid},
#{item.isUseDy},
#{item.updateTime},
#{item.thirdId1},
#{item.thirdId2},
#{item.thirdId3},
#{item.thirdId4},
#{item.thirdName1},
#{item.thirdName2},
#{item.thirdName3},
#{item.thirdName4},
#{item.ybbm},
#{item.sptm},
#{item.manufactory},
#{item.measname},
#{item.isDisable},
#{item.mainId},
#{item.mainName},
#{item.udplatCode},#{item.genKeyFk})
</foreach>
</insert>
</mapper>
Loading…
Cancel
Save