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

release
WangQi 2 years ago
commit fbcb9c5f3e
  1. 74
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/buyer/service/impl/BuyerServiceImpl.java
  2. 21
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/commodity/controller/CommodityController.java
  3. 3
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/commodity/dao/CommodityMapper.java
  4. 8
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/commodity/service/CommodityService.java
  5. 24
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/commodity/service/impl/CommodityServiceImpl.java
  6. 2
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/taxclass/dao/TaxClassCodeMapper.java
  7. 3
      order-management-base-service/src/main/resources/mybatis/mapper/BuyerMapper.xml
  8. 44
      order-management-base-service/src/main/resources/mybatis/mapper/CommodityMapper.xml
  9. 7
      order-management-base-service/src/main/resources/mybatis/mapper/TaxClassCodeMapper.xml
  10. 6
      order-management-common/src/main/java/com/dxhy/order/constant/TaxClassCodeEnum.java
  11. 22
      order-management-consumer/src/main/java/com/dxhy/order/consumer/config/rabbitmq/OrderSaveSpxxHandler.java
  12. 102
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/InvoiceServiceImpl.java
  13. 29
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/controller/OrderInfoController.java
  14. 1
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/controller/OrderInvoiceController.java
  15. 22
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/model/vo/OrderInfoVo.java
  16. 7
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/OrderInfoService.java
  17. 146
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderInfoServiceImpl.java
  18. 2
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderSplitServiceImpl.java
  19. 11
      order-management-invoice/src/main/java/com/dxhy/order/invoice/module/invoicespecial/service/impl/SpecialInvoiceServiceImpl.java

@ -177,6 +177,7 @@ public class BuyerServiceImpl implements BuyerService {
if (StringUtils.isNotEmpty(buyerEntity.getTaxpayerCode())) {
param.put("taxpayerCode", buyerEntity.getTaxpayerCode());
param.put("entId", buyerEntity.getEntId());
int i = buyerMapper.selectBuyerByName(param, shList);
if (i > 0) {
Map<String, String> checkResultMap1 = new HashMap<>(2);
@ -190,6 +191,7 @@ public class BuyerServiceImpl implements BuyerService {
if (StringUtils.isNotEmpty(buyerEntity.getPurchaseName())) {
param = new HashMap<>(5);
param.put("purchaseName", buyerEntity.getPurchaseName());
param.put("entId", buyerEntity.getEntId());
int i = buyerMapper.selectBuyerByName(param, shList);
if (i > 0) {
Map<String, String> checkResultMap1 = new HashMap<>(2);
@ -207,7 +209,7 @@ public class BuyerServiceImpl implements BuyerService {
}
if (StringUtils.isNotEmpty(buyerEntity.getEntId())&&StringUtils.isNotEmpty(buyerEntity.getBuyerCode())) {
param = new HashMap<>(5);
param.put("ent_id", buyerEntity.getEntId());
param.put("entId", buyerEntity.getEntId());
param.put("buyerCode", buyerEntity.getBuyerCode());
int i = buyerMapper.selectBuyerByName(param, shList);
if (i > 0) {
@ -245,44 +247,46 @@ public class BuyerServiceImpl implements BuyerService {
// .put(OrderManagementConstant.MESSAGE, "上传失败");
// } else {
importSuccessCount = buyerEntitys.size();
for (BuyerEntity buyerEntity : buyerEntitys) {
//数据重复性校验
buyerEntity.setId(baseService.getGenerateShotKey());
if (StringUtils.isBlank(buyerEntity.getBuyerCode())) {
buyerEntity.setBuyerCode(baseService.getGenerateShotKey());
}
List<BuyerEntityDetail> buyerEntityDetail = new ArrayList<>();
BuyerEntityDetail buyerEntityDetail1 = new BuyerEntityDetail();
buyerEntityDetail1.setBuyerManageId(buyerEntity.getId());
buyerEntityDetail1.setBankAccount(buyerEntity.getBankNumber());
buyerEntityDetail1.setBankName(buyerEntity.getBankOfDeposit());
buyerEntityDetail1.setAddress(buyerEntity.getAddress());
buyerEntityDetail1.setPhone(buyerEntity.getPhone());
buyerEntityDetail1.setCreateTime(new Date());
buyerEntityDetail1.setDefaultMark("0");
try {
buyerEntityDetail1.setCreateUser(userInfoService.getUser().getUserId().toString());
} catch (Exception e) {
buyerEntityDetail1.setCreateUser("");
}
buyerEntityDetail.add(buyerEntityDetail1);
buyerMapper.batchInsertBuyerDetail(buyerEntityDetail);
}
if (buyerEntitys.size() < ConfigureConstant.BATCH_INSERT) {
buyerMapper.insertBuyerByList(buyerEntitys);
} else {
List<BuyerEntity> insertBuyerList = new ArrayList<>();
int i = 0;
if (importSuccessCount > 0){
for (BuyerEntity buyerEntity : buyerEntitys) {
if (i != 0 && i % ConfigureConstant.BATCH_INSERT == 0) {
buyerMapper.insertBuyerByList(insertBuyerList);
insertBuyerList = new ArrayList<>();
//数据重复性校验
buyerEntity.setId(baseService.getGenerateShotKey());
if (StringUtils.isBlank(buyerEntity.getBuyerCode())) {
buyerEntity.setBuyerCode(baseService.getGenerateShotKey());
}
insertBuyerList.add(buyerEntity);
i++;
List<BuyerEntityDetail> buyerEntityDetail = new ArrayList<>();
BuyerEntityDetail buyerEntityDetail1 = new BuyerEntityDetail();
buyerEntityDetail1.setBuyerManageId(buyerEntity.getId());
buyerEntityDetail1.setBankAccount(buyerEntity.getBankNumber());
buyerEntityDetail1.setBankName(buyerEntity.getBankOfDeposit());
buyerEntityDetail1.setAddress(buyerEntity.getAddress());
buyerEntityDetail1.setPhone(buyerEntity.getPhone());
buyerEntityDetail1.setCreateTime(new Date());
buyerEntityDetail1.setDefaultMark("0");
try {
buyerEntityDetail1.setCreateUser(userInfoService.getUser().getUserId().toString());
} catch (Exception e) {
buyerEntityDetail1.setCreateUser("");
}
buyerEntityDetail.add(buyerEntityDetail1);
buyerMapper.batchInsertBuyerDetail(buyerEntityDetail);
}
if (buyerEntitys.size() > 0) {
if (buyerEntitys.size() < ConfigureConstant.BATCH_INSERT) {
buyerMapper.insertBuyerByList(buyerEntitys);
} else {
List<BuyerEntity> insertBuyerList = new ArrayList<>();
int i = 0;
for (BuyerEntity buyerEntity : buyerEntitys) {
if (i != 0 && i % ConfigureConstant.BATCH_INSERT == 0) {
buyerMapper.insertBuyerByList(insertBuyerList);
insertBuyerList = new ArrayList<>();
}
insertBuyerList.add(buyerEntity);
i++;
}
if (buyerEntitys.size() > 0) {
buyerMapper.insertBuyerByList(buyerEntitys);
}
}
}
resultMap.put("list", list);

@ -38,6 +38,8 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
@ -128,8 +130,6 @@ public class CommodityController {
commodityCodeEntity.setXhfNsrsbh(nsrsbh);
log.info("参数:{}", JsonUtils.getInstance().toJsonString(commodityCodeEntity));
//获取当前登录人ID
Long userId = userInfoService.getUser().getUserId();
commodityCodeEntity.setUserId(userId.toString());
if (StringUtils.isNotBlank(commodityCodeEntity.getSl()) && commodityCodeEntity.getSl().contains(ConfigureConstant.STRING_PERCENT)) {
commodityCodeEntity.setSl(CommonUtils.formatSl(commodityCodeEntity.getSl()));
}
@ -163,6 +163,7 @@ public class CommodityController {
if (StringUtils.isBlank(commodityCodeEntity.getYcbz())) {
commodityCodeEntity.setYcbz(ConfigureConstant.STRING_0);
}
//物料编码不允许为空
if(StringUtils.isBlank(commodityCodeEntity.getZxbm())||"000000000000000000".equals(commodityCodeEntity.getZxbm())){
commodityCodeEntity.setZxbm(commodityCodeEntity.getId());
}
@ -182,6 +183,22 @@ public class CommodityController {
}
}
@PostMapping("/brachUpdateTaxCode")
@ApiOperation(value = "集团库更新税编", notes = "集团物料库-更新税编")
@SysLog(operation = "更新税编", operationDesc = "集团物料库更新税编", key = "批量更新税编")
public R brachUpdateTaxCode(@RequestParam @Size(min = 1) List<String> ids, @RequestParam @NotEmpty(message = "商品编码不允许为空")String spbm, @RequestParam String spjc) {
CommodityCodeEntity commodityCode = new CommodityCodeEntity();
commodityCode.setSpjc(spjc);
commodityCode.setSpbm(spbm);
try {
commodityService.batchUpdateCommodity(commodityCode,ids);
} catch (Exception e) {
log.error("更新集团物料失败,异常信息{}",e);
return R.error("系统更新异常,请联系管理员");
}
return R.ok();
}
/**
* 删除
*

@ -94,8 +94,9 @@ public interface CommodityMapper {
*/
List<CommodityCodeEntity> queryCommodityInfoList(@Param("pageSpxxReq") PageSpxxReq pageSpxxReq, @Param("shList") List<String> shList);
int queryCountByEntAndEncode(@Param("encoding")String encoding,@Param("merchandiseName")String merchandiseName,@Param("entId")String entId);
List<CommodityCodeEntity> queryCommodityByencodings(@Param("encodings") List<String> encoding,@Param("entIds")List<String> entId, @Param("shList") List<String> shList);
int queryCountByEntAndEncode(@Param("encoding")String encoding,@Param("merchandiseName")String merchandiseName,@Param("entId")String entId);
/**
* 查询商品信息列表

@ -151,4 +151,12 @@ public interface CommodityService {
* @throws ExcelReadException 表格导入自定义异常
*/
SXSSFWorkbook exportCommodityExcel(List<CommodityExcel> commodityExcelList) throws ExcelReadException;
/**
* 更新集团物料的税编
* @param codeEntity
* @param ids
* @return
*/
R batchUpdateCommodity(CommodityCodeEntity codeEntity, List<String> ids);
}

@ -103,7 +103,7 @@ public class CommodityServiceImpl implements CommodityService {
@Transactional
public R addOrEditCommodity(CommodityCodeEntity codeEntity) {
List<String> shList = NsrsbhUtils.transShListByNsrsbh(codeEntity.getXhfNsrsbh());
Long userId = userInfoService.getUser().getUserId();
//判断保存或者修改操作
String id = codeEntity.getId();
Map<String,String> map = new HashMap<>();
@ -128,18 +128,20 @@ public class CommodityServiceImpl implements CommodityService {
codeEntity.setDataState(TaxClassCodeEnum.DATA_STATE_0.getKey());
}
// 记录修改记录
Long userId = userInfoService.getUser().getUserId();
if(commodityCodeModifyLogService.saveCommodityCodeDifferenceBetween2(commodityCodeEntities.get(0), codeEntity, userId) == -1){
return R.error().put(OrderManagementConstant.DATA, "数据未进行修改,无需保存");
}
codeEntity.setXhfNsrsbh(null);
codeEntity.setXhfNsrsbh(null);//不更新税号
codeEntity.setModifyTime(new Date());
codeEntity.setModifyUserId(userId.toString());
if(commodityMapper.updateCommodity(codeEntity, null) <= 0){
return R.error().put(OrderManagementConstant.DATA, "更新物料信息失败,请联系管理员");
}
} else {
codeEntity.setDataSource(TaxClassCodeEnum.DATA_SOURCE_1.getKey());
codeEntity.setCreateTime(new Date());
codeEntity.setUserId(userId.toString());
codeEntity.setMatchingState(TaxClassCodeEnum.MATCHING_STATE_1.getKey());
//未匹配默认为停用
codeEntity.setDataState(TaxClassCodeEnum.DATA_STATE_1.getKey());
@ -643,7 +645,7 @@ public class CommodityServiceImpl implements CommodityService {
}
}else{
// TODO 简称、商品编码、规格型号、单位、优惠政策标识、零税率标识
// 简称、商品编码、规格型号、单位、优惠政策标识、零税率标识
if (commodityCodeEntity != null){
commodityMapper.updateCommodityByZxbm(commodityCodeEntity, map);
}
@ -678,6 +680,18 @@ public class CommodityServiceImpl implements CommodityService {
return sxssfWorkbook;
}
@Override
public R batchUpdateCommodity(CommodityCodeEntity codeEntity, List<String> ids){
// 校验税编是否为汇总项
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeService.queryTaxClassCodeFromCache(codeEntity.getSpbm());
if(taxClassCodeEntity == null){
return R.error("商品税编有误或未汇总项,请确认后再操作");
}
//校验ids是否为集团物料
commodityMapper.batchUpdateCommodity(codeEntity, ids);
return R.ok();
}
/**
* 数据转换
*

@ -28,7 +28,7 @@ public interface TaxClassCodeMapper {
* @param spbms
* @return
*/
Integer countTaxClassCodeBySpbm(@Param("spbms") List<String> spbms,@Param("map")Map map);
List<TaxClassCodeEntity> selectTaxClassCodeList(@Param("spbms") List<String> spbms,@Param("map")Map map);
List<TaxClassCodeEntity> selectTaxClassCodeBySpmcOrSm(String queryString);

@ -925,6 +925,9 @@
<if test="map.buyerCode != null and map.buyerCode != ''">
AND buyer_code =#{map.buyerCode,jdbcType=VARCHAR}
</if>
<if test="map.entId != null and map.entId != ''">
AND ent_id =#{map.entId,jdbcType=VARCHAR}
</if>
</where>
</select>

@ -1131,6 +1131,50 @@
limit 1000
</select>
<select id="queryCommodityByencodings" resultMap="commodityCodeResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM
commodity_code cc
where
cc.encoding in
<foreach collection="encodings" item="encoding" open="(" separator="," close=")">
#{encoding}
</foreach>
<if test="entIds != null and entIds.size() == 0">
and cc.ent_id = ''
</if>
<if test="entIds != null and entIds.size() == 1">
and cc.ent_id =
<foreach collection="entIds" item="entId">
#{entId}
</foreach>
</if>
<if test="entIds != null and entIds.size() > 1">
and cc.ent_id in
<foreach collection="entIds" item="entId" open="(" separator="," close=")">
#{entId}
</foreach>
</if>
<if test="shList != null and shList.size() == 0">
and cc.xhf_nsrsbh = ''
</if>
<if test="shList != null and shList.size() == 1">
and cc.xhf_nsrsbh =
<foreach collection="shList" index="index" item="item">
#{item}
</foreach>
</if>
<if test="shList != null and shList.size() > 1">
and cc.xhf_nsrsbh in
<foreach collection="shList" index="index" item="item"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<!--查询集团下面企业可采集的数据 匹配状态为0(已匹配) 数据状态为0(启用) 数据来源为1(页面创建)、2(模板导入)-->
<select id="getCommodityCode" resultMap="commodityCodeResultMap" parameterType="string">
SELECT

@ -44,9 +44,9 @@
where tcc.spbm = #{spbm} limit 1
</select>
<select id="countTaxClassCodeBySpbm" parameterType="java.lang.String" resultType="java.lang.Integer">
<select id="selectTaxClassCodeList" parameterType="java.lang.String" resultType="com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity">
SELECT
count(*)
*
FROM
tax_class_code tcc
where tcc.spbm in
@ -56,6 +56,9 @@
<if test="map.cpy != null and map.cpy != ''">
and cpy = #{map.cpy}
</if>
<if test="map.hzx != null and map.hzx != ''">
and hzx = #{map.hzx}
</if>
</select>

@ -25,7 +25,11 @@ public enum TaxClassCodeEnum {
DATA_SOURCE_3("3", "采集下级"),
DATA_SOURCE_4("4", "自动归集"),//物料更新没使用
DATA_SOURCE_5("5", "接口同步"),
DATA_SOURCE_6("6", "开票自动归集"),
DATA_SOURCE_6("6", "手工填开"),
DATA_SOURCE_7("7", "历史数据"),
DATA_SOURCE_8("8", "订单同步公司库"),
DATA_SOURCE_9("9", "引用集团库"),
DATA_SOURCE_10("10", "克隆公司库"),
/**
* 匹配状态
*/

@ -111,7 +111,7 @@ public class OrderSaveSpxxHandler implements BaseListener {
List<String> shList = NsrsbhUtils.transShListByNsrsbh(orderInvoiceInfo.getXhfNsrsbh());
List<OrderItemInfo> orderItemInfoList = orderItemInfoService.selectOrderItemInfoByOrderId(orderInvoiceInfo.getOrderInfoId(), shList);
List<OrderItemInfo> updateZnfmList = new ArrayList<>();
//List<OrderItemInfo> updateZnfmList = new ArrayList<>();
if (ObjectUtil.isNotEmpty(orderItemInfoList)) {
List<ReceiveSpxxReq> receiveSpxxReqList = new ArrayList<>();
for (OrderItemInfo orderItemInfo : orderItemInfoList) {
@ -121,18 +121,18 @@ public class OrderSaveSpxxHandler implements BaseListener {
receiveSpxxReq.setEntId(userInfoService.getUser() != null ? userInfoService.getUser().getDeptId():orderInvoiceInfo.getEntId());
receiveSpxxReqList.add(receiveSpxxReq);
//更新是否为只能赋码
if("1".equals(orderItemInfo.getZnfm())){
OrderItemInfo orderItemInfo1 = new OrderItemInfo();
orderItemInfo1.setId(orderItemInfo.getId());
orderItemInfo1.setZnfm("0");
updateZnfmList.add(orderItemInfo1);
}
// if("1".equals(orderItemInfo.getZnfm())){
// OrderItemInfo orderItemInfo1 = new OrderItemInfo();
// orderItemInfo1.setId(orderItemInfo.getId());
// orderItemInfo1.setZnfm("0");
// updateZnfmList.add(orderItemInfo1);
// }
}
//事务控制
commodityService.saveCommodityCodeEntity(receiveSpxxReqList);
if(ObjectUtil.isNotEmpty(updateZnfmList)){
orderItemInfoService.updateOrderItemId(updateZnfmList);
}
//commodityService.saveCommodityCodeEntity(receiveSpxxReqList);
// if(ObjectUtil.isNotEmpty(updateZnfmList)){
// orderItemInfoService.updateOrderItemId(updateZnfmList);
// }
}
}

@ -22,6 +22,9 @@ import com.dxhy.order.baseservice.module.thirdservice.redis.service.RedisService
import com.dxhy.order.baseservice.module.thirdservice.simsback.service.SimsBackService;
import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService;
import com.dxhy.order.constant.*;
import com.dxhy.order.consumer.model.page.PageCommonOrderInfo;
import com.dxhy.order.consumer.model.page.PageOrderInfo;
import com.dxhy.order.consumer.model.page.PageOrderItemInfo;
import com.dxhy.order.consumer.modules.manager.service.InvoiceService;
import com.dxhy.order.consumer.modules.order.model.PageInvoiceItem;
import com.dxhy.order.consumer.modules.order.model.PageInvoiceReq;
@ -46,11 +49,14 @@ import com.dxhy.order.utils.JsonUtils;
import com.dxhy.order.utils.NsrsbhUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -132,6 +138,9 @@ public class InvoiceServiceImpl implements InvoiceService {
@Resource
private TaxClassCodeMapper taxClassCodeMapper;
@Resource
private OrderSplitService orderSplitService;
@Override
@Transactional
@ -139,41 +148,100 @@ public class InvoiceServiceImpl implements InvoiceService {
List<PageInvoiceItem> pageInvoiceItemList = pageInvoiceReq.getPageInvoiceItemList();
//查询数据列表
List<CommonOrderInfo> commonOrderInfos = orderInfoService.batchQueryOrderInfoByOrderIdsAndNsrsbh(pageInvoiceItemList);
log.info("commonOrderInfos---->batch query order info"+JSON.toJSONString(commonOrderInfos));
//存储成品油和非成品油不是混开的结算单
List<CommonOrderInfo> commonOrderInfoList=new ArrayList<CommonOrderInfo>();
//存储成品油和非成品油混开的结算单
List<PageCommonOrderInfo> mixCommonOrderInfoList=new ArrayList<>();
//购方是否为空、税编是否为空校验、成品油校验
for(CommonOrderInfo commonOrderInfo:commonOrderInfos){
if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!");
}
String cpy = "";
String kcp = baseServiceConfig.getKcp();
boolean kcpMark = kcp.contains(commonOrderInfo.getOrderItemInfo().get(0).getSpbm());
List<OrderItemInfo> cpyOrderItems = new ArrayList<OrderItemInfo>();
List<OrderItemInfo> nocpyOrderItems = new ArrayList<OrderItemInfo>();
for(OrderItemInfo orderItemInfo: commonOrderInfo.getOrderItemInfo()){
if(StrUtil.isBlank(orderItemInfo.getSpbm())){
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"第"+orderItemInfo.getSphxh()+"行商品税编为空,请补全!");
}else {
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeMapper.selectTaxClassCodeBySpbm(orderItemInfo.getSpbm());
if(StrUtil.isNotBlank(cpy)){
if(!cpy.equals(taxClassCodeEntity.getCpy())){
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"成品油和非成品油税编不能混开,请做手动拆分处理!");
}
if(ConfigureConstant.STRING_Y.equals(taxClassCodeEntity.getCpy())){
//成品油明细
cpyOrderItems.add(orderItemInfo);
}else {
cpy = taxClassCodeEntity.getCpy();
//非成品油明细
nocpyOrderItems.add(orderItemInfo);
}
if(kcp.contains(orderItemInfo.getSpbm()) != kcpMark){
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"矿产品与非矿产品税编不能混开,请做手动拆分处理!");
}
}
}
if(ConfigureConstant.STRING_Y.equals(cpy) && commonOrderInfo.getOrderItemInfo().size()>ConfigureConstant.INT_8){
if(CollectionUtils.isEmpty(cpyOrderItems)||CollectionUtils.isEmpty(nocpyOrderItems)){
commonOrderInfo.setOrderItemInfo(CollectionUtils.isEmpty(cpyOrderItems)?nocpyOrderItems:nocpyOrderItems);
commonOrderInfoList.add(commonOrderInfo);
}else {
//封装成品油
PageCommonOrderInfo cpyPageCommonOrderInfo = new PageCommonOrderInfo();
//拼接自动按照明细行拆分所需要的数据
log.info("cpyOrderItems》》》》》》》》"+JSON.toJSONString(cpyOrderItems));
log.info("nocpyOrderItems》》》》》》》》"+JSON.toJSONString(nocpyOrderItems));
//成品油和非成品油混合
PageOrderInfo cpyPageOrderInfo = new PageOrderInfo();
BeanUtils.copyProperties(commonOrderInfo.getOrderInfo(),cpyPageOrderInfo);
cpyPageOrderInfo.setKphjje(cpyOrderItems.stream().map(m->new BigDecimal(m.getSe()).add(new BigDecimal(m.getXmje()))).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
List<PageOrderItemInfo> cpyOrderItemInfo = new ArrayList<PageOrderItemInfo>();
for (OrderItemInfo cpyOrderItem : cpyOrderItems) {
PageOrderItemInfo pageOrderItemInfo = new PageOrderItemInfo();
BeanUtils.copyProperties(cpyOrderItem,pageOrderItemInfo);
cpyOrderItemInfo.add(pageOrderItemInfo);
}
cpyPageCommonOrderInfo.setOrderInfo(cpyPageOrderInfo);
cpyPageCommonOrderInfo.setOrderItemInfo(cpyOrderItemInfo);
mixCommonOrderInfoList.add(cpyPageCommonOrderInfo);
//封装非成品油
PageCommonOrderInfo nocpyPageCommonOrderInfo = new PageCommonOrderInfo();
//成品油和非成品油混合
PageOrderInfo nocpyPageOrderInfo = new PageOrderInfo();
BeanUtils.copyProperties(commonOrderInfo.getOrderInfo(),nocpyPageOrderInfo);
nocpyPageOrderInfo.setKphjje(nocpyOrderItems.stream().map(m->new BigDecimal(m.getSe()).add(new BigDecimal(m.getXmje()))).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
List<PageOrderItemInfo> nocpyOrderItemInfo = new ArrayList<PageOrderItemInfo>();
for (OrderItemInfo nocpyOrderItem : nocpyOrderItems) {
PageOrderItemInfo pageOrderItemInfo = new PageOrderItemInfo();
BeanUtils.copyProperties(nocpyOrderItem,pageOrderItemInfo);
nocpyOrderItemInfo.add(pageOrderItemInfo);
}
nocpyPageCommonOrderInfo.setOrderInfo(nocpyPageOrderInfo);
nocpyPageCommonOrderInfo.setOrderItemInfo(nocpyOrderItemInfo);
mixCommonOrderInfoList.add(nocpyPageCommonOrderInfo);
}
if(cpyOrderItems.size()>ConfigureConstant.INT_8){
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"是成品油发票,明细行数不能超过8行,请先进行手动拆分!");
}
}
//如果是混开的 走明细拆分
if(!CollectionUtils.isEmpty(mixCommonOrderInfoList)){
log.info("mixCommonOrderInfoList="+JSON.toJSONString(mixCommonOrderInfoList));
try {
orderSplitService.saveOrderSplitOrder(mixCommonOrderInfoList);
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
//如果不是混开的 走原来的逻辑
if(CollectionUtils.isEmpty(commonOrderInfoList)){
return R.ok("生成预制发票成功,请到【发票处理中心】页面查看");
}
//客户冻结状态校验、确认智能赋码、单价误差校验
List<Map<String,String>> consumerList = new ArrayList<>();
List<Map<String,String>> confirmList = new ArrayList<>();
List<Map<String,String>> djOverflowList = new ArrayList<>();
for (CommonOrderInfo commonOrderInfo : commonOrderInfos) {
for (CommonOrderInfo commonOrderInfo : commonOrderInfoList) {
OrderInfo orderInfo = commonOrderInfo.getOrderInfo();
List<OrderItemInfo> orderItemInfoList = commonOrderInfo.getOrderItemInfo();
BuyerEntity buyerEntity = null;
@ -203,6 +271,7 @@ public class InvoiceServiceImpl implements InvoiceService {
confirmList.add(map);
}
});
// 订单超限额拆分
String terminalCode = simsBackService.getTerminalCode(commonOrderInfo.getOrderInfo().getXhfNsrsbh(), commonOrderInfo.getOrderInfo().getEntId());
List<CommonOrderInfo> originalCommonOrderInfo = new ArrayList<>();
@ -240,19 +309,23 @@ public class InvoiceServiceImpl implements InvoiceService {
}
} else {
log.error("{}校验单价容差范围发生错误:在原结算单中未匹配到唯一明细,找到了{}条", LOGGER_MSG, collect.size());
R.error("校验单价容差范围发生错误:在原结算单中未匹配到唯一明细");
// R.error("校验单价容差范围发生错误:在原结算单中未匹配到唯一明细");
throw new RuntimeException("校验单价容差范围发生错误:在原结算单中未匹配到唯一明细");
}
});
});
}
if(consumerList.size()>0){
return R.error(ConfigureConstant.STRING_9001, "以下结算单中客户的状态为“冻结”状态,不能进行开票。",consumerList);
// return R.error(ConfigureConstant.STRING_9001, "以下结算单中客户的状态为“冻结”状态,不能进行开票。",consumerList);
throw new RuntimeException(String.format("以下结算单中%s客户的状态为“冻结”状态,不能进行开票。",consumerList));
}else if((StrUtil.isBlank(pageInvoiceReq.getConfirmZnfm()) || !ConfigureConstant.STRING_0.equals(pageInvoiceReq.getConfirmZnfm())) && confirmList.size()>0){
return R.error(ConfigureConstant.STRING_9002,"请确认以下物料税收分类编码是否准确",confirmList);
// return R.error(ConfigureConstant.STRING_9002,"请确认以下物料税收分类编码是否准确",confirmList);
throw new RuntimeException(String.format("请将以下物料同步至公司库,再进行生成预制",confirmList));
}else if(djOverflowList.size() > 0){
return R.error(ConfigureConstant.STRING_9003, "以下订单自动拆分时单价超过设定范围,请手动拆分",djOverflowList);
// return R.error(ConfigureConstant.STRING_9003, "以下订单自动拆分时单价超过设定范围,请手动拆分",djOverflowList);
throw new RuntimeException(String.format("以下订单自动拆分时单价超过设定范围,请手动拆分",djOverflowList));
}else {
for (CommonOrderInfo f : commonOrderInfos) {
for (CommonOrderInfo f : commonOrderInfoList) {
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeMapper.selectTaxClassCodeBySpbm(f.getOrderItemInfo().get(0).getSpbm());
if(ObjectUtil.isNotNull(taxClassCodeEntity) && ConfigureConstant.STRING_Y.equals(taxClassCodeEntity.getCpy())){
f.getOrderInfo().setQdBz(OrderInfoEnum.QDBZ_CODE_4.getKey());
@ -286,10 +359,7 @@ public class InvoiceServiceImpl implements InvoiceService {
OrderProcessInfo processInfo = orderProcessService.selectOrderProcessInfoByProcessId(s.getOrderInfo().getProcessId(),null);
processInfo.setYzfp(ConfigureConstant.STRING_1);
orderProcessService.updateOrderProcessInfoByProcessId(processInfo, null);
//
});
} else {
continue;
}
}
return R.ok("生成预制发票成功,请到【发票处理中心】页面查看");

@ -5,12 +5,11 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
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.baseservice.module.commodity.model.CommodityCodeEntity;
import com.dxhy.order.constant.*;
import com.dxhy.order.consumer.modules.order.model.dto.RewriteBzdhDTO;
import com.dxhy.order.consumer.modules.order.model.vo.OrderInfoTotalAmountVO;
import com.dxhy.order.consumer.modules.order.model.vo.OrderInfoVo;
import com.dxhy.order.consumer.modules.order.service.OrderBzdhService;
import com.dxhy.order.exception.OrderReceiveException;
import com.dxhy.order.model.*;
@ -155,7 +154,7 @@ public class OrderInfoController {
// 统计金额税额
OrderInfoTotalAmountVO totalAmountVO = orderInfoService.selectOrderSum(paramMap, null, entList);
return R.ok().put(OrderManagementConstant.DATA, page).put("total", totalAmountVO);
} catch (Exception e) {
log.error("{}列表查询异常:{}", LOGGER_MSG, e);
@ -468,7 +467,7 @@ public class OrderInfoController {
@PostMapping("/updateOrderItem")
@SysLog(operation = "订单更新物料", operationDesc = "订单更新物料", key = "订单更新物料")
public R updateOrderItem(@RequestBody String param){
log.info("订单更新物料",param);
log.info("订单更新物料{}",param);
JSONObject jsonObject = JSONObject.parseObject(param);
String entId = jsonObject.getString("entId");
String orderInfoId = jsonObject.getString("orderInfoId");
@ -486,11 +485,25 @@ public class OrderInfoController {
}
@ApiOperation(value = "同步物料至公司库", notes = "订单信息管理-同步物料")
@PostMapping("/sycnCommodity")
@SysLog(operation = "同步物料至公司库", operationDesc = "同步物料至公司库", key = "同步物料至公司库")
public R sycnCommodity(@RequestBody OrderInfoVo param){
log.info("同步物料至公司库请参:{}",JSONObject.toJSONString(param));
try {
return orderInfoService.sycnCommodity(param);
} catch (Exception e) {
log.error("同步公司物料库失败,失败原因:{}",e.getMessage());
return R.error("系统异常,请联系管理员");
}
}
@ApiOperation(value = "订单明细合并", notes = "订单信息管理-订单明细合并")
@PostMapping("/megerOrderItem")
@SysLog(operation = "订单明细合并", operationDesc = "订单明细合并", key = "订单明细合并")
public R megerOrderItem(@RequestBody String param){
log.info("订单明细合并",param);
log.info("订单明细合并{}",param);
JSONObject jsonObject = JSONObject.parseObject(param);
String entId = jsonObject.getString("entId");
String orderInfoId = jsonObject.getString("orderInfoId");
@ -511,7 +524,7 @@ public class OrderInfoController {
@PostMapping("/batchMegerOrderItem")
@SysLog(operation = "批量订单明细合并", operationDesc = "订单明细合并", key = "批量订单明细合并")
public R batchMegerOrderItem(@RequestBody String param){
log.info("批量订单明细合并",param);
log.info("批量订单明细合并{}",param);
List<JSONObject> jsonObjects = JSONObject.parseArray(param).toJavaList(JSONObject.class);
try {

@ -148,6 +148,7 @@ public class OrderInvoiceController {
@PostMapping("/preInvoice")
public R preInvoice(@RequestBody PageInvoiceReq pageInvoiceReq) {
try {
pageInvoiceReq.setConfirmZnfm("1");
return invoiceService.preInvoice(pageInvoiceReq);
} catch (Exception e) {
log.error("{}生成预制发票异常e:{}", LOGGER_MSG, e);

@ -0,0 +1,22 @@
package com.dxhy.order.consumer.modules.order.model.vo;
import com.dxhy.order.model.OrderItemInfo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.List;
@Data
public class OrderInfoVo {
@NotBlank
private String entId;
private String xhfNsrsbh;
private String xhfMc;
private String commodityId;
private List<OrderItemInfo> orderItemInfo;
}

@ -1,8 +1,8 @@
package com.dxhy.order.consumer.modules.order.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dxhy.order.consumer.model.page.PageRequestVO;
import com.dxhy.order.consumer.modules.order.model.vo.OrderInfoVo;
import com.dxhy.order.consumer.modules.order.model.vo.OrderInfoTotalAmountVO;
import com.dxhy.order.exception.OrderReceiveException;
import com.dxhy.order.model.*;
@ -13,7 +13,6 @@ import com.dxhy.order.consumer.modules.order.model.PageKySlReq;
import com.dxhy.order.consumer.modules.order.model.PageKySlRsp;
import com.dxhy.order.consumer.modules.order.model.bo.YwlxCountTotalBO;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;
import java.util.List;
@ -230,6 +229,10 @@ public interface OrderInfoService {
R updateOrderItem(String orderInfoId,String entId,List<String> itemList);
/**同步订单信息至公司物料库*/
@Transactional
R sycnCommodity(OrderInfoVo param);
@Transactional
R mergeOrderItem(String entId,String orderInfoId,List<String> itemList) throws Exception;

@ -10,18 +10,19 @@ import com.dxhy.base.constant.TaxSeparateConfig;
import com.dxhy.base.utils.PriceTaxSeparationUtilNew;
import com.dxhy.common.generatepdf.util.EwmUtil;
import com.dxhy.order.baseservice.config.BaseServiceConfig;
import com.dxhy.order.baseservice.module.base.service.BaseService;
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.dao.CommodityMapper;
import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity;
import com.dxhy.order.baseservice.module.groupmanagement.dao.GroupManagementMapper;
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;
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.baseservice.utils.BaseServiceBeanTransitionUtils;
import com.dxhy.order.constant.*;
import com.dxhy.order.consumer.dao.GroupCommodityCodeMapper;
import com.dxhy.order.consumer.dao.GsClientMapper;
import com.dxhy.order.consumer.dao.OrderBatchRequestMapper;
@ -33,6 +34,7 @@ import com.dxhy.order.consumer.modules.order.model.PageInvoiceItem;
import com.dxhy.order.consumer.modules.order.model.PageKySlReq;
import com.dxhy.order.consumer.modules.order.model.PageKySlRsp;
import com.dxhy.order.consumer.modules.order.model.bo.YwlxCountTotalBO;
import com.dxhy.order.consumer.modules.order.model.vo.OrderInfoVo;
import com.dxhy.order.consumer.modules.order.model.vo.OrderInfoTotalAmountVO;
import com.dxhy.order.consumer.modules.order.service.*;
import com.dxhy.order.consumer.modules.validate.service.ValidateOrderInfoService;
@ -66,6 +68,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -165,15 +168,20 @@ public class OrderInfoServiceImpl implements OrderInfoService {
@Resource
private TaxClassCodeMapper taxClassCodeMapper;
@Resource
private OrderBatchRequestMapper orderBatchRequestMapper;
@Resource
private GroupManagementMapper groupManagementMapper;
@Resource
private GsClientMapper gsClientMapper;
@Resource
private BaseService baseService;
@Resource
private CommodityMapper commodityMapper;
DecimalFormat format = new DecimalFormat("#.###");
@Override
public PageUtils selectOrderInfo(Map<String, Object> map, List<String> shList, List<String> entList) {
return orderProcessService.selectOrderInfo(map, shList, entList);
@ -1846,8 +1854,8 @@ public class OrderInfoServiceImpl implements OrderInfoService {
if(collect1.size()==orderItemInfos.size()){
Map map = new HashMap(2);
map.put("cpy","Y");
Integer integer = taxClassCodeMapper.countTaxClassCodeBySpbm(collect1, map);
if(orderItemInfos.size()==integer.intValue()){
List<TaxClassCodeEntity> taxClassCodeEntities = taxClassCodeMapper.selectTaxClassCodeList(collect1, map);
if(orderItemInfos.size()==taxClassCodeEntities.size()){
//更新order_info 清单标志为4
OrderInfo orderInfo = new OrderInfo();
orderInfo.setId(orderInfoId);
@ -1861,6 +1869,126 @@ public class OrderInfoServiceImpl implements OrderInfoService {
return R.ok();
}
@Override
public R sycnCommodity(OrderInfoVo param) {
//优先新增物料
//如果公司库存在,但是部分数据与公司库不一致
//如果当前明细行物料编码为空
//更新订单物料智能赋码标识
List<String> spbms = new ArrayList<>();
List<OrderItemInfo> orderItemInfo = param.getOrderItemInfo();
if(orderItemInfo == null && orderItemInfo.isEmpty() ){
return R.error("同步公司库必须勾选同步的明细");
}
List<String> ending = orderItemInfo.stream().filter(t->StringUtils.isNotBlank(t.getSpbm())).map(t -> {
spbms.add(t.getSpbm());
return t.getZxbm();
}).collect(Collectors.toList());
Map map = new HashMap(2);
map.put("hzx","N");
List<String> spbm = spbms.stream().distinct().collect(Collectors.toList());
ending = ending.stream().distinct().collect(Collectors.toList());
List<TaxClassCodeEntity> taxClassCodeEntities = taxClassCodeMapper.selectTaxClassCodeList(spbm, map);
Map<String, TaxClassCodeEntity> spbmMap = taxClassCodeEntities.stream().collect(Collectors.toMap(t -> t.getSpbm(), t -> t));
List<CommodityCodeEntity> commodityCodeEntities = null;
if(ending.size() > 0){
commodityCodeEntities = commodityMapper.queryCommodityByencodings(ending, Arrays.asList(param.getEntId()), Arrays.asList(param.getXhfNsrsbh()));
}
Map<String, CommodityCodeEntity> collect = null;
if(commodityCodeEntities != null && commodityCodeEntities.size() > 0){
collect = commodityCodeEntities.stream().collect(Collectors.toMap(t -> t.getZxbm(), t -> t));
}
List<OrderItemInfo> items = new ArrayList<>();
StringBuffer sb = new StringBuffer();
for (OrderItemInfo itemInfo : orderItemInfo) {
try {
CommodityCodeEntity commodityCodeEntity = buildCommodity(itemInfo, param, spbmMap);
//判断是否已存在
int i = 0;
//公司不维护
CommodityCodeEntity commodityCodeOld = collect.get(itemInfo.getZxbm());
if(collect == null || commodityCodeOld == null){
commodityCodeEntity.setId(baseService.getGenerateShotKey());
commodityCodeEntity.setCreateTime(new Date());
commodityCodeEntity.setUserId(userInfoService.getUser().getUserId() != null ? userInfoService.getUser().getUserId().toString():"sync");
i = commodityMapper.insertCommodity(commodityCodeEntity);
}
//公司库已维护的不更新
if(commodityCodeOld != null){
//判断税编、规格型号、单位
commodityCodeEntity.setId(commodityCodeOld.getId());
commodityCodeEntity.setModifyTime(new Date());
commodityCodeEntity.setModifyUserId(userInfoService.getUser().getUserId() != null ? userInfoService.getUser().getUserId().toString():"sync");
i = commodityMapper.updateCommodity(commodityCodeEntity,Arrays.asList(param.getXhfNsrsbh()));
}
if(i > 0){
OrderItemInfo item = new OrderItemInfo();
item.setId(itemInfo.getId());
item.setZnfm(ConfigureConstant.STRING_0);
items.add(item);
}
} catch (Exception e) {
sb.append(itemInfo.getSphxh()).append(",");
}
}
if(items.size() > 0){
orderItemInfoMapper.updateOrderItemId(items);
}
if(sb.length() == 0){
return R.ok();
}
String substring = sb.substring(0, sb.length() - 1) + "税编有误请检查";
return R.error(substring);
}
private CommodityCodeEntity buildCommodity(OrderItemInfo itemInfo,OrderInfoVo orderInfoVo,Map<String, TaxClassCodeEntity> spbm ) throws Exception{
CommodityCodeEntity comm = new CommodityCodeEntity();
comm.setCommodityId(comm.getId());
comm.setSortId(0L);
comm.setXhfNsrsbh(orderInfoVo.getXhfNsrsbh());
TaxClassCodeEntity taxClassCodeEntity = spbm.get(itemInfo.getSpbm());
if(taxClassCodeEntity == null){
throw new Exception("商品税编有误");
}
String spjc = taxClassCodeEntity.getSpjc();
String xmmc = itemInfo.getXmmc().replace("*" + spjc + "*", "");
comm.setXmmc(xmmc);
comm.setZxbm(StringUtils.isNotBlank(itemInfo.getZxbm())?itemInfo.getZxbm():comm.getId());
comm.setSpsm(taxClassCodeEntity.getSm());
comm.setSpjm("");
String sl = itemInfo.getSl().replace("%", "");
comm.setSl(format.format(new BigDecimal("1.3").divide(new BigDecimal("100"), 3, RoundingMode.HALF_UP)));//不需要转换%
comm.setGgxh(StringUtils.isNotBlank(itemInfo.getGgxh())?BaseServiceBeanTransitionUtils.ggxhTransition(itemInfo.getGgxh()):"");//切除40
comm.setXmdw(itemInfo.getXmdw());
comm.setXmdj(StringUtils.isNotBlank(itemInfo.getXmdj())?itemInfo.getXmdj():"");
comm.setHsbz(itemInfo.getHsbz());
comm.setYcbz(ConfigureConstant.STRING_0);
comm.setYhzcbs(itemInfo.getYhzcbs());
comm.setSpbm(itemInfo.getSpbm());
comm.setSsflMc(spjc);
comm.setLslbs(itemInfo.getLslbs());
comm.setZzstsgl(itemInfo.getZzstsgl());
//如果税编和简称对不上返回报错
comm.setXhfMc(orderInfoVo.getXhfMc());
comm.setDataSource(TaxClassCodeEnum.DATA_SOURCE_8.getKey());
comm.setMatchingState(TaxClassCodeEnum.MATCHING_STATE_0.getKey());
comm.setDataState(TaxClassCodeEnum.DATA_STATE_0.getKey());
comm.setSpjc(spjc);
comm.setCollectIdent("0");
comm.setCpy(taxClassCodeEntity.getCpy());
comm.setJdc(taxClassCodeEntity.getJdc());
comm.setEntId(orderInfoVo.getEntId());
comm.setTswl(StringUtils.isBlank(itemInfo.getTswl())?ConfigureConstant.STRING_0:"");
return comm;
}
@Override
public R mergeOrderItem(String entId, String orderInfoId,List<String> itemList) throws Exception{

@ -267,6 +267,8 @@ public class OrderSplitServiceImpl implements OrderSplitService {
OrderItemInfo orderItemInfo = new OrderItemInfo();
BeanUtils.copyProperties(pageOrderItemInfo, orderItemInfo);
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeMapper.selectTaxClassCodeBySpbm(orderItemInfo.getSpbm());
log.info("OrderItemInfo.getSpbm() = " + orderItemInfo.getSpbm());
log.info("taxClassCodeEntity = " + taxClassCodeEntity);
if(taxClassCodeEntity != null && "Y".contains(taxClassCodeEntity.getCpy())){
cpy++;
}

@ -1869,10 +1869,15 @@ public class SpecialInvoiceServiceImpl implements SpecialInvoiceService {
}
//如果同步下来的结果与已有的结果不一致的话 更新最新的审核结果
if (!responseHzfpsqbsc.getStatus_CODE().equals(specialInvoiceReversal.getStatusCode())) {
if (!responseHzfpsqbsc.getXXBZT().equals(specialInvoiceReversal.getStatusCode())||!responseHzfpsqbsc.getStatus_CODE().equals(specialInvoiceReversal.getStatusCode())) {
updateSpecialEntity.setXxbbh(responseHzfpsqbsc.getXxbbh());
updateSpecialEntity.setStatusCode(responseHzfpsqbsc.getStatus_CODE());
updateSpecialEntity.setStatusMessage(responseHzfpsqbsc.getStatus_MESSAGE());
if(StringUtils.isNotBlank(responseHzfpsqbsc.getStatus_CODE())){
updateSpecialEntity.setStatusCode(responseHzfpsqbsc.getStatus_CODE());
updateSpecialEntity.setStatusMessage(responseHzfpsqbsc.getStatus_MESSAGE());
}else{
updateSpecialEntity.setStatusCode(responseHzfpsqbsc.getXXBZT());
updateSpecialEntity.setStatusMessage(responseHzfpsqbsc.getZTMX());
}
updateSpecialEntity.setEditorId(operatorId);
updateSpecialEntity.setEditorName(operatorName);
updateSpecialEntity.setId(specialInvoiceReversal.getId());

Loading…
Cancel
Save