优化商品模块

This commit is contained in:
季圣华
2020-12-11 00:57:37 +08:00
parent c5ac7f09ac
commit bf032afecb
4 changed files with 35 additions and 7 deletions

View File

@@ -74,4 +74,6 @@ public interface MaterialMapperEx {
@Param("meId") Long meId);
List<String> getMaterialNameList();
int setUnitIdToNull(@Param("id") Long id);
}

View File

@@ -189,6 +189,9 @@ public class MaterialService {
material.setId(id);
try{
materialMapper.updateByPrimaryKeySelective(material);
if(material.getUnitId() == null) {
materialMapperEx.setUnitIdToNull(material.getId());
}
JSONObject mObj = JSON.parseObject(beanJson);
materialExtendService.saveDetials(mObj.getString("inserted"),mObj.getString("deleted"),mObj.getString("updated"),mObj.getString("sortList"),id);
if(mObj.get("stock")!=null) {