代码备份

zhairh
anthonyywj2 3 years ago
parent 38282debf7
commit 203425813c

@ -76,6 +76,11 @@ public class EntrustReceController {
Integer userId = customerService.getUserId(); Integer userId = customerService.getUserId();
entrustReceEntity.setUserId(userId + ""); entrustReceEntity.setUserId(userId + "");
entrustReceEntity.setUpdateTime(new Date()); entrustReceEntity.setUpdateTime(new Date());
EntrustReceEntity temp = entrustReceService.findByUnique(entrustReceEntity.getAction(), entrustReceEntity.getEntrustUser());
if (temp != null) {
return ResultVOUtils.error(500, "已存在相同的委托验收");
}
boolean b = entrustReceService.insertEntrustRec(entrustReceEntity); boolean b = entrustReceService.insertEntrustRec(entrustReceEntity);
if (b) { if (b) {
return ResultVOUtils.success("添加成功!"); return ResultVOUtils.success("添加成功!");
@ -89,6 +94,12 @@ public class EntrustReceController {
@PostMapping("/spms/entrust/rece/update") @PostMapping("/spms/entrust/rece/update")
public BaseResponse updateEntrustRece(@RequestBody EntrustReceEntity entrustReceEntity) { public BaseResponse updateEntrustRece(@RequestBody EntrustReceEntity entrustReceEntity) {
entrustReceEntity.setUpdateTime(new Date()); entrustReceEntity.setUpdateTime(new Date());
EntrustReceEntity temp = entrustReceService.findByUnique(entrustReceEntity.getAction(), entrustReceEntity.getEntrustUser());
if (temp != null) {
return ResultVOUtils.error(500, "已存在相同的委托验收");
}
boolean b = entrustReceService.updateEntrustRec(entrustReceEntity); boolean b = entrustReceService.updateEntrustRec(entrustReceEntity);
if (b) { if (b) {
return ResultVOUtils.success("添加成功!"); return ResultVOUtils.success("添加成功!");

@ -68,7 +68,7 @@ public class ProductInfoController {
UdiEntity udiEntity = null; UdiEntity udiEntity = null;
if (key != null) { if (key != null) {
udiEntity = FilterUdiUtils.getUdi(key); udiEntity = FilterUdiUtils.getUdi(key);
key = udiEntity.getUdi();// FilterUdiUtils.getDiStr(key); key = udiEntity.getUdi();
productInfoFilterRequest.setNameCode(key); productInfoFilterRequest.setNameCode(key);
} }
@ -88,21 +88,17 @@ public class ProductInfoController {
List<ProductInfoEntity> returns = new ArrayList<>(); List<ProductInfoEntity> returns = new ArrayList<>();
if (packInfos != null && packInfos.size() > 0) { if (packInfos != null && packInfos.size() > 0) {
for (ProductInfoEntity temp : packInfos) { for (ProductInfoEntity temp : packInfos) {
// if (!temp.getNameCode().equals(productInfoEntity.getNameCode())) {
returns.add(temp); returns.add(temp);
if (udiEntity != null) { if (udiEntity != null) {
productInfoEntity.setBatchNo(udiEntity.getBatchNo()); productInfoEntity.setBatchNo(udiEntity.getBatchNo());
productInfoEntity.setProduceDate(udiEntity.getProduceDate()); productInfoEntity.setProduceDate(udiEntity.getProduceDate());
productInfoEntity.setExpireDate(udiEntity.getExpireDate()); productInfoEntity.setExpireDate(udiEntity.getExpireDate());
} }
// }
} }
productInfoResponse.setPackages(returns); productInfoResponse.setPackages(returns);
} }
return ResultVOUtils.success(productInfoResponse); return ResultVOUtils.success(productInfoResponse);
} else { } else {
// if (key != null && key.length() >= 13)
// asyncDownloadTask.downloadByDi(key); //后台自动下载
return ResultVOUtils.error(500, "未找到产品信息"); return ResultVOUtils.error(500, "未找到产品信息");
} }
} }

@ -131,18 +131,13 @@ public class UdiInfoController {
if (StrUtil.isEmpty(filterUdiInfoRequest.getNameCode())) { if (StrUtil.isEmpty(filterUdiInfoRequest.getNameCode())) {
return ResultVOUtils.error(500, "DI不能为空"); return ResultVOUtils.error(500, "DI不能为空");
} }
ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest(); ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
productInfoFilterRequest.setNameCode(filterUdiInfoRequest.getNameCode()); productInfoFilterRequest.setNameCode(filterUdiInfoRequest.getNameCode());
try { try {
BaseResponse<PageSimpleResponse<ProductInfoEntity>> udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest); BaseResponse<PageSimpleResponse<ProductInfoEntity>> udiDlDeviceResponse = syncUdiService.filterUdi(productInfoFilterRequest);
if (udiDlDeviceResponse.getCode() != 20000) { if (udiDlDeviceResponse.getCode() != 20000) {
return udiDlDeviceResponse; return udiDlDeviceResponse;
} }
if (CollUtil.isEmpty(udiDlDeviceResponse.getData().getList())) { if (CollUtil.isEmpty(udiDlDeviceResponse.getData().getList())) {
BaseResponse<List<ProductInfoEntity>> listBaseResponse = asyncDiDlHelper.dlByDiRes(filterUdiInfoRequest.getNameCode()); BaseResponse<List<ProductInfoEntity>> listBaseResponse = asyncDiDlHelper.dlByDiRes(filterUdiInfoRequest.getNameCode());

@ -5,6 +5,7 @@ import com.glxp.sale.admin.entity.basic.EntrustReceEntity;
import com.glxp.sale.admin.req.basic.BasicEntrustRecRequest; import com.glxp.sale.admin.req.basic.BasicEntrustRecRequest;
import com.glxp.sale.admin.res.basic.EntrustReceResponse; import com.glxp.sale.admin.res.basic.EntrustReceResponse;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -17,6 +18,8 @@ public interface EntrustReceDao {
List<EntrustReceResponse> filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); List<EntrustReceResponse> filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest);
EntrustReceEntity findByUnique(@Param("action") String action, @Param("entrustUser") String entrustUser);
boolean insertEntrustRec(EntrustReceEntity ioOrderStatusEntity); boolean insertEntrustRec(EntrustReceEntity ioOrderStatusEntity);
boolean replaceEntrustRec(EntrustReceEntity entrustReceEntity); boolean replaceEntrustRec(EntrustReceEntity entrustReceEntity);

@ -4,6 +4,7 @@ import com.glxp.sale.admin.entity.basic.DlEntrustReceEntity;
import com.glxp.sale.admin.entity.basic.EntrustReceEntity; import com.glxp.sale.admin.entity.basic.EntrustReceEntity;
import com.glxp.sale.admin.req.basic.BasicEntrustRecRequest; import com.glxp.sale.admin.req.basic.BasicEntrustRecRequest;
import com.glxp.sale.admin.res.basic.EntrustReceResponse; import com.glxp.sale.admin.res.basic.EntrustReceResponse;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -13,6 +14,8 @@ public interface EntrustReceService {
List<EntrustReceEntity> filterEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); List<EntrustReceEntity> filterEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest);
EntrustReceEntity findByUnique(String action, String entrustUser);
List<DlEntrustReceEntity> downloadEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); List<DlEntrustReceEntity> downloadEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest);
List<EntrustReceResponse> filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); List<EntrustReceResponse> filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest);

@ -47,6 +47,11 @@ public class EntrustReceServiceImpl implements EntrustReceService {
return entrustReceDao.filterEntrustRec(basicEntrustRecRequest); return entrustReceDao.filterEntrustRec(basicEntrustRecRequest);
} }
@Override
public EntrustReceEntity findByUnique(String action, String entrustUser) {
return entrustReceDao.findByUnique(action, entrustUser);
}
@Override @Override
public List<DlEntrustReceEntity> downloadEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest) { public List<DlEntrustReceEntity> downloadEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest) {
if (basicEntrustRecRequest == null) { if (basicEntrustRecRequest == null) {

@ -78,7 +78,7 @@ public class SyncUdiService {
} }
productInfoFilterRequest.setIsNewest(1); productInfoFilterRequest.setIsNewest(1);
productInfoFilterRequest.setDiType("1"); // productInfoFilterRequest.setDiType("1");
List<ProductInfoEntity> productInfoEntityList = productInfoService.filterUdi(productInfoFilterRequest); List<ProductInfoEntity> productInfoEntityList = productInfoService.filterUdi(productInfoFilterRequest);
PageInfo<ProductInfoEntity> pageInfo; PageInfo<ProductInfoEntity> pageInfo;
pageInfo = new PageInfo<>(productInfoEntityList); pageInfo = new PageInfo<>(productInfoEntityList);

@ -32,145 +32,6 @@ public class FilterUdiUtils {
return null; return null;
} }
public static UdiEntity getGS1UdiOld(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.length() >= 10 && last.substring(8, 10).equals("21")) {
serialNo = last.substring(10);
}
}
} 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.length() >= 10 && last.substring(8, 10).equals("21")) {
serialNo = last.substring(10);
}
}
} 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() >= 34 && data.substring(32, 34).equals("21")) {
serialNo = 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() >= 34 && data.substring(32, 34).equals("21")) {
serialNo = 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 getGS1Udi(String data) { public static UdiEntity getGS1Udi(String data) {
Gs1128Engine engine = new Gs1128Engine(); Gs1128Engine engine = new Gs1128Engine();

@ -1,70 +1,38 @@
# \u751F\u4EA7\u73AF\u5883 # \u751F\u4EA7\u73AF\u5883
server.port=9906 server.port=9906
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/spms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true spring.datasource.jdbc-url=jdbc:mysql://192.168.0.66:3360/spms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=123456 spring.datasource.password=root
#spring.datasource.password=123456 #spring.datasource.password=123456
spring.datasource.hikari.connection-timeout=60000 spring.datasource.hikari.connection-timeout=60000
spring.datasource.hikari.maximum-pool-size=60 spring.datasource.hikari.maximum-pool-size=60
spring.datasource.hikari.minimum-idle=10 spring.datasource.hikari.minimum-idle=10
#server.servlet.context-path= #server.servlet.context-path=
#logging.level.com.glxp.sale.admin.dao=debug logging.level.com.glxp.sale.admin.dao=debug
# \u8DE8\u57DF\u8BBE\u7F6E
cors.allowed-origins=* cors.allowed-origins=*
cors.allowed-headers=Content-Type,ADMIN_ID,ADMIN_TOKEN cors.allowed-headers=Content-Type,ADMIN_ID,ADMIN_TOKEN
cors.allowed-methods=GET,POST,PUT,DELETE,PATCH,OPTIONS cors.allowed-methods=GET,POST,PUT,DELETE,PATCH,OPTIONS
cors.allowed-Credentials=true cors.allowed-Credentials=true
#\u8BF7\u6C42\u53C2\u6570\u957F\u5EA6
server.tomcat.max-http-form-post-size=100MB server.tomcat.max-http-form-post-size=100MB
server.max-http-header-size=100MB server.max-http-header-size=100MB
#\u6700\u5927\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F(10MB)
spring.servlet.multipart.max-file-size=200MB spring.servlet.multipart.max-file-size=200MB
spring.servlet.multipart.max-request-size=200MB spring.servlet.multipart.max-request-size=200MB
server.connectionTimeout=180000 server.connectionTimeout=180000
logging.level.com.glxp.sale.admin.dao=debug
logging.level.com.glxp.api.admin.dao.auth=debug
logging.level.com.glxp.api.admin.dao.basic=debug
logging.level.com.glxp.api.admin.dao.business=debug
logging.level.com.glxp.api.admin.dao.info=debug
logging.level.com.glxp.api.admin.dao.inout=debug
logging.level.com.glxp.api.admin.dao.inventory=debug
logging.level.com.glxp.api.admin.dao.thrsys=debug
#file_path=/home/glxpdata/udiwms #file_path=/home/glxpdata/udiwms
file_path=D:/glxpdata/udiwms file_path=D:/glxpdata/udiwms
#UDI\u6570\u636E\u4E0B\u8F7D
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
#UDI_SERVER_URL=http://127.0.0.1:9994 UDI_SERVER_URL=http://127.0.0.1:9994
#UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server #UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server
#UCLOD\u670D\u52A1
#UCLOD_SERVER_URL=http://127.0.0.1:9997
#UCLOD_SERVER_URL=http://127.0.0.1:8080/UDIC_UCLOUD_SERVER
UCLOD_SERVER_URL=http://139.9.178.73/UDIC_UCLOUD_SERVER
#mips\u670D\u52A1\u5730\u5740
UDIC_MIPSDOWNLOAD_URL=http://127.0.0.1:8080/UDIC_MIPSDL_Server
#UDIC_MIPSDOWNLOAD_URL = http://127.0.0.1:9997
UDIC_U8_URL="https://api.yonyoucloud.com/apis/u8c/uapbd/invmandoc_query"
#\u534F\u8C03\u5E73\u53F0\u5BA2\u6237\u7AEF\u5730\u5740
COOR_UPLOAD_ORDER=http://127.0.0.1:9987/udi/upload
#\u5185\u5B58\u7801\u751F\u6210
STOCK_PRINT_POST=http://139.159.187.130/UDI_WMS_MC/udiwms/stockprint/post
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
spring.main.allow-bean-definition-overriding=true spring.main.allow-bean-definition-overriding=true
# Redis \u6570\u636E\u5E93\u7F16\u53F7
spring.redis.database=4 spring.redis.database=4
# Redis \u670D\u52A1\u5668IP
spring.redis.host=127.0.0.1 spring.redis.host=127.0.0.1
# Redis \u7AEF\u53E3\u53F7
spring.redis.port=6379 spring.redis.port=6379
# Redis \u5BC6\u7801
spring.redis.password= spring.redis.password=
#\u6700\u5927\u6D3B\u8DC3\u8FDE\u63A5\u6570
spring.redis.jedis.pool.max-active=8 spring.redis.jedis.pool.max-active=8
#\u6700\u5927\u7B49\u5F85\u65F6\u95F4
spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-wait=-1
#\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5\u6570
spring.redis.jedis.pool.max-idle=8 spring.redis.jedis.pool.max-idle=8
#\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5\u6570
spring.redis.jedis.pool.min-idle=0 spring.redis.jedis.pool.min-idle=0

@ -39,6 +39,15 @@
</select> </select>
<select id="findByUnique" parameterType="com.glxp.sale.admin.req.basic.BasicEntrustRecRequest"
resultType="com.glxp.sale.admin.entity.basic.EntrustReceEntity">
select *
from basic_entrust_accept
where `action` = #{action}
and `entrustUser` = #{entrustUser} limit 1
</select>
<select id="downloadEntrustRec" parameterType="com.glxp.sale.admin.req.basic.BasicEntrustRecRequest" <select id="downloadEntrustRec" parameterType="com.glxp.sale.admin.req.basic.BasicEntrustRecRequest"
resultType="com.glxp.sale.admin.entity.basic.DlEntrustReceEntity"> resultType="com.glxp.sale.admin.entity.basic.DlEntrustReceEntity">
select select
@ -123,7 +132,9 @@
#{remark}, #{remark},
#{entrustAction}, #{entrustAction},
#{finishRece}, #{finishRece},
#{curInv},#{entrustSubInv},#{invWarehouseCode} #{curInv},
#{entrustSubInv},
#{invWarehouseCode}
) )
</insert> </insert>
@ -142,7 +153,9 @@
#{remark}, #{remark},
#{entrustAction}, #{entrustAction},
#{finishRece}, #{finishRece},
#{curInv},#{entrustSubInv},#{invWarehouseCode} #{curInv},
#{entrustSubInv},
#{invWarehouseCode}
) )
</insert> </insert>

@ -84,11 +84,10 @@
<if test="supId == null"> <if test="supId == null">
AND supId is NULL AND supId is NULL
</if> </if>
<if test="batchNo != '' and batchNo != null"> <if test="batchNo != '' and batchNo != null and batchNo!='empty'">
AND batchNo = #{batchNo} AND batchNo = #{batchNo}
</if> </if>
<if test="batchNo == 'empty'">
<if test="batchNo == '' || batchNo == null">
AND batchNo is NULL AND batchNo is NULL
</if> </if>
<if test="invWarehouseCode != '' and invWarehouseCode != null"> <if test="invWarehouseCode != '' and invWarehouseCode != null">

Loading…
Cancel
Save