第三方收费明细修改

dev_kcyj
anthonywj 12 months ago
parent 4ad90672fa
commit 7fd4b216aa

@ -763,6 +763,7 @@ public class IoOrderController extends BaseController {
} }
//单据编辑,条码减一 //单据编辑,条码减一
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("udiwms/inout/code/finish/delete") @PostMapping("udiwms/inout/code/finish/delete")

@ -6,11 +6,17 @@ import com.glxp.api.entity.thrsys.ThrInvOrderDetail;
import com.glxp.api.req.thrsys.FilterThrInvOrderRequest; import com.glxp.api.req.thrsys.FilterThrInvOrderRequest;
import com.glxp.api.res.thrsys.ThrInvOrderResponse; import com.glxp.api.res.thrsys.ThrInvOrderResponse;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface ThrInvOrderMapper extends BaseMapperPlus<ThrInvOrderMapper, ThrInvOrder, ThrInvOrder> { public interface ThrInvOrderMapper extends BaseMapperPlus<ThrInvOrderMapper, ThrInvOrder, ThrInvOrder> {
List<ThrInvOrderResponse> filterThrInvOrder(FilterThrInvOrderRequest filterThrInvOrderRequest); List<ThrInvOrderResponse> filterThrInvOrder(FilterThrInvOrderRequest filterThrInvOrderRequest);
@Select("SELECT COUNT(*) FROM thr_inv_order WHERE startDate <= #{startDate} AND endDate >= #{endDate}")
int countDownloadsInRange(Date startDate, Date endDate);
} }

@ -338,8 +338,13 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
filterInvProductRequest.setStartDate(stringToDate(days + " 00:00:00")); filterInvProductRequest.setStartDate(stringToDate(days + " 00:00:00"));
filterInvProductRequest.setEndDate(stringToDate(days + " 23:59:59")); filterInvProductRequest.setEndDate(stringToDate(days + " 23:59:59"));
if (thrInvOrderMapper.countDownloadsInRange(filterInvProductRequest.getStartDate(), filterInvProductRequest.getEndDate()) <= 0) {
handleExternalThrInvSfOrder(filterInvProductRequest); handleExternalThrInvSfOrder(filterInvProductRequest);
log.info("自动抓取第三方收费出入库明细生成单据定时任务结束"); log.info("自动抓取第三方收费出入库明细生成单据定时任务结束");
} else {
log.info("已下载户略");
}
} }
@ -844,22 +849,12 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
if (CollUtil.isNotEmpty(thrInvOrders)) { if (CollUtil.isNotEmpty(thrInvOrders)) {
for (ThrInvOrder thrInvOrder : thrInvOrders) { for (ThrInvOrder thrInvOrder : thrInvOrders) {
/**
* 1
* 2
* 3
* 4
*/
List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList( List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList(
new LambdaQueryWrapper<ThrInvOrderDetail>() new LambdaQueryWrapper<ThrInvOrderDetail>()
.and(o -> o.isNull(ThrInvOrderDetail::getHandleStatus).or().ne(ThrInvOrderDetail::getHandleStatus, 1)). .and(o -> o.isNull(ThrInvOrderDetail::getHandleStatus).or().ne(ThrInvOrderDetail::getHandleStatus, 1)).
eq(ThrInvOrderDetail::getOrderIdFk, thrInvOrder.getBillNo()) eq(ThrInvOrderDetail::getOrderIdFk, thrInvOrder.getBillNo())
); );
if (CollectionUtil.isEmpty(thrInvOrderDetails)) continue; if (CollectionUtil.isEmpty(thrInvOrderDetails)) continue;
log.info("扫描处理第三方收费明细生成单据定时任务==orderIdFk==:[" + thrInvOrder.getBillNo() + "]");
//新单号
//通过单号获取单据信息 //通过单号获取单据信息
QueryWrapper<ThrInvOrder> qw = new QueryWrapper<>(); QueryWrapper<ThrInvOrder> qw = new QueryWrapper<>();
qw.eq("billNo", thrInvOrder.getBillNo()); qw.eq("billNo", thrInvOrder.getBillNo());
@ -898,6 +893,8 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
}); });
fullGen.getAndIncrement(); fullGen.getAndIncrement();
} }
} else {
updateThrInvOrderDetails.add(item);
} }
}); });
if (thrInvOrderDetails.size() == fullGen.intValue()) { if (thrInvOrderDetails.size() == fullGen.intValue()) {
@ -947,23 +944,24 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
//新增明细 //新增明细
if (CollectionUtil.isNotEmpty(addThrInvOrderDetails)) { if (CollectionUtil.isNotEmpty(addThrInvOrderDetails)) {
thrInvOrderDetailMapper.insertBatch(addThrInvOrderDetails); thrInvOrderDetailMapper.insertBatch(addThrInvOrderDetails);
genOrder(thrInvOrder, bussinessTypeEntity, addThrInvOrderDetails);
} }
//更新明细 //更新明细
if (CollectionUtil.isNotEmpty(updateThrInvOrderDetails)) { if (CollectionUtil.isNotEmpty(updateThrInvOrderDetails)) {
thrInvOrderDetailMapper.updateBatchById(updateThrInvOrderDetails); thrInvOrderDetailMapper.updateBatchById(updateThrInvOrderDetails);
genOrder(thrInvOrder, bussinessTypeEntity, updateThrInvOrderDetails);
} }
genOrder(thrInvOrder, bussinessTypeEntity);
log.info("扫描处理第三方收费明细生成单据定时任务结束");
} }
} }
} }
public boolean genOrder( public boolean genOrder(
ThrInvOrder thrInvOrder, BasicBussinessTypeEntity bussinessTypeEntity) { ThrInvOrder thrInvOrder, BasicBussinessTypeEntity bussinessTypeEntity, List<ThrInvOrderDetail> thrInvOrderDetails) {
QueryWrapper<ThrInvOrderDetail> qwd = new QueryWrapper<>(); // QueryWrapper<ThrInvOrderDetail> qwd = new QueryWrapper<>();
qwd.eq("orderIdFk", thrInvOrder.getBillNo()); // qwd.eq("orderIdFk", thrInvOrder.getBillNo());
List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList(qwd); // List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList(qwd);
if (CollectionUtil.isEmpty(thrInvOrderDetails)) if (CollectionUtil.isEmpty(thrInvOrderDetails))
return false; return false;
@ -1008,8 +1006,8 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
// } catch (Exception e) { // } catch (Exception e) {
// e.printStackTrace(); // e.printStackTrace();
// } // }
ioOrderEntity.setCreateUser(userId + "");
ioOrderEntity.setUpdateUser(userId + ""); ioOrderEntity.setUpdateUser(userId + "");
ioOrderEntity.setCreateUser(userId + "");
ioOrderEntity.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);//正常单据处理 ioOrderEntity.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);//正常单据处理
List<IoOrderDetailBizEntity> newOrderDetailBiz = new ArrayList<>(); List<IoOrderDetailBizEntity> newOrderDetailBiz = new ArrayList<>();
if (entry.getValue().size() > 0) { if (entry.getValue().size() > 0) {
@ -1023,6 +1021,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
// 使用substring()去掉第一个字符 // 使用substring()去掉第一个字符
toBillNo = toBillNo.substring(1); toBillNo = toBillNo.substring(1);
} }
thrInvOrderDetailMapper.updateBatchById(thrInvOrderDetails);
thrInvOrder.setToBillNo(toBillNo); thrInvOrder.setToBillNo(toBillNo);
thrInvOrderMapper.updateById(thrInvOrder); thrInvOrderMapper.updateById(thrInvOrder);
ioOrderService.insertOrder(ioOrderEntity); ioOrderService.insertOrder(ioOrderEntity);
@ -1122,7 +1121,6 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
if (udiRlSupEntity != null) { if (udiRlSupEntity != null) {
item.setSupId(udiRlSupEntity.getCustomerId()); item.setSupId(udiRlSupEntity.getCustomerId());
} }
} else { } else {
} }
} }
@ -1191,6 +1189,11 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
thrInvOrder.setToBillNo(toBillNo); thrInvOrder.setToBillNo(toBillNo);
thrInvOrderMapper.updateById(thrInvOrder); thrInvOrderMapper.updateById(thrInvOrder);
thrInvOrderDetails.forEach(item -> {
item.setToBillNo(newBillNo);
}
);
thrInvOrderDetailMapper.updateBatchById(thrInvOrderDetails);
ioOrderService.insertOrder(ioOrderEntity); ioOrderService.insertOrder(ioOrderEntity);
ioOrderDetailBizService.batchInsertBizs(newOrderDetailBiz); ioOrderDetailBizService.batchInsertBizs(newOrderDetailBiz);
//自动处理业务单据 //自动处理业务单据
@ -1346,10 +1349,11 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
parameterPackag(basicProductsEntity, ioOrderDetailBizEntity, thrInvOrderDetail); parameterPackag(basicProductsEntity, ioOrderDetailBizEntity, thrInvOrderDetail);
ioOrderDetailBizEntity.setOrderIdFk(newBillNo); ioOrderDetailBizEntity.setOrderIdFk(newBillNo);
ioOrderDetailBizEntity.setBatchNo("/"); ioOrderDetailBizEntity.setBatchNo("/");
thrInvOrderDetail.setToBillNo(newBillNo);
thrInvOrderDetail.setHandleStatus(1);
newOrderDetailBiz.add(ioOrderDetailBizEntity); newOrderDetailBiz.add(ioOrderDetailBizEntity);
} }
} }
} }
return true; return true;
} }
@ -1561,14 +1565,11 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
//通过thrCode获取到项目组套 //通过thrCode获取到项目组套
List<BasicSkProjectDetailEntity> skProjectDetailEntityList = basicDestinyRelService.filterDestinyRelListByPId(thrCode); List<BasicSkProjectDetailEntity> skProjectDetailEntityList = basicDestinyRelService.filterDestinyRelListByPId(thrCode);
if (CollectionUtil.isNotEmpty(skProjectDetailEntityList) && count > 0) { if (CollectionUtil.isNotEmpty(skProjectDetailEntityList) && count > 0) {
Integer finalCount = count; Integer finalCount = count;
if (IntUtil.value(cpMutiFilter) > 0 && IntUtil.value(finalCount) > 1) { if (IntUtil.value(cpMutiFilter) > 0 && skProjectDetailEntityList.size() > 1) {
log.error(item.getCpmctymc() + "," + item.getThrCode() + "项目关联多个耗材对照,已被过滤!"); log.error(item.getCpmctymc() + "," + item.getThrCode() + "项目关联多个耗材对照,已被过滤!");
} else { } else {
skProjectDetailEntityList.forEach(sk -> { skProjectDetailEntityList.forEach(sk -> {
ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail(); ThrInvOrderDetail thrInvOrderDetail = new ThrInvOrderDetail();
BeanUtils.copyProperties(item, thrInvOrderDetail); BeanUtils.copyProperties(item, thrInvOrderDetail);
thrInvOrderDetail.setOrderIdFk(billNo); thrInvOrderDetail.setOrderIdFk(billNo);
@ -1582,7 +1583,6 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
if (skCount != null && skCount > 0) { if (skCount != null && skCount > 0) {
thrInvOrderDetail.setReCount(String.valueOf(skCount * finalCount)); thrInvOrderDetail.setReCount(String.valueOf(skCount * finalCount));
} }
//过滤是否高值 //过滤是否高值
if (IntUtil.value(highFilter) > 0) { if (IntUtil.value(highFilter) > 0) {
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(sk.getRelId()); UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(sk.getRelId());
@ -1592,7 +1592,6 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
} else { } else {
thrInvOrderDetails.add(thrInvOrderDetail); thrInvOrderDetails.add(thrInvOrderDetail);
} }
}); });
} }

Loading…
Cancel
Save