Merge remote-tracking branch 'origin/release' into release

release
zhenghaiyang@ele-cloud.com 2 years ago
commit 2a667e2d1b
  1. 34
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/thirdservice/user/service/impl/UserInfoServiceImpl.java
  2. 8
      order-management-common/src/main/java/com/dxhy/order/utils/CheckParamUtil.java
  3. 13
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/controller/OrderInfoController.java
  4. 2
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/OrderInfoService.java
  5. 95
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderInfoServiceImpl.java
  6. 4
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/InterfaceServiceImplV6.java
  7. 2
      order-management-consumer/src/main/java/com/dxhy/order/consumer/utils/BeanTransitionUtils.java
  8. 2
      order-management-consumer/src/main/resources/bootstrap.yaml
  9. 34
      order-management-invoice/src/main/resources/mybatis/mapper/OrderItemInfoMapper.xml

@ -446,22 +446,24 @@ public class UserInfoServiceImpl implements UserInfoService {
List<GroupManagementEntity> entityList = groupManagementService.queryByGroupIdList(groupIdList);
if (entityList != null && entityList.size() > 0) {
//选出默认项
Optional<GroupManagementEntity> groupManagementEntityOptional = entityList.stream()
.filter(groupManagementEntity -> OrderInfoEnum.ORDER_KPZZGL_SFMRX_0.getKey().equals(groupManagementEntity.getDefaultItem()))
.findFirst();
GroupManagementEntity groupManagementEntity = groupManagementEntityOptional.orElseGet(() -> entityList.get(0));
deptEntityNew = new DeptEntity();
deptEntityNew.setDeptId(deptEntity.getDeptId());
deptEntityNew.setTaxpayerCode(groupManagementEntity.getXhfNsrsbh());
//todo 虚拟组织:组织名称和销方名称公用此字段会有问题,后期优化
deptEntityNew.setName(groupManagementEntity.getGroupName());
deptEntityNew.setTaxpayerName(groupManagementEntity.getXhfMc());
deptEntityNew.setTaxpayerAddress(groupManagementEntity.getXhfDz());
deptEntityNew.setTaxpayerPhone(groupManagementEntity.getXhfDh());
deptEntityNew.setTaxpayerBank(groupManagementEntity.getXhfYh());
deptEntityNew.setTaxpayerAccount(groupManagementEntity.getXhfZh());
deptEntityNew.setInvoiceName(groupManagementEntity.getXhfMc());
deptEntityNew.setInvoiceNsrsbh(groupManagementEntity.getXhfNsrsbh());
List<GroupManagementEntity> collect = entityList.stream()
.filter(groupManagementEntity -> OrderInfoEnum.ORDER_KPZZGL_SFMRX_0.getKey().equals(groupManagementEntity.getDefaultItem())).collect(Collectors.toList());
GroupManagementEntity groupManagementEntity = null;
if(!collect.isEmpty()){
groupManagementEntity = collect.get(0);
deptEntityNew = new DeptEntity();
deptEntityNew.setDeptId(deptEntity.getDeptId());
deptEntityNew.setTaxpayerCode(groupManagementEntity.getXhfNsrsbh());
//todo 虚拟组织:组织名称和销方名称公用此字段会有问题,后期优化
deptEntityNew.setName(groupManagementEntity.getGroupName());
deptEntityNew.setTaxpayerName(groupManagementEntity.getXhfMc());
deptEntityNew.setTaxpayerAddress(groupManagementEntity.getXhfDz());
deptEntityNew.setTaxpayerPhone(groupManagementEntity.getXhfDh());
deptEntityNew.setTaxpayerBank(groupManagementEntity.getXhfYh());
deptEntityNew.setTaxpayerAccount(groupManagementEntity.getXhfZh());
deptEntityNew.setInvoiceName(groupManagementEntity.getXhfMc());
deptEntityNew.setInvoiceNsrsbh(groupManagementEntity.getXhfNsrsbh());
}
}
return deptEntityNew;
}

@ -239,4 +239,12 @@ public class CheckParamUtil {
return errorMap;
}
public static void main(String[] args) {
try {
CheckParamUtil.checkParam(OrderInfoContentEnum.CHECK_ISS7PRI_107059, "塑料(ABS)_防静电_华信V-PRO矿工帽 带矿", "");
//System.out.println("塑料(ABS)_防静电_华信V-PRO矿工帽 带矿".getBytes("GBK").length);
} catch (Exception e) {
e.printStackTrace();
}
}
}

@ -455,4 +455,17 @@ public class OrderInfoController {
return R.error("系统异常,请联系管理员");
}
}
@ApiOperation(value = "订单更新物料", notes = "订单信息管理-更新物料")
@PostMapping("/updateOrderItem")
@SysLog(operation = "订单更新物料", operationDesc = "订单更新物料", key = "订单更新物料")
public R updateOrderItem(@RequestParam("orderId")String orderId,@RequestParam("entId")String entId){
try {
return orderInfoService.updateOrderItem(orderId,entId);
} catch (Exception e) {
log.error(e.getMessage());
return R.error("系统异常");
}
}
}

@ -214,4 +214,6 @@ public interface OrderInfoService {
@Transactional
R logicalDeleteByOrderInfoId(List<PageRequestVO> pageRequestList);
R updateOrderItem(String orderInfoId,String entId);
}

@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.dxhy.base.constant.OrderSeparationException;
import com.dxhy.base.constant.TaxSeparateConfig;
import com.dxhy.base.utils.PriceTaxSeparationUtilNew;
@ -11,6 +12,9 @@ import com.dxhy.common.generatepdf.util.EwmUtil;
import com.dxhy.order.baseservice.config.BaseServiceConfig;
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntity;
import com.dxhy.order.baseservice.module.buyer.service.BuyerService;
import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity;
import com.dxhy.order.baseservice.module.taxclass.dao.TaxClassCodeMapper;
import com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity;
import com.dxhy.order.baseservice.module.thirdservice.simsback.service.SimsBackService;
import com.dxhy.order.baseservice.module.thirdservice.user.model.DeptEntity;
import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService;
@ -18,6 +22,7 @@ import com.dxhy.order.constant.ConfigureConstant;
import com.dxhy.order.constant.OrderInfoContentEnum;
import com.dxhy.order.constant.OrderInfoEnum;
import com.dxhy.order.constant.OrderManagementConstant;
import com.dxhy.order.consumer.dao.GroupCommodityCodeMapper;
import com.dxhy.order.consumer.dao.OrderBatchRequestMapper;
import com.dxhy.order.consumer.dao.OrderProcessInfoMapper;
import com.dxhy.order.consumer.model.OderDetailInfo;
@ -154,6 +159,12 @@ public class OrderInfoServiceImpl implements OrderInfoService {
@Resource
private SpecialInvoiceReversalMapper specialInvoiceReversalMapper;
@Resource
private GroupCommodityCodeMapper commodityCodeMapper;
@Resource
private TaxClassCodeMapper taxClassCodeMapper;
@Resource
private OrderBatchRequestMapper orderBatchRequestMapper;
@ -1792,6 +1803,90 @@ public class OrderInfoServiceImpl implements OrderInfoService {
return R.ok();
}
@Override
public R updateOrderItem(String orderInfoId,String entId){
//根据订单id查询明细数据
List<OrderItemInfo> orderItemInfos = orderItemInfoMapper.selectAllByOrderId(Arrays.asList(orderInfoId), null);
List<OrderItemInfo> orderItemInfoList = new ArrayList<>();
for (OrderItemInfo orderItemInfo : orderItemInfos) {
// if(StringUtils.isNotBlank(orderItemInfo.getSpbm())){
// continue;
// }
CommodityCodeEntity commodityCodeEntity = commodityCodeMapper.queryCommodityCodeByZxbmAndXhfNsrsbhAndEntId(orderItemInfo.getZxbm(), null, entId);
// 如果公司物料库匹配失败,从集团物料库匹配
if (commodityCodeEntity == null) {
// 如果匹配不到,则去集团物料库匹配
commodityCodeEntity = commodityCodeMapper.queryCommodityCodeByZxbmAndXhfNsrsbhAndEntId(orderItemInfo.getZxbm(), "-1",null);
}
if(commodityCodeEntity != null){
completeCommodityMessageBySpid(orderItemInfo, commodityCodeEntity);
orderItemInfo.setZnfm(ConfigureConstant.STRING_0);
orderItemInfo.setXmsl(null);
orderItemInfo.setXmdj(null);
}
orderItemInfoList.add(orderItemInfo);
}
if(!orderItemInfoList.isEmpty()){
orderItemInfoMapper.updateOrderItemId(orderItemInfoList);
}
return R.ok();
}
private void completeCommodityMessageBySpid(OrderItemInfo item, CommodityCodeEntity commodity) {
//商品编码
item.setSpbm(commodity.getSpbm());
//优惠政策标识
if (StringUtils.isBlank(item.getYhzcbs()) && StringUtils.isNotBlank(commodity.getYhzcbs())) {
item.setYhzcbs(commodity.getYhzcbs());
}else if(StringUtils.isBlank(item.getYhzcbs()) && StringUtils.isBlank(commodity.getYhzcbs())){
item.setYhzcbs(ConfigureConstant.STRING_0);
}
//零税率标识
item.setLslbs(commodity.getLslbs());
//增值税特殊管理
item.setZzstsgl(commodity.getZzstsgl());
//如果项目名称为空,使用底层返回数据进行补全,如果不为空,并且需要补全,则进行补全
String spmc = item.getXmmc();
StringBuilder stringBuilder = new StringBuilder();
if (StringUtils.isBlank(spmc)) {
if(StrUtil.isNotBlank(commodity.getInvoiceName())){
spmc = stringBuilder.append("*").append(commodity.getSpjc()).append("*").append(commodity.getInvoiceName()).toString();
}else{
spmc = stringBuilder.append("*").append(commodity.getSpjc()).append("*").append(commodity.getXmmc()).toString();
}
} else if (StringUtil.checkStr(spmc, commodity.getSpjc())) {
spmc = stringBuilder.append("*").append(commodity.getSpjc()).append("*").append(commodity.getXmmc()).toString();
}
item.setXmmc(spmc);
//发票行性质为折扣行,不补全,单价,数量,单位,规格型号
if (!OrderInfoEnum.FPHXZ_CODE_1.getKey().equals(item.getFphxz())) {
//规格型号
if (StringUtils.isNotBlank(commodity.getGgxh())) {
item.setGgxh(commodity.getGgxh());
}
//单位
if (StringUtils.isNotBlank(commodity.getXmdw())) {
item.setXmdw(commodity.getXmdw());
}
}
//含税标志
if (StringUtils.isBlank(item.getHsbz()) && StringUtils.isNotBlank(commodity.getHsbz())) {
item.setHsbz(commodity.getHsbz());
}
if(StringUtils.isNotBlank(commodity.getTswl())){
item.setTswl(commodity.getTswl());
}
}
private PageKySlRsp getDefaultKySlList(OrderInfoEnum orderInfoEnum){
PageKySlRsp pageKySlRsp = new PageKySlRsp();
pageKySlRsp.setSl(orderInfoEnum.getKey());

@ -148,7 +148,7 @@ public class InterfaceServiceImplV6 implements InterfaceServiceV6 {
queryMap.put("bzdh",bzdh);
List<OrderProcessInfo> orderProcessInfos = orderProcessInfoMapper.queryOrderInfo(queryMap, null, null);
//过滤留下有效订单,且判断有效订单是否存在开票中、已开票
esOutput.setZTYPE(OrderInfoContentEnum.INVOICE_ERROR_CODE_OP_E.getKey());
esOutput.setZTYPE(OrderInfoContentEnum.INVOICE_ERROR_CODE_OP_S.getKey());
if(orderProcessInfos == null || orderProcessInfos.isEmpty()){
esOutput.setZMESSAGE("根据报账单号未查询到唯一结算单");
poCommonResponseParam.setES_OUTPUT(esOutput);
@ -202,7 +202,7 @@ public class InterfaceServiceImplV6 implements InterfaceServiceV6 {
return poCommonResponseParam;
}
esOutput.setZTYPE(OrderInfoContentEnum.INVOICE_ERROR_CODE_OP_S.getKey());
//esOutput.setZTYPE(OrderInfoContentEnum.INVOICE_ERROR_CODE_OP_S.getKey());
esOutput.setZMESSAGE("驳回状态更新成功");
poCommonResponseParam.setES_OUTPUT(esOutput);
return poCommonResponseParam;

@ -3603,7 +3603,7 @@ public class BeanTransitionUtils {
EsOutput esOutput = new EsOutput();
esOutput.setBSKEY(ddpcxxRspV5.getDDQQPCH());
esOutput.setSAPKEY(ddpcxxRspV5.getDDQQPCH());
if (OrderInfoContentEnum.INVOICE_ERROR_CODE_010000_V3.getKey().equals(ddpcxxRspV5.getZTDM())) {
if (OrderInfoContentEnum.INVOICE_ERROR_CODE_010000_V3.getKey().equals(ddpcxxRspV5.getZTDM())||OrderInfoContentEnum.INVOICE_ERROR_CODE_010002_V3.getKey().equals(ddpcxxRspV5.getZTDM())) {
esOutput.setZTYPE(OrderInfoContentEnum.INVOICE_ERROR_CODE_OP_S.getKey());
} else {
esOutput.setZTYPE(OrderInfoContentEnum.INVOICE_ERROR_CODE_OP_E.getKey());

@ -39,7 +39,7 @@ sims:
#订单数据库类型区分,要么mysql,要么Oracle,要么weblogic
db: mysql
#订单redis数据库类型区分,要么redis,要么redis-sentinel
redisDb: redis-sentinel
redisDb: redis
# 0 mysql 1 oracle
dataType: 0

@ -274,18 +274,44 @@
<foreach collection="list" item="item" separator=";">
UPDATE order_item_info
<set>
<if test="item.xmsl != null ">
<if test="item.xmsl != null and item.xmsl != ''">
xmsl = #{item.xmsl,jdbcType=VARCHAR},
</if>
<if test="item.xmdj != null ">
<if test="item.xmdj != null and item.xmdj != ''">
xmdj = #{item.xmdj,jdbcType=VARCHAR},
</if>
<if test="item.xmdw != null ">
<if test="item.xmdw != null and item.xmdw != ''">
xmdw = #{item.xmdw,jdbcType=VARCHAR},
</if>
<if test="item.znfm != null ">
<if test="item.znfm != null and item.znfm != ''">
znfm = #{item.znfm,jdbcType=VARCHAR},
</if>
<if test="item.xmmc != null and item.znfm != ''">
xmmc = #{item.xmmc,jdbcType=VARCHAR},
</if>
<if test="item.ggxh != null and item.znfm != ''">
ggxh = #{item.ggxh,jdbcType=VARCHAR},
</if>
<if test="item.hsbz != null and item.znfm != ''">
hsbz = #{item.hsbz,jdbcType=VARCHAR},
</if>
<if test="item.spbm != null and item.znfm != ''">
spbm = #{item.spbm,jdbcType=VARCHAR},
</if>
<if test="item.yhzcbs != null and item.znfm != ''">
yhzcbs = #{item.yhzcbs,jdbcType=VARCHAR},
</if>
<if test="item.lslbs != null and item.znfm != ''">
lslbs = #{item.lslbs,jdbcType=VARCHAR},
</if>
<if test="item.zzstsgl != null and item.znfm != ''">
zzstsgl = #{item.zzstsgl,jdbcType=VARCHAR},
</if>
<if test="item.tswl != null and item.znfm != ''" >
tswl = #{item.tswl,jdbcType=VARCHAR},
</if>
</set>
<where>
id = #{item.id,jdbcType=VARCHAR}

Loading…
Cancel
Save