订单扫码,耗材字段维护

master
anthonyywj2 3 years ago
parent dafbbe64f8
commit 731c62c1d2

@ -21,6 +21,7 @@ import com.glxp.api.admin.thread.HeartService;
import com.glxp.api.admin.thread.UpBasicService;
import com.glxp.api.admin.util.Constant;
import com.glxp.api.admin.util.RedisUtil;
import com.glxp.api.admin.util.SpGetHttp;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -49,6 +50,8 @@ public class SpsSyncExportStatusController {
private HeartService heartService;
@Resource
UpBasicService upBasicService;
@Resource
SpGetHttp spGetHttp;
@GetMapping("/spssync/basic/udiinfo/getStatus")
public BaseResponse getStatus(BasicExportStatusRequest basicExportStatusRequest) {
@ -91,6 +94,11 @@ public class SpsSyncExportStatusController {
return ResultVOUtils.error(500, "更新成功!");
}
@GetMapping("/spssync/basic/connect/test")
public BaseResponse testConnect() {
return spGetHttp.testConnect();
}
@GetMapping("/spssync/basic/schedule/lastTime")
public BaseResponse getLastUpdateTime(BasicExportTimeRequest basicExportTimeRequest) {
@ -179,4 +187,6 @@ public class SpsSyncExportStatusController {
}
return spsSyncDataRequest;
}
}

@ -35,6 +35,7 @@ import com.glxp.api.admin.service.auth.AuthAdminService;
import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.basic.BasicUnitMaintainService;
import com.glxp.api.admin.service.basic.BussinessTypeService;
import com.glxp.api.admin.service.basic.UdiInfoService;
import com.glxp.api.admin.service.basic.UdiRelevanceService;
import com.glxp.api.admin.service.business.StockOrderService;
import com.glxp.api.admin.service.info.CompanyProductRelevanceService;
@ -55,7 +56,6 @@ import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -103,7 +103,8 @@ public class WareHouseController {
StockOrderService stockOrderService;
@Resource
GennerOrderUtils gennerOrderUtils;
@Resource
private UdiInfoService udiInfoService;
@Resource
InvPreInProductDetailService invPreInProductDetailService;
@ -287,6 +288,16 @@ public class WareHouseController {
return ResultVOUtils.success();
}
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/saveTempCode")
public BaseResponse saveCode(@RequestBody WarehouseEntity warehouseEntity) {
boolean b = codesTempService.update(warehouseEntity);
if (b)
return ResultVOUtils.success("修改成功");
else return ResultVOUtils.error(500, "修改失败!");
}
@AuthRuleAnnotation("")
@GetMapping("warehouse/inout/deleteCodesTempById")
public BaseResponse deleteCodesTempById(@RequestParam("id") Long id) {
@ -341,6 +352,131 @@ public class WareHouseController {
}
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/enterCode")
public BaseResponse addEndterCode(@RequestBody AddEnterCodeRequest addEnterCodeRequest, BindingResult bindingResult) {
if (StrUtil.isEmpty(addEnterCodeRequest.getCode())) {
return ResultVOUtils.error(500, "条码不能为空!");
}
String code = "";
String originCode = addEnterCodeRequest.getOriginCode();
if (originCode == null)
originCode = "";
code = originCode + addEnterCodeRequest.getCode();
String newCode = addEnterCodeRequest.getCode();
//重复判断
if (StrUtil.isNotEmpty(addEnterCodeRequest.getOriginCode())) {
String tempOriginCode = addEnterCodeRequest.getOriginCode();
if (tempOriginCode.endsWith("\u001D")) {
tempOriginCode = tempOriginCode.replace("\u001D", "");
}
UdiEntity originUdiEntity = FilterUdiUtils.getUdi(tempOriginCode);
if (StrUtil.isNotEmpty(newCode)) {
if (newCode.startsWith("10")) {
if (StrUtil.isNotEmpty(originUdiEntity.getBatchNo())) {
BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误");
baseResponse.setData(originCode);
return baseResponse;
}
} else if (newCode.startsWith("17")) {
if (StrUtil.isNotEmpty(originUdiEntity.getExpireDate())) {
BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误");
baseResponse.setData(originCode);
return baseResponse;
}
} else if (newCode.startsWith("11")) {
if (StrUtil.isNotEmpty(originUdiEntity.getProduceDate())) {
BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误");
baseResponse.setData(originCode);
return baseResponse;
}
} else if (newCode.startsWith("21")) {
if (StrUtil.isNotEmpty(originUdiEntity.getSerialNo())) {
BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误");
baseResponse.setData(originCode);
return baseResponse;
}
// else {
// return ResultVOUtils.success(code);
// }
} else {
BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误");
baseResponse.setData(originCode);
return baseResponse;
}
}
}
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
if (udiEntity == null) {
BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误");
baseResponse.setData(originCode);
return baseResponse;
}
if (StrUtil.isNotEmpty(udiEntity.getBatchNo())) {
if (code.endsWith("10" + udiEntity.getBatchNo())) {
code = code + "\u001D";
}
}
UdiRelevanceResponse checkUdi = udiRelevanceService.selectByNameCode(udiEntity.getUdi());
if (checkUdi == null) {
return ResultVOUtils.error(500, "耗材字典不存在此产品!");
}
boolean checkSuccess = true;
//校验条码完整性
if (("是".equals(checkUdi.getScbssfbhph()) && StrUtil.isEmpty(udiEntity.getBatchNo()))) {
if (!checkUdi.isAllowNoBatch())
checkSuccess = false;
}
if (("是".equals(checkUdi.getScbssfbhscrq()) && StrUtil.isEmpty(udiEntity.getProduceDate()))
) {
if (!checkUdi.isAllowNoProduct())
checkSuccess = false;
}
if (("是".equals(checkUdi.getScbssfbhsxrq()) && StrUtil.isEmpty(udiEntity.getExpireDate()))
) {
if (!checkUdi.isAllowNoExpire())
checkSuccess = false;
}
if (("是".equals(checkUdi.getScbssfbhxlh()) && StrUtil.isEmpty(udiEntity.getSerialNo()))
) {
checkSuccess = false;
}
if (StrUtil.isNotEmpty(udiEntity.getSerialNo()) && udiEntity.getSerialNo().length() > 20) {
checkSuccess = false;
return ResultVOUtils.error(504, "序列号超出20位");
}
if (StrUtil.isNotEmpty(udiEntity.getBatchNo()) && udiEntity.getBatchNo().length() > 20) {
checkSuccess = false;
return ResultVOUtils.error(504, "批次号超出20位");
}
if (StrUtil.isEmpty(udiEntity.getSerialNo()) && StrUtil.isEmpty(udiEntity.getBatchNo())) {
checkSuccess = false;
}
if (checkSuccess) {
if (code.endsWith("\u001D")) {
code = code.replace("\u001D", "");
}
return ResultVOUtils.success(code);
} else {
if (newCode.startsWith("21")) {
BaseResponse baseResponse = ResultVOUtils.error(503, "当前条码未完成,是否继续添加?");
baseResponse.setData(code);
return baseResponse;
}
}
BaseResponse baseResponse = ResultVOUtils.error(502, "校验未完成");
baseResponse.setData(code);
return baseResponse;
}
//网页端数据上传调用接口
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/addOrderWeb")
@ -357,6 +493,20 @@ public class WareHouseController {
if (udiEntity == null)
return ResultVOUtils.error(500, "无效条码!");
if (StrUtil.isNotEmpty(addOrderRequest.getBatchNo())) {
udiEntity.setBatchNo(addOrderRequest.getBatchNo());
}
if (StrUtil.isNotEmpty(addOrderRequest.getProduceDate())) {
udiEntity.setProduceDate(addOrderRequest.getProduceDate());
}
if (StrUtil.isNotEmpty(addOrderRequest.getExpireDate())) {
udiEntity.setExpireDate(addOrderRequest.getExpireDate());
}
if (StrUtil.isNotEmpty(addOrderRequest.getSerialNo())) {
udiEntity.setSerialNo(addOrderRequest.getSerialNo());
}
if (StrUtil.isNotEmpty(udiEntity.getSerialNo()) && udiEntity.getSerialNo().length() > 20) {
return ResultVOUtils.error(500, "无效条码!序列号超出最大范围");
}
@ -370,6 +520,9 @@ public class WareHouseController {
if (StrUtil.isEmpty(udiEntity.getSerialNo()) && StrUtil.isEmpty(udiEntity.getBatchNo())) {
return ResultVOUtils.error(500, "批次号不能为空!");
}
BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity);
if (checkOriginCodeRes != null)
return checkOriginCodeRes;
//过期提醒:
SystemParamConfigEntity expireParamConfigEntity = systemParamConfigService.selectByParamKey("expire_date_tip");
@ -422,6 +575,10 @@ public class WareHouseController {
return ResultVOUtils.error(500, "超出预验收库存数量");
}
}
} else {
if (invProductDetailEntity.getCount() < 1) {
return ResultVOUtils.error(500, "超出预验收库存数量");
}
}
}
}
@ -576,7 +733,7 @@ public class WareHouseController {
return null;
}
//校验产品ID唯一性
public BaseResponse checkRelId(BussinessTypeEntity bussinessTypeEntity, WarehouseEntity warehouseEntity) {
String unitFk = null;
@ -606,6 +763,7 @@ public class WareHouseController {
return null;
}
//校验供应商唯一性
public BaseResponse checkSupId(BussinessTypeEntity bussinessTypeEntity, WarehouseEntity warehouseEntity) {
String originSupId = ioTransInoutService.checkOriginExitSup(bussinessTypeEntity, warehouseEntity);
if (originSupId != null) {
@ -634,6 +792,63 @@ public class WareHouseController {
return null;
}
//校验条码完整性
public BaseResponse checkCode(WarehouseEntity warehouseEntity) {
//校验条码的完整性
String errMsg = "";
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(warehouseEntity.getRelId());
if (StrUtil.isEmpty(warehouseEntity.getBatchNo()) &&
"是".equals(udiRelevanceResponse.getScbssfbhph()) && !udiRelevanceResponse.isAllowNoBatch()) {
errMsg = errMsg + ",批次号";
}
if (StrUtil.isEmpty(warehouseEntity.getProduceDate()) &&
"是".equals(udiRelevanceResponse.getScbssfbhscrq()) && !udiRelevanceResponse.isAllowNoProduct()) {
errMsg = errMsg + ",生产日期";
}
if (StrUtil.isEmpty(warehouseEntity.getExpireDate()) &&
"是".equals(udiRelevanceResponse.getScbssfbhsxrq()) && !udiRelevanceResponse.isAllowNoExpire()) {
errMsg = errMsg + ",失效日期";
}
if (StrUtil.isNotEmpty(errMsg)) {
BaseResponse baseResponse = ResultVOUtils.error(507, "请补齐" + errMsg.substring(1) + "");
baseResponse.setData(warehouseEntity);
return baseResponse;
}
return null;
}
public BaseResponse checkOriginCode(UdiEntity udiEntity) {
//校验条码的完整性
String errMsg = "";
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(udiEntity.getUdi());
if (StrUtil.isEmpty(udiEntity.getBatchNo()) &&
"是".equals(udiRelevanceResponse.getScbssfbhph()) && !udiRelevanceResponse.isAllowNoBatch()) {
errMsg = errMsg + ",批次号";
}
if (StrUtil.isEmpty(udiEntity.getProduceDate()) &&
"是".equals(udiRelevanceResponse.getScbssfbhscrq()) && !udiRelevanceResponse.isAllowNoProduct()) {
errMsg = errMsg + ",生产日期";
}
if (StrUtil.isEmpty(udiEntity.getExpireDate()) &&
"是".equals(udiRelevanceResponse.getScbssfbhsxrq()) && !udiRelevanceResponse.isAllowNoExpire()) {
errMsg = errMsg + ",失效日期";
}
if (StrUtil.isEmpty(udiEntity.getSerialNo()) &&
"是".equals(udiRelevanceResponse.getScbssfbhxlh())) {
errMsg = errMsg + ",序列号";
}
if (StrUtil.isNotEmpty(errMsg)) {
BaseResponse baseResponse = ResultVOUtils.error(507, "请补齐" + errMsg.substring(1) + "");
baseResponse.setData(udiEntity);
return baseResponse;
}
return null;
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/addCode/updateBindSup")
@ -703,7 +918,6 @@ public class WareHouseController {
}
@AuthRuleAnnotation("")
@PostMapping("/admin/warehouse/inout/save")
public BaseResponse save(@RequestBody @Valid WarehouseSaveRequest warehouseSaveRequest,

@ -218,7 +218,7 @@ public class ThrProductsController {
public BaseResponse productsDlAll(@RequestBody FilterThrProductsRequest filterThrProductsRequest) {
filterThrProductsRequest.setThirdSysFk(filterThrProductsRequest.getThirdSys());
String data = (String) redisUtil.get(Constant.dlThrProducts);
if (false) { //data != null && data.equals("true")
if (data != null && data.equals("true")) { //data != null && data.equals("true")
return ResultVOUtils.error(500, "当前任务正在下载更新产品信息,请稍后重试!");
} else {
redisUtil.set(Constant.dlThrProducts, "true", 60 * 10);

@ -4,6 +4,7 @@ import lombok.Data;
@Data
public class UdiInfoEntity {
private Integer id;
private String nameCode;
private String packRatio;
@ -58,6 +59,9 @@ public class UdiInfoEntity {
private String supId;
private Boolean isCheck;
private boolean allowNoBatch;
private boolean allowNoExpire;
private boolean allowNoProduct;
public Integer getId() {
return id;

@ -32,7 +32,6 @@ public class UdiRelevanceEntity {
private Boolean isAdavence;
private String supName;
private String originUuid;
private boolean allowNoBatch;
private String price;
public Integer getLockStatus() {
@ -40,5 +39,4 @@ public class UdiRelevanceEntity {
return 1;
return lockStatus;
}
}

@ -0,0 +1,9 @@
package com.glxp.api.admin.req.inout;
import lombok.Data;
@Data
public class AddEnterCodeRequest {
private String originCode;
private String code;
}

@ -20,5 +20,10 @@ public class AddOrderRequest {
private boolean outChangeEnable;
private boolean ignoreExpire;
private boolean ignoreRecentExpire;
private boolean ignoreCode;
private boolean preCheck;
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
}

@ -4,7 +4,6 @@ import lombok.Data;
@Data
public class UdiRelevanceResponse {
private Integer id;
private String thirdId;
private String thirdName;
@ -67,6 +66,9 @@ public class UdiRelevanceResponse {
private String companyName;
private String originUuid;
private boolean allowNoBatch;
private boolean allowNoExpire;
private boolean allowNoProduct;
private String price;
public int getBhzxxsbzsl() {

@ -4,7 +4,6 @@ import lombok.Data;
@Data
public class CompanyProductRelevanceResponse {
private int id;
private Integer rlId;
private String thirdId;
@ -65,5 +64,9 @@ public class CompanyProductRelevanceResponse {
private String scbssfbhsxrq;
private String cpms;
private String supName;
private boolean allowNoBatch;
private boolean allowNoExpire;
private boolean allowNoProduct;
private String price;
}

@ -131,7 +131,12 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
@Override
public boolean unbindThrWarehouse(Integer id, String sysId) {
return invWarehouseDao.updateThridId(id, null, sysId);
// InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectById(id + "");
// ReflectUtil.setFieldValue(invWarehouseEntity, sysId, null);
// return invWarehouseDao.insertInvWarehouse(invWarehouseEntity);
}
@Override

@ -58,7 +58,7 @@ public class HeartTask implements SchedulingConfigurer {
SyncDataSetEntity syncDataSetEntity = syncDataSetDao.selectSet();
if (syncDataSetEntity.isDownstreamEnable()) {
//定时上传最近更新数据至上游轮询时间
long timeInterval1 = syncDataSetEntity.getSyncTime() * 60 * 1000;
long timeInterval1 = syncDataSetEntity.getSyncTime() * 60 * 1000L;
long curTime1 = System.currentTimeMillis();
Long lastTime1 = (Long) redisUtil.get("SPS_SYNC_UPLOAD_DATA");
if (lastTime1 == null) {

@ -7,10 +7,7 @@ import com.alibaba.fastjson.TypeReference;
import com.glxp.api.admin.config.WebSocketServer;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrCorpEntity;
import com.glxp.api.admin.entity.thrsys.ThrCorpExportLogEntity;
import com.glxp.api.admin.entity.thrsys.ThrCorpImportDetailEntity;
import com.glxp.api.admin.entity.thrsys.ThrCorpImportLogEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.httpclient.ErpBasicClient;
import com.glxp.api.admin.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.admin.req.basic.FilterUdiIpLogRequest;
@ -24,10 +21,7 @@ import com.glxp.api.admin.service.thrsys.ThrCorpExportLogService;
import com.glxp.api.admin.service.thrsys.ThrCorpImportDetailService;
import com.glxp.api.admin.service.thrsys.ThrCorpImportLogService;
import com.glxp.api.admin.service.thrsys.ThrCorpService;
import com.glxp.api.admin.util.Constant;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.admin.util.HttpClient;
import com.glxp.api.admin.util.RedisUtil;
import com.glxp.api.admin.util.*;
import com.glxp.api.common.res.BaseResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
@ -132,7 +126,11 @@ public class ThrCorpsDlService {
return thrProductsEntity;
}
).collect(Collectors.toList());
thrCorpService.insertThrCorpss(thrCorpEntities);
List<List<ThrCorpEntity>> splitList = CustomUtil.splitList(thrCorpEntities, 100);
for (List<ThrCorpEntity> data : splitList) {
thrCorpService.insertThrCorpss(data);
}
redisUtil.set(Constant.dlThrProducts, "false");
WebSocketServer.sendInfo("往来单位信息下载已完成,请刷新查看!", "sid");
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
@ -277,11 +275,12 @@ public class ThrCorpsDlService {
).collect(Collectors.toList());
thrCorpImportDetailService.insertCorpDetailImports(thrCorpImportDetailEntities);
page++;
if (page * limit < erpCrops.getData().getTotal()) {
return page;
if (erpUnitsResponses.size() >= limit)
page++;
else {
return -1;
}
return page;
}
thrCorpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrCorpImportLogService.updateImportLog(thrCorpImportLogEntity);

@ -28,7 +28,7 @@
<select id="filterUdiGp" parameterType="com.glxp.api.admin.req.basic.CompanyProductRelevanceRequest"
resultType="com.glxp.api.admin.res.info.CompanyProductRelevanceResponse">
select
company_product_relevance.id,company_product_relevance.customerId,company_product_relevance.auditStatus,company_product_relevance.price,
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,
@ -36,19 +36,22 @@
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_udirel.manufactory,basic_udirel.measname,basic_udirel.lockStatus,basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
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.bzcj,basic_products.addType,basic_udirel.isDisable,
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_corp.name companyName,
basic_udirel.mainId,basic_udirel.mainName,basic_udirel.isAdavence,basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid,basic_corp.name companyName,basic_udirel.allowNoBatch
basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid,company_product_relevance.price
FROM company_product_relevance
inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id
@ -60,15 +63,15 @@
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat(#{ylqxzcrbarmc},'%')
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat('%',#{ggxh},'%')
</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="ggxh != '' and ggxh != null">
AND ggxh LIKE concat('%',#{ggxh},'%')
</if>
<if test="unionCode != '' and unionCode != null">
and (
nameCode LIKE concat('%',#{unionCode},'%')
@ -133,6 +136,9 @@
<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>
@ -256,6 +262,7 @@
)
</insert>
<insert id="importCompanyProductRelevance"
parameterType="com.glxp.api.admin.entity.basic.CompanyProductRelevanceEntity">
replace

@ -43,13 +43,15 @@
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid
basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid,basic_products.allowNoBatch,
basic_products.allowNoExpire,basic_products.allowNoProduct
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},'%')
@ -87,9 +89,11 @@
<if test="originUuid != '' and originUuid != null">
AND originUuid = #{originUuid}
</if>
</where>
ORDER BY updateTime DESC
</select>
<!--// AND company_product_relevance.auditStatus = 1-->
<select id="findById" parameterType="java.lang.String"
resultType="com.glxp.api.admin.entity.basic.UdiInfoEntity">
SELECT *
@ -97,7 +101,6 @@
WHERE (id = #{id}) limit 1
</select>
<select id="findByUuid" parameterType="java.lang.String"
resultType="com.glxp.api.admin.entity.basic.UdiInfoEntity">
SELECT *
@ -128,7 +131,7 @@
nameCode,packRatio,packLevel,bhxjsl,
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,addType,deviceRecordKey,
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
,diType,productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,manufactory,originUuid)
,diType,productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,manufactory,originUuid,allowNoBatch,allowNoExpire,allowNoProduct)
values
(
#{id},
@ -159,7 +162,9 @@
#{scbssfbhph},
#{scbssfbhxlh},
#{scbssfbhscrq},
#{scbssfbhsxrq},#{cpms},#{manufactory},#{originUuid}
#{scbssfbhsxrq},
#{cpms},
#{manufactory},#{originUuid},#{allowNoBatch},#{allowNoExpire},#{allowNoProduct}
)
</insert>
@ -169,7 +174,7 @@
nameCode,packRatio,packLevel,bhxjsl,
bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,addType,deviceRecordKey,
cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber
,diType,productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,manufactory,originUuid
,diType,productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,manufactory,originUuid,allowNoBatch,allowNoExpire,allowNoProduct
)
values
@ -201,7 +206,7 @@
#{item.diType},#{item.productType}, #{item.scbssfbhph},
#{item.scbssfbhxlh},
#{item.scbssfbhscrq},
#{item.scbssfbhsxrq},#{item.cpms},#{item.manufactory},#{item.originUuid}
#{item.scbssfbhsxrq},#{item.cpms},#{item.manufactory},#{item.originUuid},#{item.allowNoBatch},#{item.allowNoExpire},#{item.allowNoProduct}
)
</foreach>
</insert>
@ -253,7 +258,9 @@
<if test="scbssfbhsxrq != null">scbssfbhsxrq=#{scbssfbhsxrq},</if>
<if test="cpms != null">cpms=#{cpms},</if>
<if test="originUuid != null">originUuid=#{originUuid},</if>
<if test="allowNoBatch != null">allowNoBatch=#{allowNoBatch},</if>
<if test="allowNoExpire != null">allowNoExpire=#{allowNoExpire},</if>
<if test="allowNoProduct != null">allowNoProduct=#{allowNoProduct},</if>
</trim>
WHERE nameCode = #{nameCode}
</update>
@ -266,12 +273,21 @@
</foreach>
</select>
<select id="batchSelectByOriginUuid" resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
select *
from basic_products where originUuid in
<foreach collection="uuids" item="item" index="index" separator="," 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,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,originUuid) values
productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,originUuid,allowNoBatch,allowNoExpire,allowNoProduct) values
<foreach collection="udiInfoEntities" item="item" index="index" separator=",">
(#{item.id},
#{item.nameCode},
@ -305,7 +321,7 @@
#{item.productType}, #{item.scbssfbhph},
#{item.scbssfbhxlh},
#{item.scbssfbhscrq},
#{item.scbssfbhsxrq},#{item.cpms},#{item.originUuid})
#{item.scbssfbhsxrq},#{item.cpms},#{item.originUuid},#{allowNoBatch},#{allowNoExpire},#{allowNoProduct})
</foreach>
</insert>
</mapper>

@ -12,7 +12,10 @@
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_udirel.mainId,basic_udirel.allowNoBatch,basic_udirel.price,
basic_udirel.isAdavence,basic_udirel.mainId,basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_udirel.price,
basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,
basic_products.bhxjsl,basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,basic_products.bzcj,
@ -85,7 +88,6 @@
</where>
ORDER BY updateTime DESC
</select>
<select id="filterUdiJoinSup" parameterType="com.glxp.api.admin.req.basic.FilterUdiInfoRequest"
@ -95,9 +97,11 @@
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.manufactory,basic_udirel.measname,basic_udirel.ybbm,basic_udirel.sptm,basic_udirel.price,
basic_udirel.isDisable, basic_udirel.isLock,basic_udirel.lockStatus,basic_udirel.udplatCode,
basic_udirel.isAdavence,basic_udirel.mainId,basic_udirel.allowNoBatch,basic_udirel.price,
basic_udirel.isAdavence,basic_udirel.mainId,basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,
basic_products.bhxjsl,basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,basic_products.bzcj,
@ -186,8 +190,10 @@
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_udirel.allowNoBatch,
basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,basic_products.bhxjsl,basic_udirel.price,
basic_udirel.manufactory,basic_udirel.measname,basic_udirel.udplatCode,basic_products.allowNoBatch,
basic_products.allowNoExpire,basic_products.allowNoProduct,
basic_udirel.price,
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,
@ -257,7 +263,7 @@
AND basic_products.originUuid is NULL
</if>
<if test="filterType != null and filterType == 3">
AND thirdId is NULL and basic_products.originUuid <![CDATA[<>]]> ''
AND mainId is NULL and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 4">
AND thirdId1 is NULL and basic_products.originUuid <![CDATA[<>]]> ''
@ -271,6 +277,7 @@
<if test="filterType != null and filterType == 7">
AND thirdId4 is NULL and basic_products.originUuid <![CDATA[<>]]> ''
</if>
<if test="filterType != null and filterType == 10">
AND basic_udirel.updateTime is NULL
</if>
@ -301,14 +308,6 @@
</select>
<select id="selectById" parameterType="java.lang.String"
resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
select *
FROM basic_udirel
WHERE id = #{id}
</select>
<select id="selectByOrigiUuid" parameterType="com.glxp.api.admin.req.basic.FilterUdiInfoRequest"
resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
select * from basic_udirel INNER JOIN basic_products on basic_udirel.uuid = basic_products.uuid
@ -329,6 +328,12 @@
</select>
<select id="selectById" parameterType="java.lang.String"
resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
select *
FROM basic_udirel
WHERE id = #{id}
</select>
<select id="selectByThirdId" parameterType="com.glxp.api.admin.req.basic.FilterUdiInfoRequest"
resultType="com.glxp.api.admin.entity.basic.UdiRelevanceEntity">
select * FROM basic_udirel
@ -393,7 +398,7 @@
(id,
thirdId,thirdName,uuid,isUseDy,updateTime,
thirdId1,thirdId2,thirdId3,thirdId4,thirdName1,thirdName2,thirdName3,thirdName4,manufactory,measname,ybbm,sptm,isDisable,isLock
,mainId,mainName,lockStatus,udplatCode,isAdavence,supName,allowNoBatch,price
,mainId,mainName,lockStatus,udplatCode,isAdavence,supName,price
)
values
(
@ -422,7 +427,7 @@
#{lockStatus},
#{udplatCode},
#{isAdavence},
#{supName},#{allowNoBatch},#{price}
#{supName},#{price}
)
</insert>
@ -434,7 +439,7 @@
(id,
thirdId,thirdName,uuid,isUseDy,updateTime,
thirdId1,thirdId2,thirdId3,thirdId4,thirdName1,thirdName2,thirdName3,thirdName4,manufactory,measname,ybbm,sptm,isDisable,isLock
,mainId,mainName,lockStatus,udplatCode,isAdavence,supName,allowNoBatch,price
,mainId,mainName,lockStatus,udplatCode,isAdavence,supName,price
)
values
(
@ -463,9 +468,11 @@
#{lockStatus},
#{udplatCode},
#{isAdavence},
#{supName},#{allowNoBatch},#{price}
#{supName},
#{price}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_udirel
@ -511,7 +518,6 @@
<if test="udplatCode != null">udplatCode=#{udplatCode},</if>
<if test="isAdavence != null">isAdavence=#{isAdavence},</if>
<if test="supName != null">supName=#{supName},</if>
<if test="allowNoBatch != null">allowNoBatch=#{allowNoBatch},</if>
<if test="price != null">price=#{price},</if>
</trim>
@ -536,7 +542,7 @@
<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,supName,allowNoBatch,price)
measname, isDisable, mainId, mainName, udplatCode,supName,price)
values
<foreach collection="udiRelevanceEntities" item="item" index="index" separator=",">
(#{item.id},
@ -560,7 +566,7 @@
#{item.isDisable},
#{item.mainId},
#{item.mainName},
#{item.udplatCode},#{item.supName},#{item.allowNoBatch},#{item.price})
#{item.udplatCode},#{item.supName},#{item.price})
</foreach>
</insert>
</mapper>

@ -5,7 +5,7 @@
<select id="filterStockOrderDetail" parameterType="com.glxp.api.admin.req.business.StockOrderDetailFilterRequest"
resultType="com.glxp.api.admin.entity.business.StockOrderDetailEntity">
select stock_order_detail.*,basic_udirel.allowNoBatch from stock_order_detail
select stock_order_detail.* from stock_order_detail
left join basic_udirel on stock_order_detail.relId = basic_udirel.id
<where>
<if test="orderIdFk != '' and orderIdFk!=null">

@ -227,8 +227,8 @@
<update id="updateThridId" parameterType="Map">
update inv_warehouse
set ${sysId} = ${thridWarehouseId,jdbcType=VARCHAR}
where id = ${id}
set ${sysId} = #{thridWarehouseId,jdbcType=VARCHAR}
where id = #{id}
</update>
<insert id="importInvWarehouse" parameterType="java.util.List">
replace into inv_warehouse (id, pid, code, `name`, advanceType, isDefault, status,

Loading…
Cancel
Save