@@ -84,14 +84,18 @@ public class DepotHeadService {
|
||||
}
|
||||
depotHead.setCreatetime(new Timestamp(System.currentTimeMillis()));
|
||||
depotHead.setStatus(false);
|
||||
return depotHeadMapper.insertSelective(depotHead);
|
||||
return depotHeadMapper.insert(depotHead);
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int updateDepotHead(String beanJson, Long id) {
|
||||
DepotHead dh = depotHeadMapper.selectByPrimaryKey(id);
|
||||
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
||||
depotHead.setId(id);
|
||||
return depotHeadMapper.updateByPrimaryKeySelective(depotHead);
|
||||
depotHead.setStatus(dh.getStatus());
|
||||
depotHead.setCreatetime(dh.getCreatetime());
|
||||
depotHead.setOperpersonname(dh.getOperpersonname());
|
||||
return depotHeadMapper.updateByPrimaryKey(depotHead);
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.jsh.erp.datasource.entities.Material;
|
||||
import com.jsh.erp.datasource.entities.MaterialExample;
|
||||
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
||||
import com.jsh.erp.datasource.mappers.MaterialMapper;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -14,7 +15,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class MaterialService {
|
||||
@@ -160,4 +163,32 @@ public class MaterialService {
|
||||
return materialMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public List<MaterialVo4Unit> findByAll(String name, String model, Long categoryId, String categoryIds) {
|
||||
List<MaterialVo4Unit> resList = new ArrayList<MaterialVo4Unit>();
|
||||
List<MaterialVo4Unit> list = materialMapper.findByAll(name, model, categoryId, categoryIds);
|
||||
if (null != list) {
|
||||
for (MaterialVo4Unit m : list) {
|
||||
resList.add(m);
|
||||
}
|
||||
}
|
||||
return resList;
|
||||
}
|
||||
|
||||
public BaseResponseInfo importExcel(List<Material> mList) throws Exception {
|
||||
BaseResponseInfo info = new BaseResponseInfo();
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
try {
|
||||
for(Material m: mList) {
|
||||
materialMapper.insertSelective(m);
|
||||
}
|
||||
info.code = 200;
|
||||
data.put("message", "成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
info.code = 500;
|
||||
data.put("message", e.getMessage());
|
||||
}
|
||||
info.data = data;
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.datasource.entities.Supplier;
|
||||
import com.jsh.erp.datasource.entities.SupplierExample;
|
||||
import com.jsh.erp.datasource.mappers.SupplierMapper;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -12,7 +13,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class SupplierService {
|
||||
@@ -123,4 +126,26 @@ public class SupplierService {
|
||||
List<Supplier> list = supplierMapper.selectByExample(example);
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Supplier> findByAll(String supplier, String type, String phonenum, String telephone, String description) {
|
||||
return supplierMapper.findByAll(supplier, type, phonenum, telephone, description);
|
||||
}
|
||||
|
||||
public BaseResponseInfo importExcel(List<Supplier> mList) throws Exception {
|
||||
BaseResponseInfo info = new BaseResponseInfo();
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
try {
|
||||
for(Supplier s: mList) {
|
||||
supplierMapper.insertSelective(s);
|
||||
}
|
||||
info.code = 200;
|
||||
data.put("message", "成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
info.code = 500;
|
||||
data.put("message", e.getMessage());
|
||||
}
|
||||
info.data = data;
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user