|
|
|
@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
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.QueryWrapper;
|
|
|
|
|
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.res.PageSimpleResponse;
|
|
|
|
|
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.thrsys.ThrInvOrderResponse;
|
|
|
|
|
import com.glxp.api.service.auth.CustomerService;
|
|
|
|
@ -221,13 +223,13 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
|
|
|
|
|
//是否自动生成出入库单据
|
|
|
|
|
if (IntUtil.value(systemParamConfigService.selectValueByParamKey("gh_out_auto_gen")) > 0) {
|
|
|
|
|
if (StrUtil.isBlank(thrInvOrder.getExMsg())) {
|
|
|
|
|
GenerateOrderRequest generateOrderRequest = new GenerateOrderRequest();
|
|
|
|
|
generateOrderRequest.setBillNo(thrInvOrder.getBillNo());
|
|
|
|
|
generateOrderRequest.setAction(thrInvOrder.getBillType());
|
|
|
|
|
// generateOrderRequest.setFromCorp(thrInvOrder.getFromCorp());
|
|
|
|
|
generateGhOrder(generateOrderRequest);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -253,9 +255,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
String udiCode = item.getUdiCode();
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(udiCode);
|
|
|
|
|
String nameCode = udiEntity.getUdi();
|
|
|
|
|
List<BasicProductsEntity> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
|
List<UdiRelevanceResponse> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
|
BasicProductsEntity basicProductsEntity = productsEntities.get(0);
|
|
|
|
|
UdiRelevanceResponse basicProductsEntity = productsEntities.get(0);
|
|
|
|
|
String mainAction = item.getMainAction();
|
|
|
|
|
String thrCode = item.getThrCode();
|
|
|
|
|
|
|
|
|
@ -277,6 +279,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
thrInvOrderDetail.setSupId(udiRlSupEntity.getCustomerId());
|
|
|
|
|
else
|
|
|
|
|
exmsg.append(thrCode + "供应商未关联");
|
|
|
|
|
if (IntUtil.value(basicProductsEntity.getPurType()) == 0) {
|
|
|
|
|
exmsg.append(thrCode + "采购类型未设置");
|
|
|
|
|
}
|
|
|
|
|
thrInvOrderDetail.setUdiCode(udiCode);
|
|
|
|
|
thrInvOrderDetail.setThrCode(thrCode);
|
|
|
|
|
thrInvOrderDetail.setReCount(String.valueOf(count));
|
|
|
|
@ -762,9 +767,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
Long relId = item.getRelId();
|
|
|
|
|
if (ObjectUtil.isNull(relId)) {
|
|
|
|
|
String nameCode = item.getNameCode();
|
|
|
|
|
List<BasicProductsEntity> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
|
List<UdiRelevanceResponse> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
|
BasicProductsEntity basicProductsEntity = productsEntities.get(0);
|
|
|
|
|
UdiRelevanceResponse basicProductsEntity = productsEntities.get(0);
|
|
|
|
|
item.setRelId(basicProductsEntity.getId());
|
|
|
|
|
updateThrInvOrderDetails.add(item);
|
|
|
|
|
} else {
|
|
|
|
@ -1193,9 +1198,9 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
Long relId = item.getRelId();
|
|
|
|
|
if (ObjectUtil.isNull(relId)) {
|
|
|
|
|
String nameCode = item.getNameCode();
|
|
|
|
|
List<BasicProductsEntity> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
|
List<UdiRelevanceResponse> productsEntities = udiRelevanceDao.getProductsEntitiesByNameCode(nameCode);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(productsEntities)) {
|
|
|
|
|
BasicProductsEntity basicProductsEntity = productsEntities.get(0);
|
|
|
|
|
UdiRelevanceResponse basicProductsEntity = productsEntities.get(0);
|
|
|
|
|
item.setRelId(basicProductsEntity.getId());
|
|
|
|
|
item.setHandleStatus(1);
|
|
|
|
|
item.setToBillNo(newBillNo);
|
|
|
|
|