优化 service

dev_2.5_ocean
qiuyt 4 months ago
parent db5248d21d
commit 402baec171

@ -81,16 +81,7 @@ public class InvPreProductServiceImpl implements InvPreProductService {
return invPreProductDao.findGroupBySpace(invPreProductRequest); return invPreProductDao.findGroupBySpace(invPreProductRequest);
} }
@Override
public List<InvPreProductEntity> filterPreProductList(FilterInvPreProductRequest invPreProductRequest) {
if (null == invPreProductRequest) {
return Collections.emptyList();
}
if (null != invPreProductRequest.getPage() && null != invPreProductRequest.getLimit()) {
PageHelper.offsetPage((invPreProductRequest.getPage() - 1) * invPreProductRequest.getLimit(), invPreProductRequest.getLimit());
}
return invPreProductDao.filterPreProductList(invPreProductRequest);
}
@Override @Override
public InvPreProductEntity findById(String id) { public InvPreProductEntity findById(String id) {

@ -75,15 +75,5 @@ public class SysOperLogServiceImpl implements ISysOperLogService, OperLogService
return baseMapper.deleteBatchIds(Arrays.asList(operIds)); return baseMapper.deleteBatchIds(Arrays.asList(operIds));
} }
/**
*
*
* @param operId ID
* @return
*/
@Override
public SysOperLog selectOperLogById(Long operId) {
return baseMapper.selectById(operId);
}
} }

@ -65,10 +65,6 @@ public class SupCertServiceImpl extends ServiceImpl<SupCertDao, SupCertEntity> i
return companyEntities; return companyEntities;
} }
@Override
public SupCertEntity findCompanyCertByName(String companyName) {
return supCertDao.findCompanyCertByName(companyName);
}
@Override @Override
public List<SupCertEntity> findAll(String customerId) { public List<SupCertEntity> findAll(String customerId) {

@ -11,4 +11,5 @@ import java.util.List;
public interface ThrProductsAddDiService { public interface ThrProductsAddDiService {
} }

@ -1185,103 +1185,6 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
log.info("扫描处理第三方普耗明细生成单据定时任务结束"); log.info("扫描处理第三方普耗明细生成单据定时任务结束");
} }
@Override
public void scanInvGhOrderGenerateGhOrder() {
log.info("扫描处理第三方高耗明细生成单据定时任务开始");
List<ThrInvOrderDetail> list = thrInvOrderDetailMapper.selectSourceTypeList(Constant.THR_INV_GH_ORDER_TYPE);
/**
* 1
* 2
* 3
* 4
*/
if (CollectionUtil.isEmpty(list)) return;
Map<String, List<ThrInvOrderDetail>> grouped = list.stream()
.collect(Collectors.groupingBy(ThrInvOrderDetail::getOrderIdFk));
for (Map.Entry<String, List<ThrInvOrderDetail>> entry : grouped.entrySet()) {
//新单号
String newBillNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd"));
String orderIdFk = entry.getKey();
List<ThrInvOrderDetail> thrInvOrderDetails = entry.getValue();
List<ThrInvOrderDetail> generatethrInvOrderDetails = new ArrayList<>(entry.getValue().size());//需要生成的明细
thrInvOrderDetails.forEach(item -> {
Long relId = item.getRelId();
if (ObjectUtil.isNull(relId)) {
String nameCode = item.getNameCode();
List<UdiRelevanceResponse> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
if (CollectionUtil.isNotEmpty(productsEntities)) {
UdiRelevanceResponse basicProductsEntity = productsEntities.get(0);
item.setRelId(basicProductsEntity.getId());
item.setHandleStatus(1);
item.setToBillNo(newBillNo);
generatethrInvOrderDetails.add(item);
} else {
}
}
});
if (generatethrInvOrderDetails.size() > 0) {
thrInvOrderDetailMapper.updateBatchById(generatethrInvOrderDetails);//先进行 回写已处理状态
//通过单号获取单据信息
QueryWrapper<ThrInvOrder> qw = new QueryWrapper<>();
qw.eq("billNo", orderIdFk);
ThrInvOrder thrInvOrder = thrInvOrderMapper.selectOne(qw);
IoOrderEntity ioOrderEntity = new IoOrderEntity();
ioOrderEntity.setBillNo(newBillNo);
ioOrderEntity.setMainAction(thrInvOrder.getMainAction());
ioOrderEntity.setFromCorp(thrInvOrder.getFromCorp());
ioOrderEntity.setInvCode(thrInvOrder.getInvCode());
ioOrderEntity.setDeptCode(thrInvOrder.getDeptCode());
ioOrderEntity.setAction(thrInvOrder.getBillType());
ioOrderEntity.setFromType(ConstantStatus.FROM_WEBNEW);//网页新增
ioOrderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE);//草稿
ioOrderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_DRAFT);//草稿
ioOrderEntity.setCorpOrderId(UUID.randomUUID() + "");//单据号
ioOrderEntity.setThrOrderIdFk(thrInvOrder.getBillNo());//单据号
ioOrderEntity.setUpdateTime(new Date());
ioOrderEntity.setCreateTime(new Date());
ioOrderEntity.setCustomerId("110");
Long userId = customerService.getUserId();
ioOrderEntity.setCreateUser(userId + "");
ioOrderEntity.setUpdateUser(userId + "");
ioOrderEntity.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);//正常单据处理
List<IoCodeTempEntity> newIoCodeTemps = new ArrayList<>(thrInvOrderDetails.size());
GenerateOrderRequest generateOrderRequest = new GenerateOrderRequest();
generateOrderRequest.setAction(thrInvOrder.getBillType());
if (!copyIoCodeTemps(entry.getValue(), newIoCodeTemps, newBillNo, generateOrderRequest)) {
throw new JsonException("第三方高耗明细自动转化单据异常");
}
String toBillNo = (thrInvOrder.getToBillNo() == null ? "" : thrInvOrder.getToBillNo()) + ("," + newBillNo);
// 检查字符串是否以逗号开始
if (toBillNo.startsWith(",")) {
// 使用substring()去掉第一个字符
toBillNo = toBillNo.substring(1);
}
thrInvOrder.setToBillNo(toBillNo);
thrInvOrderMapper.updateById(thrInvOrder);
thrInvOrderDetailMapper.updateBatchById(generatethrInvOrderDetails);
ioOrderService.insertOrder(ioOrderEntity);
ioCodeTempDao.insertBatch(newIoCodeTemps);
for (IoCodeTempEntity codeTempEntity : newIoCodeTemps) {
addInoutService.genOrderDetailCode(ioOrderEntity, codeTempEntity);
}
ioAddInoutService.dealProcess(ioOrderEntity);
if (!ioCheckInoutService.checkManual(ioOrderEntity.getBillNo())) {
ioCheckInoutService.check(ioOrderEntity.getBillNo());
}
}
}
log.info("扫描处理第三方高耗明细生成单据定时任务结束");
}
/** /**
* *

@ -27,150 +27,5 @@ import java.util.List;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class ThrProductsAddDiServiceImpl implements ThrProductsAddDiService { public class ThrProductsAddDiServiceImpl implements ThrProductsAddDiService {
@Resource
private ThrProductsAddDiDao thrProductsAddDiDao;
@Resource
private ProductInfoService productInfoService;
@Override
public List<ThrProductsAddDiResponse> filterThrProductsList(FilterThrProductsRequest filterThrProductsRequest) {
if (null != filterThrProductsRequest && filterThrProductsRequest.getPage() != null) {
int offset = (filterThrProductsRequest.getPage() - 1) * filterThrProductsRequest.getLimit();
PageHelper.offsetPage(offset, filterThrProductsRequest.getLimit());
}
List<ThrProductsAddDiResponse> thrProductsAddDiResponses = thrProductsAddDiDao.filterThrProductsList(filterThrProductsRequest);
if (CollUtil.isNotEmpty(thrProductsAddDiResponses)) {
thrProductsAddDiResponses.forEach(thrProductsAddDiResponse -> {
thrProductsAddDiResponse.setStandard(thrProductsAddDiResponse.getSpec());
thrProductsAddDiResponse.setZczbhhzbapzbh(thrProductsAddDiResponse.getRegisterNo());
});
}
return thrProductsAddDiResponses;
}
@Override
public ThrProductsAddDiResponse selecById(Long id) {
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
filterThrProductsRequest.setId(id);
List<ThrProductsAddDiResponse> thrProductsAddDiResponses = thrProductsAddDiDao.filterThrProductsList(filterThrProductsRequest);
if (CollUtil.isNotEmpty(thrProductsAddDiResponses)) {
return thrProductsAddDiResponses.get(0);
}
return null;
}
@Override
public ThrProductsAddDiResponse selecByUuid(String uuid) {
if (StrUtil.isEmpty(uuid)) {
return null;
}
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
filterThrProductsRequest.setUuid(uuid);
List<ThrProductsAddDiResponse> thrProductsAddDiResponses = thrProductsAddDiDao.filterThrProductsList(filterThrProductsRequest);
if (CollUtil.isNotEmpty(thrProductsAddDiResponses)) {
return thrProductsAddDiResponses.get(0);
}
return null;
}
@Override
public boolean delThrDiProducts(Long id) {
return thrProductsAddDiDao.deleteById(id);
}
@Override
public boolean updateDiProduct(ThrProductsAddDiEntity thrProductsAddDiEntity) {
return thrProductsAddDiDao.updateDiProduct(thrProductsAddDiEntity);
}
@Override
public boolean addThrAddDiProducts(AddThrDiProductsRequest thrDiProductsRequest) {
List<String> uuids = thrDiProductsRequest.getUuids();
Long customerId = thrDiProductsRequest.getCustomerId();
List<ThrProductsAddDiEntity> list = new ArrayList<>(uuids.size());
Date date = new Date();
for (String uuid : uuids) {
ProductInfoEntity productInfoEntity = productInfoService.selectByUuid(uuid).get(0);
ThrProductsAddDiEntity thrProductsAddDiEntity = new ThrProductsAddDiEntity();
BeanUtils.copyProperties(thrDiProductsRequest, thrProductsAddDiEntity);
thrProductsAddDiEntity.setCustomerId(customerId + "");
thrProductsAddDiEntity.setUuid(uuid);
thrProductsAddDiEntity.setType(1);
thrProductsAddDiEntity.setYlqxzcrbarywmc(productInfoEntity.getYlqxzcrbarywmc());
thrProductsAddDiEntity.setCplb(productInfoEntity.getCplb());
thrProductsAddDiEntity.setCpms(productInfoEntity.getCpms());
thrProductsAddDiEntity.setFlbm(productInfoEntity.getFlbm());
thrProductsAddDiEntity.setQxlb(productInfoEntity.getQxlb());
thrProductsAddDiEntity.setTyshxydm(productInfoEntity.getTyshxydm());
thrProductsAddDiEntity.setCode(productInfoEntity.getNameCode());
thrProductsAddDiEntity.setName(productInfoEntity.getCpmctymc());
thrProductsAddDiEntity.setStandard(productInfoEntity.getGgxh());
thrProductsAddDiEntity.setSpec(productInfoEntity.getGgxh());
thrProductsAddDiEntity.setRegisterNo(productInfoEntity.getZczbhhzbapzbh());
thrProductsAddDiEntity.setYlqxzcrbarmc(productInfoEntity.getYlqxzcrbarmc());
thrProductsAddDiEntity.setZczbhhzbapzbh(productInfoEntity.getZczbhhzbapzbh());
//设置编辑区参数
thrProductsAddDiEntity.setSptm(thrDiProductsRequest.getSptm());
thrProductsAddDiEntity.setYbbm(thrDiProductsRequest.getYbbm());
thrProductsAddDiEntity.setMeasname(thrDiProductsRequest.getMeasname());
thrProductsAddDiEntity.setManufactory(thrDiProductsRequest.getManufactory());
thrProductsAddDiEntity.setSpmc(thrDiProductsRequest.getSpmc());
thrProductsAddDiEntity.setCpms(thrDiProductsRequest.getCpms());
thrProductsAddDiEntity.setPrice(thrDiProductsRequest.getPrice());
thrProductsAddDiEntity.setCreateTime(date);
thrProductsAddDiEntity.setUpdateTime(new Date());
thrProductsAddDiEntity.setStatus(1); //未审核
thrProductsAddDiEntity.setSelectThridSysStr(JSONUtil.toJsonStr(thrDiProductsRequest.getSelectThirdSys()));
list.add(thrProductsAddDiEntity);
}
return thrProductsAddDiDao.insertThrDiProducts(list);
}
@Override
public UdiInfoResponse getDiProductDetail(String uuid) {
ThrProductsAddDiEntity thrProductsAddDiEntity = thrProductsAddDiDao.filterThrProductsGetUuid(uuid);
UdiInfoResponse udiInfoResponse = thrProductsAddDiDao.getDiProductDetail(uuid);
if(udiInfoResponse!=null){
udiInfoResponse.setSptm(thrProductsAddDiEntity.getSptm());
udiInfoResponse.setYbbm(thrProductsAddDiEntity.getYbbm());
udiInfoResponse.setManufactory(thrProductsAddDiEntity.getManufactory());
udiInfoResponse.setCpms(thrProductsAddDiEntity.getCpms());
udiInfoResponse.setMeasname(thrProductsAddDiEntity.getMeasname());
udiInfoResponse.setManufactory(thrProductsAddDiEntity.getManufactory());
udiInfoResponse.setPrice(thrProductsAddDiEntity.getPrice());
udiInfoResponse.setBasicPrductRemak1(thrProductsAddDiEntity.getBasicPrductRemak1());
udiInfoResponse.setBasicPrductRemak2(thrProductsAddDiEntity.getBasicPrductRemak2());
udiInfoResponse.setBasicPrductRemak3(thrProductsAddDiEntity.getBasicPrductRemak3());
udiInfoResponse.setBasicPrductRemak4(thrProductsAddDiEntity.getBasicPrductRemak4());
udiInfoResponse.setBasicPrductRemak5(thrProductsAddDiEntity.getBasicPrductRemak5());
udiInfoResponse.setBasicPrductRemak6(thrProductsAddDiEntity.getBasicPrductRemak6());
udiInfoResponse.setBasicPrductRemak7(thrProductsAddDiEntity.getBasicPrductRemak7());
udiInfoResponse.setBasicPrductRemak8(thrProductsAddDiEntity.getBasicPrductRemak8());
}
return udiInfoResponse;
}
@Override
public ThrProductsAddDiEntity filterThrProductsGetId(Integer id) {
return thrProductsAddDiDao.filterThrProductsGetId(id);
}
@Override
public boolean insertThrProducts(ThrProductsAddDiEntity thrProductsAddDiEntity) {
return thrProductsAddDiDao.insert(thrProductsAddDiEntity);
}
@Override
public List<ThrProductsAddDiResponse> filterThrProductsDiList(FilterThrProductsRequest filterThrProductsRequest) {
return thrProductsAddDiDao.filterThrProductsDiList(filterThrProductsRequest);
}
@Override
public List<ThrProductsAddDiEntity> filterThrProductsDiLists(FilterThrProductsRequest filterThrProductsRequest) {
return thrProductsAddDiDao.filterThrProductsDiLists(filterThrProductsRequest);
}
} }

Loading…
Cancel
Save