优化商品模块
This commit is contained in:
@@ -74,4 +74,6 @@ public interface MaterialMapperEx {
|
||||
@Param("meId") Long meId);
|
||||
|
||||
List<String> getMaterialNameList();
|
||||
|
||||
int setUnitIdToNull(@Param("id") Long id);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -253,4 +253,12 @@
|
||||
group by m.name
|
||||
order by m.name asc
|
||||
</select>
|
||||
|
||||
<update id="setUnitIdToNull">
|
||||
update jsh_material
|
||||
set unit_id = null
|
||||
where 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
and id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user