解决bug:商品模块中,单价金额无法单个清空的问题

This commit is contained in:
季圣华
2023-04-22 10:42:04 +08:00
parent be1583d6c2
commit ce61f62bf3
3 changed files with 18 additions and 4 deletions

View File

@@ -22,4 +22,6 @@ public interface MaterialExtendMapperEx {
List<MaterialExtend> getListByMId(@Param("ids") Long ids[]); List<MaterialExtend> getListByMId(@Param("ids") Long ids[]);
int batchDeleteMaterialExtendByMIds(@Param("ids") String ids[]); int batchDeleteMaterialExtendByMIds(@Param("ids") String ids[]);
int specialUpdatePrice(MaterialExtend record);
} }

View File

@@ -183,6 +183,8 @@ public class MaterialExtendService {
materialExtend.setLowDecimal(tempUpdatedJson.getBigDecimal("lowDecimal")); materialExtend.setLowDecimal(tempUpdatedJson.getBigDecimal("lowDecimal"));
} }
this.updateMaterialExtend(materialExtend); this.updateMaterialExtend(materialExtend);
//如果金额为空,此处单独置空
materialExtendMapperEx.specialUpdatePrice(materialExtend);
} }
} }
//处理条码的排序,基本单位排第一个 //处理条码的排序,基本单位排第一个
@@ -238,13 +240,13 @@ public class MaterialExtendService {
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateMaterialExtend(MaterialExtend MaterialExtend) throws Exception{ public int updateMaterialExtend(MaterialExtend materialExtend) throws Exception{
User user = userService.getCurrentUser(); User user = userService.getCurrentUser();
MaterialExtend.setUpdateTime(System.currentTimeMillis()); materialExtend.setUpdateTime(System.currentTimeMillis());
MaterialExtend.setUpdateSerial(user.getLoginName()); materialExtend.setUpdateSerial(user.getLoginName());
int res =0; int res =0;
try{ try{
res= materialExtendMapper.updateByPrimaryKeySelective(MaterialExtend); res= materialExtendMapper.updateByPrimaryKeySelective(materialExtend);
}catch(Exception e){ }catch(Exception e){
JshException.writeFail(logger, e); JshException.writeFail(logger, e);
} }

View File

@@ -65,4 +65,14 @@
</foreach> </foreach>
) )
</update> </update>
<update id="specialUpdatePrice" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
update jsh_material_extend
set purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL},
commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL},
wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL},
low_decimal = #{lowDecimal,jdbcType=DECIMAL}
where id = #{id,jdbcType=BIGINT}
and ifnull(delete_flag,'0') !='1'
</update>
</mapper> </mapper>