代码备份(基础信息转json)
parent
c95a3ccf7b
commit
5e43d9f6fa
@ -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);
|
||||||
|
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
@ -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;
|
||||||
|
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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 + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -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…
Reference in New Issue