|
@@ -5,6 +5,8 @@ import com.steerinfo.ems.Utils.MarketSlmException;
|
|
|
import com.steerinfo.ems.emsgmpcjh.mapper.EmsGmPcJhMapper;
|
|
|
import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
|
|
|
import com.steerinfo.ems.emsgmpcjh.service.IEmsGmPcJhService;
|
|
|
+import com.steerinfo.ems.emsprodplanweightadjustment.mapper.EmsProdplanWeightAdjustmentMapper;
|
|
|
+import com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment;
|
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
|
import com.steerinfo.framework.mapper.IBaseMapper;
|
|
|
import com.steerinfo.framework.service.impl.BaseServiceImpl;
|
|
@@ -41,6 +43,8 @@ public class EmsGmPcJhServiceImpl extends BaseServiceImpl<EmsGmPcJh, String> imp
|
|
|
@Autowired
|
|
|
private EmsGmPcJhMapper emsGmPcJhMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private EmsProdplanWeightAdjustmentMapper emsProdplanWeightAdjustmentMapper;
|
|
|
@Override
|
|
|
protected IBaseMapper<EmsGmPcJh, String> getMapper() {
|
|
|
return emsGmPcJhMapper;
|
|
@@ -81,8 +85,8 @@ public class EmsGmPcJhServiceImpl extends BaseServiceImpl<EmsGmPcJh, String> imp
|
|
|
|
|
|
@Override
|
|
|
public RESTfulResult insertexcel(File file) throws Exception {
|
|
|
- RESTfulResult rs = new RESTfulResult("200", "成功");
|
|
|
- rs.setCode("0");
|
|
|
+ RESTfulResult rs = new RESTfulResult("200", "数据导入成功,不规范数据已自动剔除");
|
|
|
+ rs.setCode("200");
|
|
|
List<EmsGmPcJh> lsp = null;
|
|
|
try {
|
|
|
lsp = createCheckCar(file);
|
|
@@ -91,6 +95,15 @@ public class EmsGmPcJhServiceImpl extends BaseServiceImpl<EmsGmPcJh, String> imp
|
|
|
int spm = emsGmPcJhMapper.batchInsert(lsp);
|
|
|
if (spm > 0) {
|
|
|
rs.setData(spm);
|
|
|
+ EmsProdplanWeightAdjustment emsProdplanWeightAdjustment ;
|
|
|
+ for (EmsGmPcJh emsGmPcJh : lsp) {
|
|
|
+ emsProdplanWeightAdjustment = new EmsProdplanWeightAdjustment();
|
|
|
+ emsProdplanWeightAdjustment.setId(emsGmPcJh.getId());
|
|
|
+ emsProdplanWeightAdjustment.setAuditStatus("0");
|
|
|
+ emsProdplanWeightAdjustment.setPlanWeight(emsGmPcJh.getPlanWeight());
|
|
|
+ emsProdplanWeightAdjustment.setPlanWeightOld(emsGmPcJh.getPlanWeight());
|
|
|
+ emsProdplanWeightAdjustmentMapper.insert(emsProdplanWeightAdjustment);
|
|
|
+ }
|
|
|
} else {
|
|
|
rs.setMessage("导入失败");
|
|
|
rs.setCode("500");
|
|
@@ -159,12 +172,7 @@ public class EmsGmPcJhServiceImpl extends BaseServiceImpl<EmsGmPcJh, String> imp
|
|
|
spp.setStartTime(arr[0]);
|
|
|
switch (name) {
|
|
|
case "型钢" :
|
|
|
- if(arr[1].contains("一")){
|
|
|
- spp.setType("G-X1-");
|
|
|
- spp.setWorkprocType("AT2007");
|
|
|
- } else {
|
|
|
spp.setType("G-X2-");
|
|
|
- }
|
|
|
break;
|
|
|
case "钢坯" :
|
|
|
spp.setType("G-L1-");
|
|
@@ -192,7 +200,11 @@ public class EmsGmPcJhServiceImpl extends BaseServiceImpl<EmsGmPcJh, String> imp
|
|
|
for(int j =1;j<arr1.length;j++) {
|
|
|
switch (arr1[j].trim()) {
|
|
|
case "规格" :
|
|
|
- spp.setSpecifications(arr[j].replace("*", "x"));
|
|
|
+ if (name.equals("型钢")) {
|
|
|
+ spp.setLengthTimesWidth(arr[j]);
|
|
|
+ } else {
|
|
|
+ spp.setSpecifications(arr[j]);
|
|
|
+ }
|
|
|
break;
|
|
|
case "钢种" :
|
|
|
spp.setGrades(arr[j]);
|