数据同步bug修改

master
anthonywj 2 years ago
parent 963406dd91
commit cbfd4c0129

@ -0,0 +1,21 @@
package com.glxp.api.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
@Configuration
public class DataTypeConvertConfig {
@Bean
public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) {
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
SimpleModule simpleModule = new SimpleModule();
// 直接将所有的Long类型转换为String
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
objectMapper.registerModule(simpleModule);
return objectMapper;
}
}

@ -1,10 +1,18 @@
package com.glxp.api.config; package com.glxp.api.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.util.List;
@Configuration @Configuration
public class WebMvcConfig implements WebMvcConfigurer { public class WebMvcConfig implements WebMvcConfigurer {
@ -21,4 +29,5 @@ public class WebMvcConfig implements WebMvcConfigurer {
//跨域允许时间 //跨域允许时间
.maxAge(3600); .maxAge(3600);
} }
} }

@ -85,8 +85,6 @@ public class SupCertController {
} }
private BaseResponse insertCompanyCert(String customerId, PostSelCertRequest request) { private BaseResponse insertCompanyCert(String customerId, PostSelCertRequest request) {
if (CollUtil.isEmpty(request.getSupCertSetEntities())) { if (CollUtil.isEmpty(request.getSupCertSetEntities())) {
return ResultVOUtils.error(500, "请选入资质证书!"); return ResultVOUtils.error(500, "请选入资质证书!");
@ -160,8 +158,8 @@ public class SupCertController {
return ResultVOUtils.error(500, "参数错误!"); return ResultVOUtils.error(500, "参数错误!");
} }
String errMsg=checkCert(postSelCertRequest,customerId); String errMsg = checkCert(postSelCertRequest, customerId);
if(StrUtil.isNotEmpty(errMsg)){ if (StrUtil.isNotEmpty(errMsg)) {
return ResultVOUtils.error(999, errMsg.substring(1) + "已存在!"); return ResultVOUtils.error(999, errMsg.substring(1) + "已存在!");
} }
for (SupCertSetEntity supCertSetEntity : postSelCertRequest.getSupCertSetEntities()) { for (SupCertSetEntity supCertSetEntity : postSelCertRequest.getSupCertSetEntities()) {
@ -182,8 +180,7 @@ public class SupCertController {
} }
public String checkCert(PostSelCertRequest postSelCertRequest, String customerId) {
public String checkCert(PostSelCertRequest postSelCertRequest,String customerId){
String errMsg = ""; String errMsg = "";
ArrayList<String> list = new ArrayList<>(); ArrayList<String> list = new ArrayList<>();
@ -193,11 +190,11 @@ public class SupCertController {
FilterSupCertRequest supCertRequest = new FilterSupCertRequest(); FilterSupCertRequest supCertRequest = new FilterSupCertRequest();
supCertRequest.setName(supCertSetEntity.getName()); supCertRequest.setName(supCertSetEntity.getName());
supCertRequest.setCustomerId(customerId); supCertRequest.setCustomerId(customerId);
if(StrUtil.isEmpty(postSelCertRequest.getProductIdFk()) && StrUtil.isNotEmpty(postSelCertRequest.getManufacturerIdFk())) { if (StrUtil.isEmpty(postSelCertRequest.getProductIdFk()) && StrUtil.isNotEmpty(postSelCertRequest.getManufacturerIdFk())) {
supCertRequest.setManufacturerIdFk(postSelCertRequest.getManufacturerIdFk()); supCertRequest.setManufacturerIdFk(postSelCertRequest.getManufacturerIdFk());
supCertRequest.setType(2); supCertRequest.setType(2);
} }
if(StrUtil.isNotEmpty(postSelCertRequest.getProductIdFk()) && StrUtil.isNotEmpty(postSelCertRequest.getManufacturerIdFk())) { if (StrUtil.isNotEmpty(postSelCertRequest.getProductIdFk()) && StrUtil.isNotEmpty(postSelCertRequest.getManufacturerIdFk())) {
supCertRequest.setManufacturerIdFk(postSelCertRequest.getManufacturerIdFk()); supCertRequest.setManufacturerIdFk(postSelCertRequest.getManufacturerIdFk());
supCertRequest.setProductIdFk(postSelCertRequest.getProductIdFk()); supCertRequest.setProductIdFk(postSelCertRequest.getProductIdFk());
supCertRequest.setType(3); supCertRequest.setType(3);
@ -209,10 +206,10 @@ public class SupCertController {
for (String s : list) { for (String s : list) {
errMsg = errMsg + "," + s; errMsg = errMsg + "," + s;
} }
return errMsg; return errMsg;
} }
}else{ } else {
if(i == 0 && list.size()>0){ if (i == 0 && list.size() > 0) {
for (String s : list) { for (String s : list) {
errMsg = errMsg + "," + s; errMsg = errMsg + "," + s;
} }
@ -243,6 +240,7 @@ public class SupCertController {
supCertEntity.setCreateTime(new Date()); supCertEntity.setCreateTime(new Date());
supCertEntity.setUpdateTime(new Date()); supCertEntity.setUpdateTime(new Date());
supCertEntity.setStatus(0); supCertEntity.setStatus(0);
supCertEntity.setId(IdUtil.getSnowflakeNextId());
boolean b = supCertService.insertCompanyCert(supCertEntity); boolean b = supCertService.insertCompanyCert(supCertEntity);
return ResultVOUtils.success("成功"); return ResultVOUtils.success("成功");
} }
@ -305,15 +303,13 @@ public class SupCertController {
BeanUtils.copyProperties(postSupCertRequest, supCertEntity); BeanUtils.copyProperties(postSupCertRequest, supCertEntity);
if(postSupCertRequest.getVailDate() !=null && postSupCertRequest.getExpireDate() != null){ if (postSupCertRequest.getVailDate() != null && postSupCertRequest.getExpireDate() != null) {
if(postSupCertRequest.getVailDate().getTime()>postSupCertRequest.getExpireDate().getTime()){ if (postSupCertRequest.getVailDate().getTime() > postSupCertRequest.getExpireDate().getTime()) {
return ResultVOUtils.error(999,"生效期不能小于失效期!"); return ResultVOUtils.error(999, "生效期不能小于失效期!");
} }
} }
if (postSupCertRequest.getRepeatUpload() == 1) { if (postSupCertRequest.getRepeatUpload() == 1) {
//已审核的重新提交 //已审核的重新提交
//1.修改对应的资质信息进入变更审核状态, //1.修改对应的资质信息进入变更审核状态,

@ -1,8 +1,10 @@
package com.glxp.api.controller.purchase; package com.glxp.api.controller.purchase;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.pinyin.PinyinUtil; import cn.hutool.extra.pinyin.PinyinUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log; import com.glxp.api.annotation.Log;
@ -11,6 +13,7 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.dao.basic.BasicCorpDao;
import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.AuthRoleAdmin; import com.glxp.api.entity.auth.AuthRoleAdmin;
import com.glxp.api.entity.auth.CustomerInfoEntity; import com.glxp.api.entity.auth.CustomerInfoEntity;
@ -295,7 +298,7 @@ public class SupCompanyController {
companyEntity.setAuditor(authAdmin.getId() + ""); companyEntity.setAuditor(authAdmin.getId() + "");
companyEntity.setAuditTime(new Date()); companyEntity.setAuditTime(new Date());
companyEntity.setUpdateTime(new Date()); companyEntity.setUpdateTime(new Date());
if(companyEntity.getAuditComment() == null){ if (companyEntity.getAuditComment() == null) {
companyEntity.setAuditComment(""); companyEntity.setAuditComment("");
} }
boolean b = companyService.modifyCompany(companyEntity); boolean b = companyService.modifyCompany(companyEntity);
@ -317,11 +320,18 @@ public class SupCompanyController {
basicCorpEntity.setMobile(companyEntity.getMobile()); basicCorpEntity.setMobile(companyEntity.getMobile());
basicCorpEntity.setCorpType(ConstantStatus.CORP_SP); basicCorpEntity.setCorpType(ConstantStatus.CORP_SP);
basicCorpEntity.setUpdateTime(new Date()); basicCorpEntity.setUpdateTime(new Date());
basicCorpService.insertBasicUnitMaintain(basicCorpEntity); if (!basicCorpDao.exists(new QueryWrapper<BasicCorpEntity>().eq("erpId", companyEntity.getCustomerId()))) {
basicCorpEntity.setId(IdUtil.getSnowflakeNextId());
basicCorpService.insert(basicCorpEntity);
}else {
}
return ResultVOUtils.success("修改成功"); return ResultVOUtils.success("修改成功");
} }
@Resource
BasicCorpDao basicCorpDao;
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("/sup/company/selectBind") @PostMapping("/sup/company/selectBind")

@ -15,7 +15,7 @@ public class DeptEntity {
private Long id; private Long id;
@TableField(value = "pid") @TableField(value = "pid")
private Integer pid; private Integer pid;
@TableField(value = "code;") @TableField(value = "code")
private String code; private String code;
@TableField(value = "name") @TableField(value = "name")
private String name; private String name;
@ -33,7 +33,7 @@ public class DeptEntity {
private Integer level; private Integer level;
@TableField(value = "pcode") @TableField(value = "pcode")
private String pcode; private String pcode;
@TableField(value = "pName") @TableField(exist = false)
private String pName; private String pName;
/** /**

@ -2,6 +2,8 @@ package com.glxp.api.entity.basic;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* *
*/ */
@ -78,6 +80,8 @@ public class UdiProductEntity {
private Integer status; private Integer status;
private String supId; private String supId;
private Date updateTime;
private Integer relSupId; private Integer relSupId;

@ -7,7 +7,7 @@ import lombok.Data;
public class BasicExportStatusRequest extends ListPageRequest { public class BasicExportStatusRequest extends ListPageRequest {
private String id; private String id;
private Integer status; private Integer status;
private Integer type; private String type;
private Integer scheduleType; private Integer scheduleType;
private String idDatas; private String idDatas;
public Integer createType; public Integer createType;

@ -11,7 +11,7 @@ import java.util.Date;
@Data @Data
public class BasicHospTypeResponse { public class BasicHospTypeResponse {
private Integer id; private Long id;
private String code; private String code;
private String parentCode; private String parentCode;
private String name; private String name;
@ -23,4 +23,4 @@ public class BasicHospTypeResponse {
private String label; private String label;
} }

@ -50,7 +50,7 @@ public class BasicCorpServiceImpl extends ServiceImpl<BasicCorpDao, BasicCorpEnt
@Override @Override
public boolean insert(BasicCorpEntity basicUnitMaintainEntity) { public boolean insert(BasicCorpEntity basicUnitMaintainEntity) {
return basicCorpDao.insertEntity(basicUnitMaintainEntity) == 0 ? false : true; return basicCorpDao.insert(basicUnitMaintainEntity) == 0 ? false : true;
} }
@Override @Override

@ -15,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
@ -96,6 +97,7 @@ public class UdiProductServiceImpl implements UdiProductService {
@Override @Override
public boolean insertUdiInfo(UdiProductEntity udiProductEntity) { public boolean insertUdiInfo(UdiProductEntity udiProductEntity) {
udiProductEntity.setUpdateTime(new Date());
return udiProductDao.insertUdiInfo(udiProductEntity); return udiProductDao.insertUdiInfo(udiProductEntity);
} }
@ -108,6 +110,7 @@ public class UdiProductServiceImpl implements UdiProductService {
public boolean updateUdiInfo(UdiProductEntity udiProductEntity) { public boolean updateUdiInfo(UdiProductEntity udiProductEntity) {
if (StrUtil.isEmpty(udiProductEntity.getNameCode())) if (StrUtil.isEmpty(udiProductEntity.getNameCode()))
return false; return false;
udiProductEntity.setUpdateTime(new Date());
return udiProductDao.updateUdiInfo(udiProductEntity); return udiProductDao.updateUdiInfo(udiProductEntity);
} }
@ -115,11 +118,13 @@ public class UdiProductServiceImpl implements UdiProductService {
public boolean updateUdiInfoByUuid(UdiProductEntity udiProductEntity) { public boolean updateUdiInfoByUuid(UdiProductEntity udiProductEntity) {
if (StrUtil.isEmpty(udiProductEntity.getUuid())) if (StrUtil.isEmpty(udiProductEntity.getUuid()))
return false; return false;
udiProductEntity.setUpdateTime(new Date());
return udiProductDao.updateUdiInfoByUuid(udiProductEntity); return udiProductDao.updateUdiInfoByUuid(udiProductEntity);
} }
@Override @Override
public boolean updateUdiInfoById(UdiProductEntity udiProductEntity) { public boolean updateUdiInfoById(UdiProductEntity udiProductEntity) {
udiProductEntity.setUpdateTime(new Date());
return udiProductDao.updateUdiInfoById(udiProductEntity); return udiProductDao.updateUdiInfoById(udiProductEntity);
} }
@ -143,6 +148,7 @@ public class UdiProductServiceImpl implements UdiProductService {
public boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest) { public boolean updateUdiInfoNotAll(UdiInfoRequest udiInfoRequest) {
if (StrUtil.isEmpty(udiInfoRequest.getUuid())) if (StrUtil.isEmpty(udiInfoRequest.getUuid()))
return false; return false;
return udiProductDao.updateUdiInfoNotAll(udiInfoRequest); return udiProductDao.updateUdiInfoNotAll(udiInfoRequest);
} }

@ -2,6 +2,7 @@ package com.glxp.api.service.inout;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@ -119,12 +120,14 @@ public class IoAddInoutService {
basicCorpEntity.setCorpType(ConstantStatus.CORP_SICK); basicCorpEntity.setCorpType(ConstantStatus.CORP_SICK);
basicCorpEntity.setOutType(ConstantStatus.CORP_SICK_SICK); basicCorpEntity.setOutType(ConstantStatus.CORP_SICK_SICK);
basicCorpEntity.setName(orderEntity.getFromCorp()); basicCorpEntity.setName(orderEntity.getFromCorp());
basicCorpEntity.setId(IdUtil.getSnowflakeNextId());
basicCorpService.insertBasicUnitMaintain(basicCorpEntity);
} }
orderEntity.setFromCorp(basicCorpEntity.getErpId()); orderEntity.setFromCorp(basicCorpEntity.getErpId());
orderEntity.setUpdateTime(new Date()); orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity); orderService.update(orderEntity);
basicCorpService.insertBasicUnitMaintain(basicCorpEntity);
} }
} }

@ -99,7 +99,7 @@ public class SpsSyncDownloadService {
orderStatusEntity.setIdDatas(ConstantStatus.SYNC_SCAN_ORDER); orderStatusEntity.setIdDatas(ConstantStatus.SYNC_SCAN_ORDER);
orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER);
orderStatusEntity.setUpdateTime(new Date()); orderStatusEntity.setUpdateTime(new Date());
orderStatusEntity.setStatus(0); orderStatusEntity.setStatus(BasicExportStatusEnum.WAIT_BUILT.getCode());
orderStatusEntity.setStartTime(new Date()); orderStatusEntity.setStartTime(new Date());
orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(orderStatusEntity); basicExportService.insertExportStatus(orderStatusEntity);
@ -109,8 +109,16 @@ public class SpsSyncDownloadService {
// 创建国家库同步任务 // 创建国家库同步任务
public void syncDiProductsTask() { public void syncDiProductsTask() {
BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData(ConstantStatus.SYNC_DI_PRODUCTS, 1);
if (basicExportStatusEntity4 == null) { BasicExportStatusEntity exportStatus = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class)
.eq(BasicExportStatusEntity::getType, BasicExportTypeEnum.COUNTRY_DI_DATA.getRemark())
.orderByDesc(BasicExportStatusEntity::getStartTime)
.last("limit 1")
);
//首次任务or上次任务结束
if (exportStatus == null || BasicExportStatusEnum.COMPLETED.getCode().equals(exportStatus.getStatus())) {
BaseResponse<SpSyncUdiResponse> baseResponse = syncUdi(getRequest(ConstantStatus.SYNC_DI_PRODUCTS)); BaseResponse<SpSyncUdiResponse> baseResponse = syncUdi(getRequest(ConstantStatus.SYNC_DI_PRODUCTS));
SpSyncUdiResponse spSyncUdiResponse = baseResponse.getData(); SpSyncUdiResponse spSyncUdiResponse = baseResponse.getData();
if (CollUtil.isNotEmpty(spSyncUdiResponse.getProductInfoEntityList()) if (CollUtil.isNotEmpty(spSyncUdiResponse.getProductInfoEntityList())
@ -183,7 +191,6 @@ public class SpsSyncDownloadService {
, x -> x.generateDocumentTypeDataFile(info, now, true)); , x -> x.generateDocumentTypeDataFile(info, now, true));
} }
break; break;
case COUNTRY_DI_DATA:
} }
} }
@ -263,7 +270,7 @@ public class SpsSyncDownloadService {
throw new RuntimeException(errorMsg); throw new RuntimeException(errorMsg);
} }
BasicExportStatusEntity exportStatus = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class) BasicExportStatusEntity exportStatus = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class)
.eq(BasicExportStatusEntity::getType, BasicExportTypeEnum.BASIC_DATA.getRemark()) .eq(BasicExportStatusEntity::getType, exportEnum.getRemark())
.orderByDesc(BasicExportStatusEntity::getStartTime) .orderByDesc(BasicExportStatusEntity::getStartTime)
.last("limit 1") .last("limit 1")
); );
@ -279,8 +286,8 @@ public class SpsSyncDownloadService {
exportStatus = BasicExportStatusEntity.builder() exportStatus = BasicExportStatusEntity.builder()
.id(CustomUtil.getId()) .id(CustomUtil.getId())
.status(BasicExportStatusEnum.WAIT_TRIGGERED.getCode()) .status(BasicExportStatusEnum.WAIT_TRIGGERED.getCode())
.idDatas(BasicExportTypeEnum.BASIC_DATA.getKey()) .idDatas(exportEnum.getKey())
.type(BasicExportTypeEnum.BASIC_DATA.getRemark()) .type(exportEnum.getRemark())
.scheduleType(0) .scheduleType(0)
.updateTime(cn.hutool.core.date.DateUtil.date()) .updateTime(cn.hutool.core.date.DateUtil.date())
.startTime(now) .startTime(now)
@ -315,7 +322,7 @@ public class SpsSyncDownloadService {
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(hospTypeList)) { if (CollectionUtil.isNotEmpty(hospTypeList)) {
jsonMap.put(BasicExportStatusTimeEntity.class.getSimpleName(), hospTypeList); jsonMap.put(BasicHospTypeEntity.class.getSimpleName(), hospTypeList);
} }
List<UdiRelevanceEntity> udiRelevanceList = udiRelevanceService.list(Wrappers.lambdaQuery(UdiRelevanceEntity.class) List<UdiRelevanceEntity> udiRelevanceList = udiRelevanceService.list(Wrappers.lambdaQuery(UdiRelevanceEntity.class)
.le((boolean) map.get("isNew"), UdiRelevanceEntity::getUpdateTime, now) .le((boolean) map.get("isNew"), UdiRelevanceEntity::getUpdateTime, now)
@ -362,6 +369,7 @@ public class SpsSyncDownloadService {
totalTimeMap.put(BasicExportStatusTimeEnum.SUP_CERT, map); totalTimeMap.put(BasicExportStatusTimeEnum.SUP_CERT, map);
List<SupCertEntity> supCertList = supCertService.list(Wrappers.lambdaQuery(SupCertEntity.class) List<SupCertEntity> supCertList = supCertService.list(Wrappers.lambdaQuery(SupCertEntity.class)
.le((boolean) map.get("isNew"), SupCertEntity::getUpdateTime, now) .le((boolean) map.get("isNew"), SupCertEntity::getUpdateTime, now)
.eq(SupCertEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.between(!(boolean) map.get("isNew"), SupCertEntity::getUpdateTime .between(!(boolean) map.get("isNew"), SupCertEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
@ -378,6 +386,7 @@ public class SpsSyncDownloadService {
} }
List<SupCompanyEntity> supCompanyList = supCompanyService.list(Wrappers.lambdaQuery(SupCompanyEntity.class) List<SupCompanyEntity> supCompanyList = supCompanyService.list(Wrappers.lambdaQuery(SupCompanyEntity.class)
.le((boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime, now) .le((boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime, now)
.eq(SupCompanyEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.between(!(boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime .between(!(boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
@ -385,7 +394,7 @@ public class SpsSyncDownloadService {
jsonMap.put(SupCompanyEntity.class.getSimpleName(), supCompanyList); jsonMap.put(SupCompanyEntity.class.getSimpleName(), supCompanyList);
} }
List<SupManufacturerEntity> supManufacturerList = supManufacturerService.list(Wrappers.lambdaQuery(SupManufacturerEntity.class) List<SupManufacturerEntity> supManufacturerList = supManufacturerService.list(Wrappers.lambdaQuery(SupManufacturerEntity.class)
.le((boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime, now) .eq(SupManufacturerEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.between(!(boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime .between(!(boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
@ -393,6 +402,7 @@ public class SpsSyncDownloadService {
jsonMap.put(SupManufacturerEntity.class.getSimpleName(), supManufacturerList); jsonMap.put(SupManufacturerEntity.class.getSimpleName(), supManufacturerList);
} }
List<SupProductEntity> supProductList = supProductService.list(Wrappers.lambdaQuery(SupProductEntity.class) List<SupProductEntity> supProductList = supProductService.list(Wrappers.lambdaQuery(SupProductEntity.class)
.eq(SupProductEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.le((boolean) map.get("isNew"), SupProductEntity::getUpdateTime, now) .le((boolean) map.get("isNew"), SupProductEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), SupProductEntity::getUpdateTime .between(!(boolean) map.get("isNew"), SupProductEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)

@ -57,7 +57,7 @@ public class AsyncHeartTask implements SchedulingConfigurer {
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet(); SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
if (syncDataSetEntity.isDownstreamEnable()) { if (syncDataSetEntity.isDownstreamEnable()) {
if (syncDataSetEntity.getSyncTime() != null) { if (syncDataSetEntity.getSyncTime() != null) {
long timeInterval = syncDataSetEntity.getSyncTime() * 60 * 1000; long timeInterval = syncDataSetEntity.getSyncTime() * 6 * 1000;
long curTime = System.currentTimeMillis(); long curTime = System.currentTimeMillis();
Long lastTime = (Long) redisUtil.get("SPS_SYNC_GEN_DATA"); Long lastTime = (Long) redisUtil.get("SPS_SYNC_GEN_DATA");
if (lastTime == null) { if (lastTime == null) {

@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import com.glxp.api.constant.ConstantStatus; import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.UdiProductEntity; import com.glxp.api.entity.basic.UdiProductEntity;
import java.util.Date;
import java.util.List; import java.util.List;
public class UdiInfoUtil { public class UdiInfoUtil {
@ -26,6 +27,7 @@ public class UdiInfoUtil {
public static List<UdiProductEntity> initUdiInfoEntitys(List<UdiProductEntity> udiProductEntities) { public static List<UdiProductEntity> initUdiInfoEntitys(List<UdiProductEntity> udiProductEntities) {
if (CollUtil.isNotEmpty(udiProductEntities)) { if (CollUtil.isNotEmpty(udiProductEntities)) {
for (UdiProductEntity udiProductEntity : udiProductEntities) { for (UdiProductEntity udiProductEntity : udiProductEntities) {
udiProductEntity.setUpdateTime(new Date());
udiProductEntity.setProductType(ConstantStatus.PRODUCT_TYPE_UDI); udiProductEntity.setProductType(ConstantStatus.PRODUCT_TYPE_UDI);
if (StrUtil.isNotEmpty(udiProductEntity.getScbssfbhph()) && "否".equals(udiProductEntity.getScbssfbhph())) { if (StrUtil.isNotEmpty(udiProductEntity.getScbssfbhph()) && "否".equals(udiProductEntity.getScbssfbhph())) {
udiProductEntity.setAllowNoBatch(true); udiProductEntity.setAllowNoBatch(true);

@ -172,7 +172,7 @@
allowNoBatch, allowNoExpire, allowNoBatch, allowNoExpire,
allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2, allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2,
basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7, basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7,
basicPrductRemak8) basicPrductRemak8, updateTime)
values (#{uuid}, values (#{uuid},
#{originUuid}, #{originUuid},
#{nameCode}, #{nameCode},
@ -223,7 +223,7 @@
#{basicPrductRemak5}, #{basicPrductRemak5},
#{basicPrductRemak6}, #{basicPrductRemak6},
#{basicPrductRemak7}, #{basicPrductRemak7},
#{basicPrductRemak8}) #{basicPrductRemak8}, #{updateTime})
</insert> </insert>
<insert id="insertUdiInfos" keyProperty="id" parameterType="java.util.List"> <insert id="insertUdiInfos" keyProperty="id" parameterType="java.util.List">
@ -235,7 +235,7 @@
allowNoBatch, allowNoExpire, allowNoBatch, allowNoExpire,
allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2, allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2,
basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7, basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7,
basicPrductRemak8) basicPrductRemak8, updateTime)
values values
<foreach collection="udiInfoEntities" item="item" index="index" <foreach collection="udiInfoEntities" item="item" index="index"
@ -290,7 +290,7 @@
#{item.basicPrductRemak5}, #{item.basicPrductRemak5},
#{item.basicPrductRemak6}, #{item.basicPrductRemak6},
#{item.basicPrductRemak7}, #{item.basicPrductRemak7},
#{item.basicPrductRemak8}) #{item.basicPrductRemak8}, #{item.updateTime})
</foreach> </foreach>
</insert> </insert>
@ -423,8 +423,9 @@
<if test="allowNoSerial != null"> <if test="allowNoSerial != null">
allowNoSerial=#{allowNoSerial}, allowNoSerial=#{allowNoSerial},
</if> </if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="spmc != null"> <if test="spmc != null">
spmc=#{spmc}, spmc=#{spmc},
</if> </if>
@ -625,6 +626,9 @@
<if test="basicPrductRemak8 != null"> <if test="basicPrductRemak8 != null">
basicPrductRemak8=#{basicPrductRemak8}, basicPrductRemak8=#{basicPrductRemak8},
</if> </if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
</trim> </trim>
where uuid = #{uuid} where uuid = #{uuid}
</update> </update>
@ -785,6 +789,9 @@
<if test="basicPrductRemak8 != null"> <if test="basicPrductRemak8 != null">
basicPrductRemak8=#{basicPrductRemak8}, basicPrductRemak8=#{basicPrductRemak8},
</if> </if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
@ -955,6 +962,9 @@
</update> </update>
<select id="selectAllowNoBatch" resultType="com.glxp.api.entity.basic.UdiProductEntity"> <select id="selectAllowNoBatch" resultType="com.glxp.api.entity.basic.UdiProductEntity">
select id, allowNoBatch from basic_products where nameCode = #{nameCode} limit 1 select id, allowNoBatch
from basic_products
where nameCode = #{nameCode}
limit 1
</select> </select>
</mapper> </mapper>

@ -17,7 +17,7 @@
</select> </select>
<insert id="insertExportStatus" keyProperty="id" <insert id="insertExportStatus"
parameterType="com.glxp.api.entity.sync.BasicExportStatusTimeEntity"> parameterType="com.glxp.api.entity.sync.BasicExportStatusTimeEntity">
replace replace
INTO basic_export_status_time(`key`, lastUpdateTime, remark) INTO basic_export_status_time(`key`, lastUpdateTime, remark)

Loading…
Cancel
Save