feature:发票开具成功后,存在则更新公司物料库,不存在则插入

release
gaorl 2 years ago
parent e69db84900
commit d7dacf428f
  1. 2
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/commodity/dao/CommodityMapper.java
  2. 17
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/commodity/service/impl/CommodityServiceImpl.java
  3. 55
      order-management-base-service/src/main/resources/mybatis/mapper/CommodityMapper.xml

@ -53,6 +53,8 @@ public interface CommodityMapper {
*/
int updateCommodity(@Param("commodityCode") CommodityCodeEntity codeEntity, @Param("shList") List<String> shList);
int updateCommodityByZxbm(@Param("commodityCode") CommodityCodeEntity codeEntity, @Param("map") Map<String,String> map);
int batchUpdateCommodity(@Param("commodityCode") CommodityCodeEntity codeEntity, @Param("ids") List<String> ids);
/**

@ -639,20 +639,27 @@ public class CommodityServiceImpl implements CommodityService {
log.debug("{}校验名称是否存在 参数:{}", LOGGER_MSG, map);
List<CommodityCodeEntity> commodityCodeEntityList = commodityMapper.queryProductList(map, null);
//R r = commodityService.checkRepeat(commodityCodeCheckQuery, NsrsbhUtils.transShListByNsrsbh(receiveSpxxReq.getXhfNsrsbh()), false);
if(commodityCodeEntityList.isEmpty()){
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeService.queryTaxClassCodeFromCache(receiveSpxxReq.getSpbm());
CommodityCodeEntity commodityCodeEntity = null;
if (ObjectUtil.isNotEmpty(taxClassCodeEntity)) {
commodityCodeEntity = transCommodityCode(receiveSpxxReq, taxClassCodeEntity);
}
if(commodityCodeEntityList.isEmpty()) {
//if (ConfigureConstant.STRING_0000.equals(r.get(OrderManagementConstant.CODE))) {
/**
* 从缓存中取税编信息
*
*/
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeService.queryTaxClassCodeFromCache(receiveSpxxReq.getSpbm());
if (ObjectUtil.isNotEmpty(taxClassCodeEntity)) {
CommodityCodeEntity commodityCodeEntity = transCommodityCode(receiveSpxxReq, taxClassCodeEntity);
if (commodityCodeEntity != null){
commodityMapper.insertCommodity(commodityCodeEntity);
log.debug("添加成功");
}
}else{
// TODO 简称、商品编码、规格型号、单位、优惠政策标识、零税率标识
if (commodityCodeEntity != null){
commodityMapper.updateCommodityByZxbm(commodityCodeEntity, map);
}
}
}
}

@ -384,6 +384,61 @@
</if>
</where>
</update>
<update id="updateCommodityByZxbm" parameterType="com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity">
<bind name="dataType" value="${dataType}"/>
update commodity_code
<set>
<if test="commodityCode.ggxh != null">
specification_model = #{commodityCode.ggxh,jdbcType=VARCHAR},
</if>
<if test="commodityCode.xmdw != null">
metering_unit = #{commodityCode.xmdw,jdbcType=VARCHAR},
</if>
<if test="commodityCode.ycbz != null">
hide_the_logo = #{commodityCode.ycbz,jdbcType=VARCHAR},
</if>
<if test="commodityCode.lslbs != null">
preferential_policies_type = #{commodityCode.lslbs,jdbcType=VARCHAR},
</if>
<if test="commodityCode.yhzcbs != null">
enjoy_preferential_policies = #{commodityCode.yhzcbs,jdbcType=VARCHAR},
</if>
<if test="commodityCode.spbm != null">
tax_class_code = #{commodityCode.spbm,jdbcType=VARCHAR},
</if>
<if test="commodityCode.spjc != null">
tax_class_abbreviation = #{commodityCode.spjc,jdbcType=VARCHAR},
</if>
<if test="commodityCode.zzstsgl != null">
zzstsgl = #{commodityCode.zzstsgl,jdbcType=VARCHAR},
</if>
<if test="dataType == 0">
modify_time = now(),
</if>
<if test="dataType == 1">
modify_time = SYSDATE,
</if>
<if test="commodityCode.modifyUserId != null">
modify_user_id = #{commodityCode.modifyUserId,jdbcType=CHAR},
</if>
<if test="commodityCode.collectIdent != null">
collect_ident = #{commodityCode.collectIdent,jdbcType=VARCHAR},
</if>
<if test="commodityCode.cpy != null">
cpy = #{commodityCode.cpy,jdbcType=VARCHAR},
</if>
</set>
<where>
<if test="map.zxbm != null">
and encoding = #{map.zxbm,jdbcType=VARCHAR},
</if>
<if test="map.entId != null">
and ent_id = #{map.entId,jdbcType=VARCHAR},
</if>
</where>
</update>
<update id="batchUpdateCommodity" parameterType="com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity">
<bind name="dataType" value="${dataType}"/>
update commodity_code

Loading…
Cancel
Save