service 层代码第二次优化 (monitor、purchase、sync、system、thrsys)

dev_drug_dm
qiuyt 1 month ago
parent e232804fa9
commit 61a8143802

@ -35,12 +35,5 @@ public interface ISysOperLogService {
*/
int deleteOperLogByIds(Long[] operIds);
/**
*
*
* @param operId ID
* @return
*/
SysOperLog selectOperLogById(Long operId);
}

@ -59,7 +59,6 @@ public class SysOperLogServiceImpl implements ISysOperLogService, OperLogService
baseMapper.insert(operLog);
}
/**
*
*
@ -71,15 +70,4 @@ public class SysOperLogServiceImpl implements ISysOperLogService, OperLogService
return baseMapper.deleteBatchIds(Arrays.asList(operIds));
}
/**
*
*
* @param operId ID
* @return
*/
@Override
public SysOperLog selectOperLogById(Long operId) {
return baseMapper.selectById(operId);
}
}

@ -14,7 +14,6 @@ public interface PurArrivalService {
Boolean update(PurArrivalEntity purArrivalEntity);
Boolean deleteById(long id);
}

@ -43,9 +43,6 @@ public interface SupCertService extends IService<SupCertEntity> {
boolean deleteByCustomerId(String customerId);
boolean delManufacturerId(String customerId, String manufacturerId);
boolean delProductId(String customerId, String manufacturerId, String productId);
List<SupCertEntity> selectSupCertList(purPlanPrintRequest purPlanPrintRequest);

@ -155,29 +155,6 @@ public class SupCertServiceImpl extends ServiceImpl<SupCertDao, SupCertEntity> i
return false;
}
@Override
public boolean delManufacturerId(String customerId, String manufacturerId) {
if (StrUtil.isNotEmpty(customerId) && StrUtil.isNotEmpty(manufacturerId)) {
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
filterSupCertRequest.setCustomerId(customerId);
filterSupCertRequest.setManufacturerIdFk(manufacturerId);
return supCertDao.deleteCert(filterSupCertRequest);
}
return false;
}
@Override
public boolean delProductId(String customerId, String manufacturerId, String productId) {
if (StrUtil.isNotEmpty(customerId) && StrUtil.isNotEmpty(manufacturerId) && StrUtil.isNotEmpty(productId)) {
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
filterSupCertRequest.setCustomerId(customerId);
filterSupCertRequest.setManufacturerIdFk(manufacturerId);
filterSupCertRequest.setProductIdFk(productId);
return supCertDao.deleteCert(filterSupCertRequest);
}
return false;
}
@Override
public List<SupCertEntity> selectSupCertList(purPlanPrintRequest purPlanPrintRequest) {
return supCertDao.selectSupCertList(purPlanPrintRequest);

@ -74,7 +74,6 @@ import static com.glxp.api.constant.Constant.SYNC_REMARK;
@RequiredArgsConstructor
public class SpsSyncDownloadService {
private final Logger logger = LoggerFactory.getLogger(SpsSyncDownloadService.class);
@ -639,9 +638,6 @@ public class SpsSyncDownloadService {
}
private final IBasicBussinessTypeService bussinessTypeService;
private final IBasicBusTypeChangeService busTypeChangeService;
private final IThrBusTypeOriginService thrBusTypeOriginService;
@Resource
DeviceInspectTaskService deviceInspectTaskService;
@ -1251,7 +1247,6 @@ public class SpsSyncDownloadService {
// 异常回滚
this.exportTimeRollback(totalTimeMap, exportType, fileFullPath);
}
// SocketMsgEntity socketMsgEntity = SocketMsgEntity.builder().type(SocketMsgType.STAT_DATA_REQUEST).remark("下载生产企业信息").build();
SocketMsgEntity socketMsgEntity = SocketMsgEntity.builder().type(SocketMsgType.DL_ALL_DATA).remark("下载药品关联信息").build();
spsSyncWebSocket.sendMessage(socketMsgEntity, "1:" + socketToken);
return true;
@ -1284,7 +1279,6 @@ public class SpsSyncDownloadService {
boolean result = redisUtil.setIfAbsent(redisKey, 1, 10);
if (!result) {
String errorMsg = String.format("syncIdcSps----process------------同步[%s]重复进入", exportStatusTimeEnum.getRemark());
// logger.info(errorMsg);
throw new Exception(errorMsg);
}
boolean isNew = true;

@ -19,7 +19,6 @@ public class BasicDownloadServiceImpl extends ServiceImpl<BasicDownloadDao,Basic
@Resource
BasicDownloadDao basicDownloadDao;
@Override
public List<BasicDownloadStatusEntity> filterDownloadStatus(BasicDownloadRequest basicDownloadRequest) {
if (basicDownloadRequest == null) {

@ -1,4 +0,0 @@
package com.glxp.api.service.system;
public interface SysServerLogService {
}

@ -13,12 +13,9 @@ import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class CompanyServiceImpl implements CompanyService {
@Resource
CompanyDao companyDao;
@Override
public List<CompanyEntity> filterCompany(FilterCompanyRequest companyRequest) {
return companyDao.filterCompany(companyRequest);

@ -20,7 +20,6 @@ public class SyncUploadDataSetServiceImpl implements SyncUploadDataSetService {
@Resource
SyncUploadDataBustypeService syncUploadDataBustypeService;
@Override
public SyncUploadDataSetEntity selectSet() {
SyncUploadDataSetEntity syncDataSetEntity = syncUploadDataSetDao.selectSet();

@ -16,7 +16,6 @@ public class SysRemindMsgServiceImpl implements SysRemindMsgService {
@Resource
SysRemindMsgMapper sysRemindMsgMapper;
@Override
public List<SysRemindMsgEntity> filterList(FilterSysRemindMsgRequest filterSysRemindMsgRequest) {

@ -41,12 +41,7 @@ public class SystemPDFTemplateRelevanceBizServiceImpl extends ServiceImpl<SysPdf
public boolean udpateRl(SysPdfTemplateRelevanceBizEntity systemPDFTemplateRelevanceEntity) {
systemPDFTemplateRelevanceEntity.setUpdateTime(new Date());
int count = sysPdfTemplateRelevanceBizDao.updateById(systemPDFTemplateRelevanceEntity);
if (count > 0) {
return true;
} else {
return false;
}
return count > 0 ? true : false;
}
@Override

@ -51,12 +51,7 @@ public class SystemPDFTemplateRelevanceCodeServiceImpl extends ServiceImpl<SysPd
public boolean udpateRl(SysPdfTemplateRelevanceCodeEntity systemPDFTemplateRelevanceEntity) {
systemPDFTemplateRelevanceEntity.setUpdateTime(new Date());
int count = sysPdfTemplateRelevanceCodeDao.updateById(systemPDFTemplateRelevanceEntity);
if (count > 0) {
return true;
} else {
return false;
}
return count > 0 ? true : false;
}
@Override

@ -41,11 +41,6 @@ public class SystemPDFTemplateRelevanceLabelServiceImpl extends ServiceImpl<SysP
public boolean udpateRl(SysPdfTemplateRelevanceLabelEntity systemPDFTemplateRelevanceEntity) {
systemPDFTemplateRelevanceEntity.setUpdateTime(new Date());
int count = sysPdfTemplateRelevanceLabelDao.updateById(systemPDFTemplateRelevanceEntity);
if (count > 0) {
return true;
} else {
return false;
}
return count > 0 ? true : false;
}
}

@ -41,11 +41,6 @@ public class SystemPDFTemplateRelevanceStatemenServiceImpl extends ServiceImpl<S
public boolean udpateRl(SysPdfTemplateRelevanceStatemenEntity systemPDFTemplateRelevanceEntity) {
systemPDFTemplateRelevanceEntity.setUpdateTime(new Date());
int count = sysPdfTemplateRelevanceStatemenDao.updateById(systemPDFTemplateRelevanceEntity);
if (count > 0) {
return true;
} else {
return false;
}
return count > 0 ? true : false;
}
}

@ -74,7 +74,6 @@ public class SystemParamConfigServiceImpl extends ServiceImpl<SystemParamConfigD
FilterParamConfigRequest filterParamConfigRequest = new FilterParamConfigRequest();
filterParamConfigRequest.setParamType(2);
filterParamConfigRequest.setParamStatus(1);
List<SystemParamConfigEntity> systemParamConfigEntities = queryPage(filterParamConfigRequest);
Map<String, SystemParamConfigEntity> systemParamConfigEntityMap = new HashMap<>();

@ -52,64 +52,6 @@ public class ThirdAliDrugService extends ServiceImpl<ThirdAliDrugMapper, ThirdAl
String[] fields = fillEmptyParts(line);
Date createTime = new Date();
// if (fields.length == 9) {
// ThirdAliDrug medicine = new ThirdAliDrug(
// fields[0].trim(),
// fields[1].trim(),
// fields[2].trim(),
// fields[3].trim(),
// fields[4].trim(),
// fields[5].trim(),
// fields[5].trim(),
// fields[5].trim(),
// fields[6].trim(),
// fields[7].trim(),
// fields[8].trim(),
// createTime,
// createTime
// );
//
// if (StrUtil.isNotEmpty(medicine.getNameCode())) {
// int i = this.baseMapper.selectDrugsByNameCodes(medicine.getNameCode());
// if (i == 0) {
// medicine.setErpId(customerId);
// thirdAliDrugs.add(medicine);
// if (CollUtil.isNotEmpty(thirdAliDrugs) && thirdAliDrugs.size() >= 500) {
// this.baseMapper.saveOrUpdateBatch(thirdAliDrugs);
// thirdAliDrugs.clear();
// }
// }
// }
// }else
// if (fields.length == 10) {
// ThirdAliDrug medicine = new ThirdAliDrug(
// fields[0].trim(),
// fields[1].trim(),
// fields[2].trim(),
// fields[3].trim(),
// fields[4].trim(),
// fields[4].trim(),
// fields[6].trim(),
// fields[6].trim(),
// fields[7].trim(),
// fields[8].trim(),
// fields[9].trim(),
// createTime,
// createTime
// );
//
// if (StrUtil.isNotEmpty(medicine.getNameCode())) {
// int i = this.baseMapper.selectDrugsByNameCodes(medicine.getNameCode());
// if (i == 0) {
// medicine.setErpId(customerId);
// thirdAliDrugs.add(medicine);
// if (CollUtil.isNotEmpty(thirdAliDrugs) && thirdAliDrugs.size() >= 500) {
// this.baseMapper.saveOrUpdateBatch(thirdAliDrugs);
// thirdAliDrugs.clear();
// }
// }
// }
// }else
if (fields.length == 11) {
ThirdAliDrug medicine = new ThirdAliDrug(
fields[0].trim(),
@ -139,34 +81,6 @@ public class ThirdAliDrugService extends ServiceImpl<ThirdAliDrugMapper, ThirdAl
}
}
}
// else if (fields.length > 11) {
// ThirdAliDrug medicine = new ThirdAliDrug(
// fields[0].trim(),
// fields[1].trim(),
// fields[2].trim(),
// fields[3].trim(),
// fields[4].trim(),
// fields[5].trim(),
// fields[7].trim(),
// fields[8].trim(),
// fields[9].trim(),
// fields[10].trim(),
// fields[11].trim(),
// createTime,
// createTime
// );
//
// if (StrUtil.isNotEmpty(medicine.getNameCode())) {
// int i = this.baseMapper.selectDrugsByNameCodes(medicine.getNameCode());
// if (i == 0) {
// thirdAliDrugs.add(medicine);
// if (CollUtil.isNotEmpty(thirdAliDrugs) && thirdAliDrugs.size() >= 500) {
// this.baseMapper.saveOrUpdateBatch(thirdAliDrugs);
// thirdAliDrugs.clear();
// }
// }
// }
// }
}
} catch (IOException e) {
throw new JsonException("上传失败:" + "标识重复");

@ -62,7 +62,6 @@ public class ThrCorpsDlService {
public void importSelectCorps(String genKey, List<ThrCorpsResponse> thrCorpsResponseList, String thirdSys) {
ThrSystemDetailEntity piDetailEntity = thrSystemDetailService.selectByKey("corpUrl", thirdSys);
if (piDetailEntity == null || piDetailEntity.getValue() == null) {
// WebSocketServer.sendInfo("往来单位接口未设置!", "sid");
return;
}
ThrCorpImportLogEntity thrProductsImportLogEntity = thrCorpImportLogService.selectByGenKey(genKey);
@ -103,7 +102,6 @@ public class ThrCorpsDlService {
thrCorpService.insertThrCorpss(thrCorpEntities);
redisUtil.set(Constant.dlThrProducts, "false");
// WebSocketServer.sendInfo("往来单位信息下载已完成,请刷新查看!", "sid");
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrProductsImportLogEntity.setUpdateTime(new Date());
thrCorpImportLogService.updateImportLog(thrProductsImportLogEntity);
@ -115,7 +113,6 @@ public class ThrCorpsDlService {
public void importCorps(String genKey, ThrUnitMaintainFilterRequest thrUnitMaintainFilterRequest, String thirdSys) {
ThrSystemDetailEntity piDetailEntity = thrSystemDetailService.selectByKey("corpUrl", thirdSys);
if (piDetailEntity == null || piDetailEntity.getValue() == null) {
// WebSocketServer.sendInfo("往来单位接口未设置!", "sid");
return;
}
ThrCorpImportLogEntity thrProductsImportLogEntity = thrCorpImportLogService.selectByGenKey(genKey);
@ -143,7 +140,6 @@ public class ThrCorpsDlService {
thrCorpService.insertThrCorpss(data);
}
redisUtil.set(Constant.dlThrProducts, "false");
// WebSocketServer.sendInfo("往来单位信息下载已完成,请刷新查看!", "sid");
thrProductsImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrProductsImportLogEntity.setUpdateTime(new Date());
thrCorpImportLogService.updateImportLog(thrProductsImportLogEntity);
@ -169,7 +165,6 @@ public class ThrCorpsDlService {
return thrCorpEntity;
}
).collect(Collectors.toList());
// thrCorpImportDetailService.insertCorpDetailImports(thrCorpImportDetailEntities);
thrCorpEntities = thrCorpImportDetailEntities.stream().map(
item -> {
ThrCorpEntity thrCorpEntity = new ThrCorpEntity();
@ -278,42 +273,6 @@ public class ThrCorpsDlService {
return null;
}
public List<List<String>> genExcelData(FilterThrCorpRequest filterThrOrderRequest) {
List<List<String>> excelData = new ArrayList<>();
List<ThrCorpEntity> thrCorpEntityList = new ArrayList<>();
List<ThrCorpsResponse> thrCorpsResponseList = thrCorpService.filterThrCorps(filterThrOrderRequest);
if (thrCorpsResponseList.size() > 0) {
thrCorpEntityList = thrCorpsResponseList.stream().map(
item -> {
ThrCorpEntity thrCorpEntity = new ThrCorpEntity();
BeanUtil.copyProperties(item, thrCorpEntity);
return thrCorpEntity;
}
).collect(Collectors.toList());
}
excelData.addAll(getRows(thrCorpEntityList));
return excelData;
}
public List<List<String>> getRows(List<ThrCorpEntity> thrCorpEntities) {
List<List<String>> excelData = new ArrayList<>();
for (ThrCorpEntity thrCorpEntity : thrCorpEntities) {
List<String> rows = new ArrayList<>();
rows.add(thrCorpEntity.getUnitId());
rows.add(thrCorpEntity.getName());
rows.add(thrCorpEntity.getSpell());
rows.add(thrCorpEntity.getAddr());
rows.add(thrCorpEntity.getCreditNo());
rows.add(thrCorpEntity.getContact());
rows.add(thrCorpEntity.getMobile());
excelData.add(rows);
}
return excelData;
}
//导出生成json文件
@Async
public void genJsonFile(String genKey, ThrCorpExportRequest thrCorpExportRequest) {

@ -51,7 +51,6 @@ public class ThrInvProductsDlService {
ThrInvProductsImportLogEntity thrInvProductsImportLogEntity = thrInvProductsImportLogService.selectByGenKey(genKey);
ThrSystemDetailEntity piDetailEntity = thrSystemDetailService.selectByKey("invPiUrl", thirdSys);
if (piDetailEntity == null || piDetailEntity.getValue() == null) {
// WebSocketServer.sendInfo("库存产品信息接口未设置!", "sid");
return;
}
@ -127,7 +126,6 @@ public class ThrInvProductsDlService {
).collect(Collectors.toList());
thrInvProductsService.insertThrInvProducts(thrInvProductsEntities);
redisUtil.set(Constant.dlThrProducts, "false");
// WebSocketServer.sendInfo("库存产品信息下载已完成,请刷新查看!", "sid");
}
@Async

@ -65,12 +65,10 @@ public class ThrOrdersDlService {
ThrSystemDetailEntity thrSystemDetailEntity = iThrBusTypeOriginService.findSysByAction(action, "orderQueryUrl");
if (thrSystemDetailEntity == null || !thrSystemDetailEntity.getEnabled()) {
// WebSocketServer.sendInfo("业务单据查询接口未设置!", "sid");
return;
}
if (thrSystemDetailEntity.getThirdSysFk() == null) {
// WebSocketServer.sendInfo("业务单据查询接口未设置!", "sid");
return;
}
int page = 1;
@ -80,7 +78,6 @@ public class ThrOrdersDlService {
}
thrOrderImportLogService.importThrOrder(genKey);
redisUtil.set(Constant.dlThrProducts, "false");
// WebSocketServer.sendInfo("业务单据信息下载已完成,请刷新查看!", "sid");
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
}
@ -112,7 +109,6 @@ public class ThrOrdersDlService {
}
}
redisUtil.set(Constant.dlThrProducts, "false");
// WebSocketServer.sendInfo("业务单据信息下载已完成,请刷新查看!", "sid");
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
}

@ -18,8 +18,6 @@ import java.util.List;
public class ThrOrderServiceImpl implements ThrOrderService {
@Resource
private ThrOrderDao thrOrderDao;
@Resource
private ThrOrderDetailDao thrOrderDetailDao;
@Override
public List<ThrOrderEntity> filterThrOrder(FilterThrOrderRequest filterThrOrderRequest) {

Loading…
Cancel
Save