Commit 4b59703b authored by 季圣华's avatar 季圣华
Browse files

给供应商导入增加判断

parent c8f996dd
...@@ -375,7 +375,16 @@ public class SupplierService { ...@@ -375,7 +375,16 @@ public class SupplierService {
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
try { try {
for(Supplier s: mList) { for(Supplier s: mList) {
supplierMapper.insertSelective(s); SupplierExample example = new SupplierExample();
example.createCriteria().andSupplierEqualTo(s.getSupplier()).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Supplier> list= supplierMapper.selectByExample(example);
if(list.size() <= 0) {
supplierMapper.insertSelective(s);
} else {
Long id = list.get(0).getId();
s.setId(id);
supplierMapper.updateByPrimaryKeySelective(s);
}
} }
info.code = 200; info.code = 200;
data.put("message", "成功"); data.put("message", "成功");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment