bug修改

wms_pzh
anthonywj 2 years ago
parent e95f058955
commit aef3c2743f

@ -9,6 +9,8 @@ import com.glxp.api.admin.entity.info.SchemaData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.InputStream;
@ -16,8 +18,8 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
//@Order(1)
//@Component
@Order(1)
@Component
@Slf4j
public class HdSchemaExecutor implements ApplicationRunner {

@ -1132,46 +1132,39 @@ public class WareHouseController {
}
Integer userId = customerService.getUserId();
try {
PostOrderRequest inPostOrder = new PostOrderRequest();
List<PostOrderRequest.PostOrder> inPostOrders = new ArrayList<>();
PostOrderRequest outPostOrder = new PostOrderRequest();
List<PostOrderRequest.PostOrder> outPostOrders = new ArrayList<>();
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrders();
if (postOrders != null && postOrders.size() > 0) {
for (PostOrderRequest.PostOrder postOrder : postOrders) {
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(postOrder.getCodes().get(0).getAction());
if (bussinessTypeEntity.isOutTospms()) {
outPostOrders.add(postOrder);
} else {
inPostOrders.add(postOrder);
}
PostOrderRequest inPostOrder = new PostOrderRequest();
List<PostOrderRequest.PostOrder> inPostOrders = new ArrayList<>();
PostOrderRequest outPostOrder = new PostOrderRequest();
List<PostOrderRequest.PostOrder> outPostOrders = new ArrayList<>();
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrders();
if (postOrders != null && postOrders.size() > 0) {
for (PostOrderRequest.PostOrder postOrder : postOrders) {
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(postOrder.getCodes().get(0).getAction());
if (bussinessTypeEntity.isOutTospms()) {
outPostOrders.add(postOrder);
} else {
inPostOrders.add(postOrder);
}
}
}
BeanUtils.copyProperties(postOrderRequest, inPostOrder);
BeanUtils.copyProperties(postOrderRequest, outPostOrder);
inPostOrder.setPostOrders(inPostOrders);
outPostOrder.setPostOrders(outPostOrders);
if (CollUtil.isNotEmpty(outPostOrders)) {
outPostOrder.setWmsUserId(userId + "");
return spsDirectClient.uploadPdaOrder(outPostOrder);
}
if (CollUtil.isNotEmpty(inPostOrders)) {
String customerId = getCustomerId();
inPostOrder.setCustomerId(customerId);
inPostOrder.setUserId(userId);
ioTransInoutService.creatOrder(inPostOrder, null);
}
BeanUtils.copyProperties(postOrderRequest, inPostOrder);
BeanUtils.copyProperties(postOrderRequest, outPostOrder);
inPostOrder.setPostOrders(inPostOrders);
outPostOrder.setPostOrders(outPostOrders);
} catch (Exception e) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
if (CollUtil.isNotEmpty(outPostOrders)) {
outPostOrder.setWmsUserId(userId + "");
return spsDirectClient.uploadPdaOrder(outPostOrder);
}
if (CollUtil.isNotEmpty(inPostOrders)) {
String customerId = getCustomerId();
inPostOrder.setCustomerId(customerId);
inPostOrder.setUserId(userId);
ioTransInoutService.creatOrder(inPostOrder, null);
}
return ResultVOUtils.success("上传成功,等待后台处理");
}
@ -1376,12 +1369,12 @@ public class WareHouseController {
if (null == id)
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
WarehouseBussinessTypeEntity warehouseBussinessTypeEntity = warehouseBussinessTypeService.selectById(id);
FilterInvBusUserRequest filterInvBusUserRequest=new FilterInvBusUserRequest();
FilterInvBusUserRequest filterInvBusUserRequest = new FilterInvBusUserRequest();
filterInvBusUserRequest.setScAction(warehouseBussinessTypeEntity.getAction());
filterInvBusUserRequest.setSubInvCode(warehouseBussinessTypeEntity.getCode());
List<InvBusUserEntity> invBusUserEntityList=invBusUserService.filterInvBusUser(filterInvBusUserRequest);
if(invBusUserEntityList.size()>0){
return ResultVOUtils.error(999,"有用户关联该单据请先移除再进行删除!");
List<InvBusUserEntity> invBusUserEntityList = invBusUserService.filterInvBusUser(filterInvBusUserRequest);
if (invBusUserEntityList.size() > 0) {
return ResultVOUtils.error(999, "有用户关联该单据请先移除再进行删除!");
}
InvSubWarehouseEntity invSubWarehouseEntity =

@ -107,9 +107,12 @@ public class InvSubWarehouseController {
} else {
//允许调拨
//查询总库信息
InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.filterGroupInvSubAndcode(filterInvWarehouseRequest.getCode());
filterInvWarehouseRequest.setWarehouseCode(invSubWarehouseEntity.getParentId());
filterInvWarehouseRequest.setCode(null);
if (StrUtil.isNotEmpty(filterInvWarehouseRequest.getCode())) {
InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.filterGroupInvSubAndcode(filterInvWarehouseRequest.getCode());
filterInvWarehouseRequest.setWarehouseCode(invSubWarehouseEntity.getParentId());
filterInvWarehouseRequest.setCode(null);
}
}
}

@ -193,8 +193,11 @@ public class InvSubWarehouseServiceImpl implements InvSubWarehouseService {
@Override
public InvSubWarehouseEntity filterGroupInvSubAndcode(String code) {
if (StrUtil.isEmpty(code))
return null;
return invSubWarehouseDao.filterGroupInvSubAndcode(code);
}
@Override
public List<InvSubWarehouseEntity> filterGroupInvSubDown(FilterInvWarehouseRequest filterInvSubWarehouseRequest) {
return invSubWarehouseDao.filterGroupInvSubDown(filterInvSubWarehouseRequest);

@ -59,11 +59,14 @@ public class CleanDataTask implements SchedulingConfigurer {
ScheduledRequest scheduledRequest = new ScheduledRequest();
scheduledRequest.setCronName("ScheduledDeletion");
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
String cron = scheduledEntity.getCron();
if (cron.isEmpty()) {
log.error("cron is null");
if (scheduledEntity == null) {
log.error("CleanDataTask 定时任务缺少 ScheduledDeletion字段请注意新增后重启");
return null;
} else {
String cron = scheduledEntity.getCron();
return new CronTrigger(cron).nextExecutionTime(triggerContext);
}
return new CronTrigger(cron).nextExecutionTime(triggerContext);
});
}

@ -37,12 +37,14 @@ public class DownloadSpDataTask implements SchedulingConfigurer {
taskRegistrar.addTriggerTask(this::process, triggerContext -> {
ScheduledRequest scheduledRequest = new ScheduledRequest();
scheduledRequest.setCronName("downloadSpDataTask");
ScheduledEntity scheduled = scheduledDao.findScheduled(scheduledRequest);
String cron = scheduled.getCron();
if (StrUtil.isBlank(cron)) {
log.error("cron is null");
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
if (scheduledEntity == null) {
log.error("DownloadSpDataTask 定时任务缺少 downloadSpDataTask字段请注意新增后重启");
return null;
} else {
String cron = scheduledEntity.getCron();
return new CronTrigger(cron).nextExecutionTime(triggerContext);
}
return new CronTrigger(cron).nextExecutionTime(triggerContext);
});
}

@ -1,8 +1,8 @@
server.port=9991
server.port=9992
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/udiwms_ph3?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.14:3306/udiwms_pzh?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.password=Glxp@6066
spring.datasource.hikari.connection-timeout=60000
spring.datasource.hikari.maximum-pool-size=60
spring.datasource.hikari.minimum-idle=10

@ -9,4 +9,18 @@ CALL Pro_Temp_ColumnWork ('stock_order_remak','zczbhhzbapzbh','varchar(255)', 1)
-- 新增数据
-- 创建表时必须 create table if not exists 表名
-- 创建表时必须 create table if not exists 表名
-- 新增数据
INSERT
ignore INTO sys_scheduled(id, cronName, cron, customerId, remark)
VALUES
(16, 'ScheduledDeletion', '0 0 2 1/1 * ? ', NULL, '删除30天数据');
INSERT
ignore INTO sys_param_config ( id, parentId, paramName, paramKey, paramValue, paramStatus, paramType, paramExplain )
VALUES
( 20009, 0, '删除30天数据', 'ScheduledDeletion', '1', 1, 0, '1:是0' );
INSERT
ignore INTO sys_scheduled (id,`cronName`, `cron`, `customerId`, `remark`) VALUES (119,'downloadSpDataTask', '0 0/1 * * * ?', NULL, '立即下载自助平台数据');
Loading…
Cancel
Save