|
|
@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
@ -32,6 +33,7 @@ import com.glxp.api.req.thrsys.GenerateOrderRequest;
|
|
|
|
import com.glxp.api.req.thrsys.RefreshOrderRequest;
|
|
|
|
import com.glxp.api.req.thrsys.RefreshOrderRequest;
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
import com.glxp.api.res.basic.MainIdRelIdAndProductResponse;
|
|
|
|
import com.glxp.api.res.basic.MainIdRelIdAndProductResponse;
|
|
|
|
|
|
|
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
|
|
|
import com.glxp.api.res.inv.ThrInvResultResponse;
|
|
|
|
import com.glxp.api.res.inv.ThrInvResultResponse;
|
|
|
|
import com.glxp.api.res.thrsys.ThrInvOrderResponse;
|
|
|
|
import com.glxp.api.res.thrsys.ThrInvOrderResponse;
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
@ -213,7 +215,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
thrInvOrder.setChargeTime(sdf2.parse(thrInvResultResponse.getChargeTime()));
|
|
|
|
thrInvOrder.setChargeTime(sdf2.parse(thrInvResultResponse.getChargeTime()));
|
|
|
|
} catch (ParseException e) {
|
|
|
|
} catch (ParseException e) {
|
|
|
|
log.error("第三方高耗收费明细下载--收费时间转化出错,原数据:【"+thrInvResultResponse.getChargeTime() + "】");
|
|
|
|
log.error("第三方高耗收费明细下载--收费时间转化出错,原数据:【" + thrInvResultResponse.getChargeTime() + "】");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//保存数据
|
|
|
|
//保存数据
|
|
|
|
thrInvOrderMapper.insert(thrInvOrder);
|
|
|
|
thrInvOrderMapper.insert(thrInvOrder);
|
|
|
@ -221,13 +223,13 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
|
|
|
|
|
|
|
//是否自动生成出入库单据
|
|
|
|
//是否自动生成出入库单据
|
|
|
|
if (IntUtil.value(systemParamConfigService.selectValueByParamKey("gh_out_auto_gen")) > 0) {
|
|
|
|
if (IntUtil.value(systemParamConfigService.selectValueByParamKey("gh_out_auto_gen")) > 0) {
|
|
|
|
GenerateOrderRequest generateOrderRequest = new GenerateOrderRequest();
|
|
|
|
if (StrUtil.isBlank(thrInvOrder.getExMsg())) {
|
|
|
|
generateOrderRequest.setBillNo(thrInvOrder.getBillNo());
|
|
|
|
GenerateOrderRequest generateOrderRequest = new GenerateOrderRequest();
|
|
|
|
generateOrderRequest.setAction(thrInvOrder.getBillType());
|
|
|
|
generateOrderRequest.setBillNo(thrInvOrder.getBillNo());
|
|
|
|
|
|
|
|
generateOrderRequest.setAction(thrInvOrder.getBillType());
|
|
|
|
// generateOrderRequest.setFromCorp(thrInvOrder.getFromCorp());
|
|
|
|
// generateOrderRequest.setFromCorp(thrInvOrder.getFromCorp());
|
|
|
|
generateGhOrder(generateOrderRequest);
|
|
|
|
generateGhOrder(generateOrderRequest);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -253,9 +255,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
String udiCode = item.getUdiCode();
|
|
|
|
String udiCode = item.getUdiCode();
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(udiCode);
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(udiCode);
|
|
|
|
String nameCode = udiEntity.getUdi();
|
|
|
|
String nameCode = udiEntity.getUdi();
|
|
|
|
List<BasicProductsEntity> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
List<UdiRelevanceResponse> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
BasicProductsEntity basicProductsEntity = productsEntities.get(0);
|
|
|
|
UdiRelevanceResponse basicProductsEntity = productsEntities.get(0);
|
|
|
|
String mainAction = item.getMainAction();
|
|
|
|
String mainAction = item.getMainAction();
|
|
|
|
String thrCode = item.getThrCode();
|
|
|
|
String thrCode = item.getThrCode();
|
|
|
|
|
|
|
|
|
|
|
@ -277,6 +279,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
thrInvOrderDetail.setSupId(udiRlSupEntity.getCustomerId());
|
|
|
|
thrInvOrderDetail.setSupId(udiRlSupEntity.getCustomerId());
|
|
|
|
else
|
|
|
|
else
|
|
|
|
exmsg.append(thrCode + "供应商未关联");
|
|
|
|
exmsg.append(thrCode + "供应商未关联");
|
|
|
|
|
|
|
|
if (IntUtil.value(basicProductsEntity.getPurType()) == 0) {
|
|
|
|
|
|
|
|
exmsg.append(thrCode + "采购类型未设置");
|
|
|
|
|
|
|
|
}
|
|
|
|
thrInvOrderDetail.setUdiCode(udiCode);
|
|
|
|
thrInvOrderDetail.setUdiCode(udiCode);
|
|
|
|
thrInvOrderDetail.setThrCode(thrCode);
|
|
|
|
thrInvOrderDetail.setThrCode(thrCode);
|
|
|
|
thrInvOrderDetail.setReCount(String.valueOf(count));
|
|
|
|
thrInvOrderDetail.setReCount(String.valueOf(count));
|
|
|
@ -762,9 +767,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
Long relId = item.getRelId();
|
|
|
|
Long relId = item.getRelId();
|
|
|
|
if (ObjectUtil.isNull(relId)) {
|
|
|
|
if (ObjectUtil.isNull(relId)) {
|
|
|
|
String nameCode = item.getNameCode();
|
|
|
|
String nameCode = item.getNameCode();
|
|
|
|
List<BasicProductsEntity> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
List<UdiRelevanceResponse> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
BasicProductsEntity basicProductsEntity = productsEntities.get(0);
|
|
|
|
UdiRelevanceResponse basicProductsEntity = productsEntities.get(0);
|
|
|
|
item.setRelId(basicProductsEntity.getId());
|
|
|
|
item.setRelId(basicProductsEntity.getId());
|
|
|
|
updateThrInvOrderDetails.add(item);
|
|
|
|
updateThrInvOrderDetails.add(item);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -1193,9 +1198,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
Long relId = item.getRelId();
|
|
|
|
Long relId = item.getRelId();
|
|
|
|
if (ObjectUtil.isNull(relId)) {
|
|
|
|
if (ObjectUtil.isNull(relId)) {
|
|
|
|
String nameCode = item.getNameCode();
|
|
|
|
String nameCode = item.getNameCode();
|
|
|
|
List<BasicProductsEntity> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
List<UdiRelevanceResponse> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
BasicProductsEntity basicProductsEntity = productsEntities.get(0);
|
|
|
|
UdiRelevanceResponse basicProductsEntity = productsEntities.get(0);
|
|
|
|
item.setRelId(basicProductsEntity.getId());
|
|
|
|
item.setRelId(basicProductsEntity.getId());
|
|
|
|
item.setHandleStatus(1);
|
|
|
|
item.setHandleStatus(1);
|
|
|
|
item.setToBillNo(newBillNo);
|
|
|
|
item.setToBillNo(newBillNo);
|
|
|
|