解决序列号商品选择的bug

This commit is contained in:
季圣华
2020-07-30 23:46:00 +08:00
parent ac566306af
commit ed32ab5467
5 changed files with 12 additions and 9 deletions

View File

@@ -34,7 +34,7 @@ public interface MaterialCategoryMapperEx {
int editMaterialCategory(MaterialCategory mc);
List<MaterialCategory> getMaterialCategoryBySerialNo(@Param("serialNo") String serialNo);
List<MaterialCategory> getMaterialCategoryBySerialNo(@Param("serialNo") String serialNo, @Param("id") Long id);
List<MaterialCategory> getMaterialCategoryListByCategoryIds(@Param("parentIds") String[] categoryIds);
}

View File

@@ -45,17 +45,17 @@ public interface SerialNumberMapperEx {
/**
* 查询符合条件的序列号数量
* */
int countSerialNumberByMaterialIdAndDepotheadId(@Param("materialId")Long materialId, @Param("depotheadId")Long depotheadId, @Param("isSell")String isSell);
int countSerialNumberByMaterialIdAndDepotheadId(@Param("materialId")Long materialId, @Param("depotHeadId")Long depotHeadId, @Param("isSell")String isSell);
/**
* 卖出: update jsh_serial_number set is_Sell='1' ,depothead_Id='depotheadId' where 1=1 and material_Id='materialId'
* and is_Sell !='1' and delete_Flag !='1' {limit 0count}
* */
int sellSerialNumber(@Param("materialId")Long materialId, @Param("depotheadId")Long depotheadId,@Param("count")Integer count, @Param("updateTime") Date updateTime,@Param("updater") Long updater);
int sellSerialNumber(@Param("materialId")Long materialId, @Param("depotHeadId")Long depotHeadId,@Param("count")Integer count, @Param("updateTime") Date updateTime,@Param("updater") Long updater);
/**
* 赎回update jsh_serial_number set is_Sell='0' where 1=1 and material_Id='materialId'
* and depothead_Id='depotheadId' and is_Sell ='0' and delete_Flag !='1' {limit 0count}
* */
int cancelSerialNumber(@Param("materialId")Long materialId, @Param("depotheadId")Long depotheadId, @Param("count")Integer count, @Param("updateTime") Date updateTime,@Param("updater") Long updater);
int cancelSerialNumber(@Param("materialId")Long materialId, @Param("depotHeadId")Long depotHeadId, @Param("count")Integer count, @Param("updateTime") Date updateTime,@Param("updater") Long updater);
/**
* 批量添加序列号
* */

View File

@@ -320,7 +320,7 @@ public class MaterialCategoryService {
//根据商品类别编号查询商品类别
List<MaterialCategory> mList=null;
try{
mList= materialCategoryMapperEx.getMaterialCategoryBySerialNo(mc.getSerialNo());
mList= materialCategoryMapperEx.getMaterialCategoryBySerialNo(mc.getSerialNo(), mc.getId());
}catch(Exception e){
JshException.readFail(logger, e);
}

View File

@@ -428,10 +428,10 @@ public class SerialNumberService {
* @return com.jsh.erp.datasource.entities.SerialNumberEx
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int sellSerialNumber(Long materialId, Long depotheadId,int count,User user) throws Exception{
public int sellSerialNumber(Long materialId, Long depotHeadId,int count,User user) throws Exception{
int result=0;
try{
result = serialNumberMapperEx.sellSerialNumber(materialId,depotheadId,count,new Date(),user==null?null:user.getId());
result = serialNumberMapperEx.sellSerialNumber(materialId,depotHeadId,count,new Date(),user==null?null:user.getId());
}catch(Exception e){
JshException.writeFail(logger, e);
}
@@ -450,10 +450,10 @@ public class SerialNumberService {
* @return com.jsh.erp.datasource.entities.SerialNumberEx
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int cancelSerialNumber(Long materialId, Long depotheadId,int count,User user) throws Exception{
public int cancelSerialNumber(Long materialId, Long depotHeadId,int count,User user) throws Exception{
int result=0;
try{
result = serialNumberMapperEx.cancelSerialNumber(materialId,depotheadId,count,new Date(),user==null?null:user.getId());
result = serialNumberMapperEx.cancelSerialNumber(materialId,depotHeadId,count,new Date(),user==null?null:user.getId());
}catch(Exception e){
JshException.writeFail(logger, e);
}

View File

@@ -105,6 +105,9 @@
FROM jsh_material_category
where 1=1
and serial_no=#{serialNo}
<if test="id != null">
and id!=#{id}
</if>
and ifnull(status,'0') !='2'
</select>
<select id="getMaterialCategoryListByCategoryIds" resultMap="com.jsh.erp.datasource.mappers.MaterialCategoryMapper.BaseResultMap">