库存校验比对

dev
anthonywj 2 years ago
parent 3b819eab23
commit d19f96d2ca

@ -397,7 +397,6 @@ public class IoCodeTempController extends BaseController {
//三期校验 //三期校验
if (bussinessTypeEntity.isCodeFillCheck()) { if (bussinessTypeEntity.isCodeFillCheck()) {
BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity); BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity);
if (checkOriginCodeRes != null) { if (checkOriginCodeRes != null) {
IoCodeLostEntity codeLostEntity = codeLostService.findByCode(code); IoCodeLostEntity codeLostEntity = codeLostService.findByCode(code);
@ -415,7 +414,6 @@ public class IoCodeTempController extends BaseController {
udiEntity.setExpireDate(codeLostEntity.getExpireDate()); udiEntity.setExpireDate(codeLostEntity.getExpireDate());
udiEntity.setProduceDate(codeLostEntity.getProduceDate()); udiEntity.setProduceDate(codeLostEntity.getProduceDate());
} }
if (StrUtil.isNotEmpty(orderId)) { if (StrUtil.isNotEmpty(orderId)) {
List<IoCodeTempEntity> ioCodeEnttities = codeTempService.findByOrderId(orderId); List<IoCodeTempEntity> ioCodeEnttities = codeTempService.findByOrderId(orderId);
IoCodeTempEntity ioCodeEnttity = isExitLocal(code, ioCodeEnttities); IoCodeTempEntity ioCodeEnttity = isExitLocal(code, ioCodeEnttities);
@ -425,6 +423,20 @@ public class IoCodeTempController extends BaseController {
} else } else
return checkOriginCodeRes; return checkOriginCodeRes;
} }
} else {
BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity);
if (checkOriginCodeRes != null) {
IoCodeLostEntity codeLostEntity = codeLostService.findByCode(code);
if (codeLostEntity != null) {
udiEntity.setBatchNo(codeLostEntity.getBatchNo());
udiEntity.setExpireDate(codeLostEntity.getExpireDate());
udiEntity.setProduceDate(codeLostEntity.getProduceDate());
checkOriginCodeRes = checkOriginCode(udiEntity);
if (checkOriginCodeRes != null)
return checkOriginCodeRes;
} else
return checkOriginCodeRes;
}
} }
@ -759,7 +771,6 @@ public class IoCodeTempController extends BaseController {
} }
} }
BaseResponse baseResponse = checkRelId(codeEnttity, unitFk); BaseResponse baseResponse = checkRelId(codeEnttity, unitFk);
if (bussinessTypeEntity.getCheckCertExpire() == 2 && udiRelevanceResponse.isNeedCert()) { if (bussinessTypeEntity.getCheckCertExpire() == 2 && udiRelevanceResponse.isNeedCert()) {

@ -0,0 +1,89 @@
package com.glxp.api.controller.inv;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.req.inv.ErrorMsgRequest;
import com.glxp.api.req.inv.FilterInvPreProductRequest;
import com.glxp.api.req.inv.FilterInvPreinProductRequest;
import com.glxp.api.req.inv.FilterInvProductRequest;
import com.glxp.api.res.inv.InvPreProductResponse;
import com.glxp.api.res.inv.InvPreinProductResponse;
import com.glxp.api.res.inv.InvProductPageResponse;
import com.glxp.api.res.inv.InvProductResponse;
import com.glxp.api.service.inv.InvPreProductService;
import com.glxp.api.service.inv.InvPreinProductService;
import com.glxp.api.service.inv.InvProductService;
import com.glxp.api.util.FileUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
/**
*
*/
@RestController
public class VailInvController {
@Resource
private InvProductService invProductService;
@Resource
private InvPreinProductService invPreinProductService;
@Resource
private InvPreProductService invPreProductService;
@Value("${err_path}")
String errPath;
@AuthRuleAnnotation("")
@GetMapping("/spms/inv/product/vail")
public BaseResponse invProductVail(FilterInvProductRequest filterInvProductRequest) {
List<InvProductResponse> list = invProductService.filterListProduct(filterInvProductRequest);
PageInfo<InvProductResponse> pageInfo = new PageInfo<>(list);
InvProductPageResponse<InvProductResponse> pageResponse = new InvProductPageResponse();
pageResponse.setList(pageInfo.getList());
pageResponse.setTotal(pageInfo.getTotal());
return ResultVOUtils.success(pageResponse);
}
@AuthRuleAnnotation("")
@GetMapping("/spms/inv/pre/product/vail")
public BaseResponse invPreProductVail(FilterInvPreProductRequest filterInvProductRequest) {
List<InvPreProductResponse> list = invPreProductService.filterList(filterInvProductRequest);
PageInfo<InvPreProductResponse> pageInfo = new PageInfo<>(list);
InvProductPageResponse<InvPreProductResponse> pageResponse = new InvProductPageResponse();
pageResponse.setList(pageInfo.getList());
pageResponse.setTotal(pageInfo.getTotal());
return ResultVOUtils.success(pageResponse);
}
@AuthRuleAnnotation("")
@GetMapping("/spms/inv/preIn/product/vail")
public BaseResponse invPreInProductVail(FilterInvPreinProductRequest filterInvProductRequest) {
List<InvPreinProductResponse> list = invPreinProductService.filterList(filterInvProductRequest);
PageInfo<InvPreinProductResponse> pageInfo = new PageInfo<>(list);
InvProductPageResponse<InvPreinProductResponse> pageResponse = new InvProductPageResponse();
pageResponse.setList(pageInfo.getList());
pageResponse.setTotal(pageInfo.getTotal());
return ResultVOUtils.success(pageResponse);
}
@PostMapping("/spms/inv/vail/errMsg")
public void genErrorLog(@RequestBody ErrorMsgRequest errorMsgRequest) {
try {
FileUtils.writeFile(errPath, "库存校验-", errorMsgRequest.getErrMsg());
} catch (IOException e) {
e.printStackTrace();
}
}
}

@ -0,0 +1,8 @@
package com.glxp.api.req.inv;
import lombok.Data;
@Data
public class ErrorMsgRequest {
String errMsg;
}

@ -1,6 +1,8 @@
package com.glxp.api.util; package com.glxp.api.util;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import org.apache.commons.beanutils.PropertyUtilsBean;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -949,4 +951,24 @@ public class FileUtils {
e.printStackTrace(); e.printStackTrace();
} }
} }
public static String writeFile(String filePath, String fileDesc, String content) throws IOException {
filePath = String.format("%s/%s", filePath, DateUtil.getDate());
String fileFullPath = String.format("%s/%s-%s.udi", filePath, fileDesc, IdUtil.fastSimpleUUID());
File file = new File(filePath);
if (!file.exists()) {
file.mkdirs();
}
file = new File(fileFullPath);
while (!file.createNewFile()) {
fileFullPath = String.format("%s/%s/%s-%s.udi", filePath, DateUtil.getDate(), fileDesc, IdUtil.fastSimpleUUID());
file = new File(fileFullPath);
}
FileWriter fileWriter = new FileWriter(file);
fileWriter.write(content);
fileWriter.flush();
fileWriter.close();
return fileFullPath;
}
} }

@ -3,7 +3,7 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms_pt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root username: root
password: 123456 password: 123456
hikari: hikari:
@ -45,6 +45,7 @@ logging:
file_path: d:/udi/udiwms/udiwmsfile/ file_path: d:/udi/udiwms/udiwmsfile/
back_file_path: d:/share/udisps/back/ back_file_path: d:/share/udisps/back/
err_path: d:/udi/udiwms/err/
UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test
SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs

@ -45,6 +45,7 @@ logging:
file_path: /udi/udiwms/udiwmsfile/ file_path: /udi/udiwms/udiwmsfile/
back_file_path: /share/udisps/back/ back_file_path: /share/udisps/back/
err_path: d:/udi/udiwms/err/
UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test
SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs

@ -45,6 +45,7 @@ logging:
file_path: /udi/udiwms/udiwmsfile/ file_path: /udi/udiwms/udiwmsfile/
back_file_path: /share/udisps/back/ back_file_path: /share/udisps/back/
err_path: /udi/udiwms/err/
UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test
SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs

@ -51,6 +51,7 @@ knife4j:
file_path: /udi/udiwms/udiwmsfile/ file_path: /udi/udiwms/udiwmsfile/
back_file_path: /share/udisps/back/ back_file_path: /share/udisps/back/
err_path: /udi/udiwms/err/
UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test
SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs

@ -45,6 +45,7 @@ logging:
file_path: /udi/udiwms/udiwmsfile/ file_path: /udi/udiwms/udiwmsfile/
back_file_path: /share/udisps/back/ back_file_path: /share/udisps/back/
err_path: /udi/udiwms/err/
UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test
SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs

@ -45,6 +45,7 @@ logging:
file_path: /udi/udiwms/udiwmsfile/ file_path: /udi/udiwms/udiwmsfile/
back_file_path: /share/udisps/back/ back_file_path: /share/udisps/back/
err_path: /udi/udiwms/err/
UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test
SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs

Loading…
Cancel
Save