第三方收费明细修改

dev_kcyj
anthonywj 12 months ago
parent 4ad90672fa
commit 7fd4b216aa

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

Loading…
Cancel
Save