平台收费出入库明细修改

dev_kcyj
anthonywj 12 months ago
parent 6b099bff4c
commit 9f4c6fa539

@ -36,7 +36,6 @@ public class TestController {
@Resource
ThrConsumeMaterialCategoryMapper thrConsumeMaterialCategoryMapper;
@GetMapping("/test/stat/order")
public BaseResponse getStatus(BasicExportStatusRequest basicExportStatusRequest) throws Exception {
@ -110,12 +109,17 @@ public class TestController {
@GetMapping("/test/ybhcInit")
public BaseResponse ybhcInit() {
//获取分组全表数据
List<YbHcflEntityResponse> list = thrConsumeMaterialCategoryMapper.getYbhcListGroup();
list.forEach( item -> {
List<YbHcflEntityResponse> list = thrConsumeMaterialCategoryMapper.getYbhcListGroup();
list.forEach(item -> {
thrConsumeMaterialCategoryService.updateYbhcCategory(item);
});
return ResultVOUtils.success("");
}
@GetMapping("/test/sfck")
public BaseResponse shck() {
thrInvOrderService.scanInvSfOrderGenerateSfOrder();
return ResultVOUtils.success("");
}

@ -122,20 +122,20 @@ public class BasicDestinyRelController {
public BaseResponse editModeldestiny(@RequestBody BasicSkProjectEntity basicSkProjectEntity) {
//判断名字和编号不能重复
QueryWrapper<BasicSkProjectEntity> ew = new QueryWrapper<>();
ew.eq("name", basicSkProjectEntity.getName());
// ew.eq("type", 2);
BasicSkProjectEntity thrProductsEntity1 = basicSkProjectService.getOne(ew);
if (thrProductsEntity1 != null && !thrProductsEntity1.getId().equals(basicSkProjectEntity.getId())) {
return ResultVOUtils.error(999, "名称已存在!");
}
ew.clear();
ew.eq("code", basicSkProjectEntity.getCode());
// ew.eq("type", 2);
thrProductsEntity1 = basicSkProjectService.getOne(ew);
if (thrProductsEntity1 != null && !thrProductsEntity1.getId().equals(basicSkProjectEntity.getId())) {
return ResultVOUtils.error(999, "编号已存在!");
}
// QueryWrapper<BasicSkProjectEntity> ew = new QueryWrapper<>();
// ew.eq("name", basicSkProjectEntity.getName());
//// ew.eq("type", 2);
// BasicSkProjectEntity thrProductsEntity1 = basicSkProjectService.getOne(ew);
// if (thrProductsEntity1 != null && !thrProductsEntity1.getId().equals(basicSkProjectEntity.getId())) {
// return ResultVOUtils.error(999, "名称已存在!");
// }
// ew.clear();
// ew.eq("code", basicSkProjectEntity.getCode());
//// ew.eq("type", 2);
// thrProductsEntity1 = basicSkProjectService.getOne(ew);
// if (thrProductsEntity1 != null && !thrProductsEntity1.getId().equals(basicSkProjectEntity.getId())) {
// return ResultVOUtils.error(999, "编号已存在!");
// }
AuthAdmin authAdmin = customerService.getUserBean();
basicSkProjectEntity.setUpdateTime(new Date());

@ -3,6 +3,7 @@ package com.glxp.api.service.forthird.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.common.res.BaseResponse;
@ -11,6 +12,7 @@ import com.glxp.api.constant.Constant;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.inout.IoCodeEntity;
import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.exception.JsonException;
@ -33,6 +35,7 @@ import com.glxp.api.service.inout.IoAddInoutService;
import com.glxp.api.service.inout.IoCheckInoutService;
import com.glxp.api.service.inout.IoCodeTempService;
import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.inout.impl.IoCodeService;
import com.glxp.api.service.inv.impl.InvProductService;
import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.GennerOrderUtils;
@ -91,6 +94,8 @@ public class ForThirdSysApiService {
@Resource
UdiRlSupService udiRlSupService;
@Resource
IoCodeService codeService;
public BaseResponse invOutScanCode(ForInvOutScanCodeRequest hisRequest) {
IoOrderRequest orderRequest = hisRequest.getIoOrderRequest();
@ -121,6 +126,10 @@ public class ForThirdSysApiService {
orderEntity.setSickerAdNum(orderRequest.getSickerAdNum());
for (IoCodeTempEntity codeEnttity : codeTempEntities) {
IoCodeEntity originCode = codeService.getOne(new QueryWrapper<IoCodeEntity>().likeLeft("errUdiCode", codeEnttity.getCode()).last("limit 1"));
if (originCode != null) {
codeEnttity.setCode(originCode.getCode());
}
UdiEntity udiEntity = FilterUdiUtils.getUdi(codeEnttity.getCode());
codeEnttity.setOrderId(orderNo);
codeEnttity.setCorpOrderId(orderEntity.getCorpOrderId());

@ -70,7 +70,7 @@ import java.util.stream.Collectors;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
//@Transactional(rollbackFor = Exception.class)
public class ThrInvOrderServiceImpl implements ThrInvOrderService {
@Resource
@ -855,7 +855,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
if (CollectionUtil.isEmpty(thrInvOrderDetails)) continue;
log.info("扫描处理第三方收费明细生成单据定时任务==orderIdFk==:[" + thrInvOrder.getBillNo() + "]");
//新单号
String newBillNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd"));
//通过单号获取单据信息
QueryWrapper<ThrInvOrder> qw = new QueryWrapper<>();
@ -884,7 +884,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
thrInvOrderDetail.setRelId(sk.getRelId());
thrInvOrderDetail.setSupId(sk.getSupId() + "");
thrInvOrderDetail.setHandleStatus(1);
thrInvOrderDetail.setToBillNo(newBillNo);
thrInvOrderDetail.setToBillNo(null);
Integer skCount = sk.getCount();
if (skCount != null && skCount > 0) {
@ -921,7 +921,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
if (ObjectUtil.isNotNull(relId)) {
item.setRelId(relId);
item.setHandleStatus(1);
item.setToBillNo(newBillNo);
item.setToBillNo(null);
updateThrInvOrderDetails.add(item);
//校验产品是否被供应商关联
CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId);
@ -949,15 +949,15 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
if (CollectionUtil.isNotEmpty(updateThrInvOrderDetails)) {
thrInvOrderDetailMapper.updateBatchById(updateThrInvOrderDetails);
}
genOrder(newBillNo, thrInvOrder, bussinessTypeEntity);
genOrder(thrInvOrder, bussinessTypeEntity);
log.info("扫描处理第三方收费明细生成单据定时任务结束");
}
}
}
public boolean genOrder(String newBillNo,
ThrInvOrder thrInvOrder, BasicBussinessTypeEntity bussinessTypeEntity) {
public boolean genOrder(
ThrInvOrder thrInvOrder, BasicBussinessTypeEntity bussinessTypeEntity) {
QueryWrapper<ThrInvOrderDetail> qwd = new QueryWrapper<>();
qwd.eq("orderIdFk", thrInvOrder.getBillNo());
List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList(qwd);
@ -973,6 +973,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
grouped.put(thrInvOrder.getFromCorp(), thrInvOrderDetails);
}
for (Map.Entry<String, List<ThrInvOrderDetail>> entry : grouped.entrySet()) {
if (CollUtil.isEmpty(entry.getValue()))
continue;
String newBillNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER, "yyyyMMdd"));
IoOrderEntity ioOrderEntity = new IoOrderEntity();
ioOrderEntity.setBillNo(newBillNo);
ioOrderEntity.setMainAction(thrInvOrder.getMainAction());
@ -995,18 +998,18 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
ioOrderEntity.setCreateTime(new Date());
ioOrderEntity.setCustomerId("110");
Long userId = 1l;
try {
userId = customerService.getUserId();
} catch (Exception e) {
e.printStackTrace();
}
// try {
// userId = customerService.getUserId();
// } catch (Exception e) {
// e.printStackTrace();
// }
ioOrderEntity.setCreateUser(userId + "");
ioOrderEntity.setUpdateUser(userId + "");
ioOrderEntity.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);//正常单据处理
List<IoOrderDetailBizEntity> newOrderDetailBiz = new ArrayList<>();
if (entry.getValue().size() > 0) {
if (!copyOrderDetailBiz(entry.getValue(), newOrderDetailBiz, newBillNo)) {
throw new JsonException("第三方收费明细自动转化单据异常");
continue;
}
}
String toBillNo = (thrInvOrder.getToBillNo() == null ? "" : thrInvOrder.getToBillNo()) + ("," + newBillNo);
@ -1016,7 +1019,6 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
toBillNo = toBillNo.substring(1);
}
thrInvOrder.setToBillNo(toBillNo);
thrInvOrderMapper.updateById(thrInvOrder);
ioOrderService.insertOrder(ioOrderEntity);
ioOrderDetailBizService.batchInsertBizs(newOrderDetailBiz);
@ -1314,10 +1316,16 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
newBillNo) {
List<Long> relIds = thrInvOrderDetails.stream().filter(x -> ObjectUtil.isNotNull(x.getRelId()))
.map(ThrInvOrderDetail::getRelId).collect(Collectors.toList());
if (CollUtil.isEmpty(relIds))
if (CollUtil.isEmpty(relIds)) {
log.info("第三方高耗明细没有关联产品" + relIds);
return false;
}
List<BasicProductsEntity> basicProductsEntities = udiRelevanceDao.selectProductByRelIds(relIds);
if (CollectionUtil.isEmpty(basicProductsEntities)) return false;
if (CollectionUtil.isEmpty(basicProductsEntities)) {
log.info("第三方高耗明细没有关联产品" + relIds);
return false;
}
Map<Long, BasicProductsEntity> relIdBasicProductsEntityMap = basicProductsEntities.stream().collect(Collectors.toMap(BasicProductsEntity::getId, x -> x));
for (int i = 0; i < thrInvOrderDetails.size(); i++) {

Loading…
Cancel
Save