|
@@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileInputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.math.BigDecimal;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -98,9 +99,19 @@ public class EmsProdplanYearServiceImpl extends BaseServiceImpl<EmsProdplanYear,
|
|
lsp = createCheckCar(file);
|
|
lsp = createCheckCar(file);
|
|
if (lsp.size()>0)
|
|
if (lsp.size()>0)
|
|
{
|
|
{
|
|
- int spm = emsProdplanYearMapper.batchInsert(lsp);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ Map map = new HashMap(16);
|
|
|
|
+ for (EmsProdplanYear model : lsp) {
|
|
|
|
+ map.put("line",model.getLine());
|
|
|
|
+ map.put("yearmonth",new SimpleDateFormat("yyyy-MM").format(model.getYearmonth()));
|
|
|
|
+ map.put("productid",model.getProductid());
|
|
|
|
+ List list = this.getDateForProduct((HashMap<String, Object>) map);
|
|
|
|
+ if (list.size()>0){
|
|
|
|
+ continue;
|
|
|
|
+ } else {
|
|
|
|
+ this.add(model);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else
|
|
{
|
|
{
|
|
rs.setMessage("导入失败,导入数据已经存在!");
|
|
rs.setMessage("导入失败,导入数据已经存在!");
|
|
rs.setCode("500");
|
|
rs.setCode("500");
|
|
@@ -118,6 +129,7 @@ public class EmsProdplanYearServiceImpl extends BaseServiceImpl<EmsProdplanYear,
|
|
UserPayload payload = UserPayload.getCurrUser();
|
|
UserPayload payload = UserPayload.getCurrUser();
|
|
FileInputStream is = null;
|
|
FileInputStream is = null;
|
|
String fileName = file.getName();
|
|
String fileName = file.getName();
|
|
|
|
+ Calendar calendar1=Calendar.getInstance();
|
|
// 解决fileName兼容性问题
|
|
// 解决fileName兼容性问题
|
|
int lastindex = fileName.lastIndexOf("\\");
|
|
int lastindex = fileName.lastIndexOf("\\");
|
|
fileName = fileName.substring(lastindex + 1);
|
|
fileName = fileName.substring(lastindex + 1);
|
|
@@ -126,258 +138,256 @@ public class EmsProdplanYearServiceImpl extends BaseServiceImpl<EmsProdplanYear,
|
|
is = new FileInputStream(file);
|
|
is = new FileInputStream(file);
|
|
}
|
|
}
|
|
List<List<String[]>> list = ExcelToolUtils.parseExcels(is, fileName, 0);
|
|
List<List<String[]>> list = ExcelToolUtils.parseExcels(is, fileName, 0);
|
|
-
|
|
|
|
- // SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
+ final Pattern pattern = Pattern.compile("[0-9]*");
|
|
try {
|
|
try {
|
|
- String name = fileName.substring(2, 4);
|
|
|
|
- for (int i = 1; i < list.size(); i++) {
|
|
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ String[] arr2 = list.get(i).get(1);
|
|
for(int j = 1; j < list.get(i).size(); j++) {
|
|
for(int j = 1; j < list.get(i).size(); j++) {
|
|
String[] arr = list.get(i).get(j);
|
|
String[] arr = list.get(i).get(j);
|
|
String[] arr1 = list.get(i).get(0);
|
|
String[] arr1 = list.get(i).get(0);
|
|
- //String steel = emsGmPcJhMapper.selectsteelcode(arr[1], arr[0]);
|
|
|
|
- //
|
|
|
|
- //String heat = emsGmPcJhMapper.selectheatno(arr[0]);
|
|
|
|
-
|
|
|
|
- EmsProdplanYear spp = new EmsProdplanYear();
|
|
|
|
- ////查询是已经有数据了,有数据不执行导入功能
|
|
|
|
- //String v1 = emsGmPcJhMapper.select4(arr[0]);
|
|
|
|
- //if (Integer.valueOf(v1)>0) {
|
|
|
|
- // continue;
|
|
|
|
- //}
|
|
|
|
- //AT2005 = "G-G1-";
|
|
|
|
- //AT2006 = "G-G2-";
|
|
|
|
- //AT2004 = "G-L1-";
|
|
|
|
- //AT2007 = "G-X1-";
|
|
|
|
- //Pattern pattern = Pattern.compile("^-?[0-9]+"); //这个也行
|
|
|
|
- //Pattern pattern = Pattern.compile("^-?\\d+(\\.\\d+)?$");//这个也行
|
|
|
|
- //正整数
|
|
|
|
- Pattern pattern = Pattern.compile("[0-9]*");
|
|
|
|
- if(arr[0].length()>8 || !pattern.matcher(arr[0]).matches()){
|
|
|
|
- throw new MarketSlmException(500,"排产日期(编号)有误!");
|
|
|
|
- }
|
|
|
|
- StringBuffer s=new StringBuffer(arr[0]).insert(4,"-").insert(7,"-");
|
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- simpleDateFormat.setLenient(false);
|
|
|
|
- //spp.setJhTime(simpleDateFormat.parse(s.toString()));
|
|
|
|
- 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-");
|
|
|
|
- // spp.setWorkprocType("AT2004");
|
|
|
|
- // break;
|
|
|
|
- // case "高线" :
|
|
|
|
- // if(arr[1].contains("一")){
|
|
|
|
- // spp.setType("G-G1-");
|
|
|
|
- // spp.setWorkprocType("AT2005");
|
|
|
|
- // } else {
|
|
|
|
- // spp.setType("G-G2-");
|
|
|
|
- // spp.setWorkprocType("AT2006");
|
|
|
|
- // }
|
|
|
|
- // break;
|
|
|
|
- // default: throw new Exception("请选择模板文件");
|
|
|
|
- //}
|
|
|
|
- String maxid = "";
|
|
|
|
- String strh =maxid.substring(maxid.length() -2,maxid.length());
|
|
|
|
- Integer seq = Integer.parseInt(strh)+(i-1);
|
|
|
|
- spp.setId(maxid.replace("-"+strh,seq<10?"-0"+seq.toString():"-"+seq.toString()));
|
|
|
|
- //spp.setState("0");
|
|
|
|
- //spp.setCreateMan(payload.getUserName());
|
|
|
|
- //spp.setCreateTime(new Date());
|
|
|
|
- //spp.setUnitid("008");
|
|
|
|
- //for(int j =1;j<arr1.length;j++) {
|
|
|
|
- // switch (arr1[j].trim()) {
|
|
|
|
- // case "规格" :
|
|
|
|
- // spp.setSpecifications(arr[j]);
|
|
|
|
- // break;
|
|
|
|
- // case "钢种" :
|
|
|
|
- // spp.setGrades(arr[j]);
|
|
|
|
- // break;
|
|
|
|
- // case "长度" :
|
|
|
|
- // spp.setLengths(new BigDecimal(arr[j]));
|
|
|
|
- // break;
|
|
|
|
- // case "运输方式" :
|
|
|
|
- // spp.setTransportType(arr[j]);
|
|
|
|
- // break;
|
|
|
|
- // case "用途" :
|
|
|
|
- // spp.setPurpose(arr[j]);
|
|
|
|
- // break;
|
|
|
|
- // case "订单量" :
|
|
|
|
- // if(!pattern.matcher(arr[j]).matches()){
|
|
|
|
- // throw new MarketSlmException(500,"订单量有误,请仔细检查");
|
|
|
|
- // }
|
|
|
|
- // spp.setKxfWeight(new BigDecimal(arr[j]));
|
|
|
|
- // spp.setYxfWeight(new BigDecimal("0"));
|
|
|
|
- // spp.setPlanWeight(new BigDecimal(arr[j]));
|
|
|
|
- // break;
|
|
|
|
- // case "交货日期" :
|
|
|
|
- // spp.setDeliveryDate(simpleDateFormat.parse(arr[j]));
|
|
|
|
- // break;
|
|
|
|
- // case "备注" :
|
|
|
|
- // spp.setMemo(arr[j]);
|
|
|
|
- // break;
|
|
|
|
- // case "分厂" : continue;
|
|
|
|
- // case "应急标识" :
|
|
|
|
- // if(arr[j] != null && "应急".equals(arr[j].trim()) ) {
|
|
|
|
- // spp.setTag("1");
|
|
|
|
- // break;
|
|
|
|
- // }
|
|
|
|
- // spp.setTag("0");
|
|
|
|
- // break;
|
|
|
|
- // default:
|
|
|
|
- // throw new MarketSlmException(500,"模板文件存在模板外的列,请仔细检查!!");
|
|
|
|
- // }
|
|
|
|
- //}
|
|
|
|
- //spp.setSteelCode(steel);
|
|
|
|
- //spp.setHeatno(heat);
|
|
|
|
- //for (int j=2;j<10;j++)
|
|
|
|
- //{
|
|
|
|
- // if (arr1[j].equals("屈服强度ReH"))
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyVal1(arr[j]);
|
|
|
|
- // spp.setQltyCfnm("屈服强度R(eH)");
|
|
|
|
- // spp.setQltyCd("qy0001");
|
|
|
|
- // List<Map<String,Object>> rows = qcmQltyJudgeMapper.selectstd(spp.getSteelCode(), spp.getQltyCd());
|
|
|
|
- // if(rows.size()>0)
|
|
|
|
- // {
|
|
|
|
- // if(rows.get(0).get("QLTY_MIN")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMin(rows.get(0).get("QLTY_MIN").toString());
|
|
|
|
- // }
|
|
|
|
- // if(rows.get(0).get("QLTY_MAX")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMax(rows.get(0).get("QLTY_MAX").toString());
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // EmsGmPcJh spp1 = new EmsGmPcJh();
|
|
|
|
- // BeanUtils.copyProperties(spp,spp1);
|
|
|
|
- // lists.add(spp1);
|
|
|
|
- // }
|
|
|
|
- // if (arr1[j].equals("屈服强度ReL"))
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyVal1(arr[j]);
|
|
|
|
- // spp.setQltyCfnm("屈服强度R(eL)");
|
|
|
|
- // spp.setQltyCd("qy0002");
|
|
|
|
- // List<Map<String,Object>> rows = qcmQltyJudgeMapper.selectstd(spp.getSteelCode(), spp.getQltyCd());
|
|
|
|
- // if(rows!=null&&!"".equals(rows.toString()))
|
|
|
|
- // {
|
|
|
|
- // if(rows.get(0).get("QLTY_MIN")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMin(rows.get(0).get("QLTY_MIN").toString());
|
|
|
|
- // }
|
|
|
|
- // if(rows.get(0).get("QLTY_MIN")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMax(rows.get(0).get("QLTY_MAX").toString());
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // EmsGmPcJh spp1 = new EmsGmPcJh();
|
|
|
|
- // BeanUtils.copyProperties(spp,spp1);
|
|
|
|
- // lists.add(spp1);
|
|
|
|
- // }
|
|
|
|
- // if (arr1[j].equals("抗拉强度Rm"))
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyVal1(arr[j]);
|
|
|
|
- // spp.setQltyCfnm("抗拉强度Rm");
|
|
|
|
- // spp.setQltyCd("qy0003");
|
|
|
|
- // List<Map<String,Object>> rows = qcmQltyJudgeMapper.selectstd(spp.getSteelCode(), spp.getQltyCd());
|
|
|
|
- // if(rows.get(0).get("QLTY_MIN")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMin(rows.get(0).get("QLTY_MIN").toString());
|
|
|
|
- // }
|
|
|
|
- // if(rows.get(0).get("QLTY_MAX")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMax(rows.get(0).get("QLTY_MAX").toString());
|
|
|
|
- // }
|
|
|
|
- // EmsGmPcJh spp1 = new EmsGmPcJh();
|
|
|
|
- // BeanUtils.copyProperties(spp,spp1);
|
|
|
|
- // lists.add(spp1);
|
|
|
|
- // }
|
|
|
|
- //
|
|
|
|
- // if (arr1[j].equals("断后伸长率%"))
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyVal1(arr[j]);
|
|
|
|
- // spp.setQltyCfnm("断后伸长率%");
|
|
|
|
- // spp.setQltyCd("qy0004");
|
|
|
|
- // List<Map<String,Object>> rows = qcmQltyJudgeMapper.selectstd(spp.getSteelCode(), spp.getQltyCd());
|
|
|
|
- // if(rows.get(0).get("QLTY_MIN")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMin(rows.get(0).get("QLTY_MIN").toString());
|
|
|
|
- // }
|
|
|
|
- // if(rows.get(0).get("QLTY_MAX")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMax(rows.get(0).get("QLTY_MAX").toString());
|
|
|
|
- // }
|
|
|
|
- // EmsGmPcJh spp1 = new EmsGmPcJh();
|
|
|
|
- // BeanUtils.copyProperties(spp,spp1);
|
|
|
|
- // lists.add(spp1);
|
|
|
|
- // }
|
|
|
|
- //
|
|
|
|
- // if (arr1[j].equals("冲击试验温度"))
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyVal1(arr[j]);
|
|
|
|
- // spp.setQltyCfnm("冲击试验温度");
|
|
|
|
- // spp.setQltyCd("qy0005");
|
|
|
|
- // List<Map<String,Object>> rows = qcmQltyJudgeMapper.selectstd(spp.getSteelCode(), spp.getQltyCd());
|
|
|
|
- // if(rows.get(0).get("QLTY_MIN")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMin(rows.get(0).get("QLTY_MIN").toString());
|
|
|
|
- // }
|
|
|
|
- // if(rows.get(0).get("QLTY_MAX")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMax(rows.get(0).get("QLTY_MAX").toString());
|
|
|
|
- // }
|
|
|
|
- // EmsGmPcJh spp1 = new EmsGmPcJh();
|
|
|
|
- // BeanUtils.copyProperties(spp,spp1);
|
|
|
|
- // lists.add(spp1);
|
|
|
|
- // }
|
|
|
|
- // if (arr1[j].equals("冷弯"))
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyVal1(arr[j]);
|
|
|
|
- // spp.setQltyCfnm("冷弯");
|
|
|
|
- // spp.setQltyCd("qy0009");
|
|
|
|
- // List<Map<String,Object>> rows = qcmQltyJudgeMapper.selectstd(spp.getSteelCode(), spp.getQltyCd());
|
|
|
|
- // if(rows.get(0).get("QLTY_MIN")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMin(rows.get(0).get("QLTY_MIN").toString());
|
|
|
|
- // }
|
|
|
|
- // if(rows.get(0).get("QLTY_MAX")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMax(rows.get(0).get("QLTY_MAX").toString());
|
|
|
|
- // }
|
|
|
|
- // EmsGmPcJh spp1 = new EmsGmPcJh();
|
|
|
|
- // BeanUtils.copyProperties(spp,spp1);
|
|
|
|
- // lists.add(spp1);
|
|
|
|
- // }
|
|
|
|
- // if (arr1[j].equals("冲击吸收功J1"))
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyVal1(arr[j]);
|
|
|
|
- // spp.setQltyVal2(arr[j+1]);
|
|
|
|
- // spp.setQltyVal3(arr[j+2]);
|
|
|
|
- // spp.setQltyCfnm("冲击");
|
|
|
|
- // spp.setQltyCd("qy0006");
|
|
|
|
- // List<Map<String,Object>> rows = qcmQltyJudgeMapper.selectstd(spp.getSteelCode(), spp.getQltyCd());
|
|
|
|
- // if(rows.get(0).get("QLTY_MIN")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMin(rows.get(0).get("QLTY_MIN").toString());
|
|
|
|
- // }
|
|
|
|
- // if(rows.get(0).get("QLTY_MAX")!=null)
|
|
|
|
- // {
|
|
|
|
- // spp.setQltyMax(rows.get(0).get("QLTY_MAX").toString());
|
|
|
|
- // }
|
|
|
|
- // EmsGmPcJh spp1 = new EmsGmPcJh();
|
|
|
|
- // BeanUtils.copyProperties(spp,spp1);
|
|
|
|
- // lists.add(spp1);
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- //}
|
|
|
|
- lists.add(spp);
|
|
|
|
|
|
+ if( "".equals(arr[0].trim()) || !pattern.matcher(arr[0]).matches()){
|
|
|
|
+ arr2 = list.get(i).get(1);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ for(int k =1;k<arr1.length;k++) {
|
|
|
|
+ EmsProdplanYear spp = new EmsProdplanYear();
|
|
|
|
+ // 月份 丛0开始 所以减一
|
|
|
|
+ calendar1.set(Calendar.MONTH, Integer.parseInt(arr[0].trim()) - 1 );
|
|
|
|
+ //天数 1号
|
|
|
|
+ calendar1.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
+ // 时
|
|
|
|
+ calendar1.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ // 分
|
|
|
|
+ calendar1.set(Calendar.MINUTE, 0);
|
|
|
|
+ // 秒
|
|
|
|
+ calendar1.set(Calendar.SECOND, 0);
|
|
|
|
+ // 毫秒
|
|
|
|
+ calendar1.set(Calendar.MILLISECOND, 0);
|
|
|
|
+ spp.setYearmonth(calendar1.getTime());
|
|
|
|
+ //if(arr1[k].trim().indexOf("月份") != -1) {
|
|
|
|
+ // // 月份 丛0开始 所以减一
|
|
|
|
+ // calendar1.set(Calendar.MONTH, Integer.parseInt(arr[k].trim()) - 1 );
|
|
|
|
+ // //天数 1号
|
|
|
|
+ // calendar1.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
+ // // 时
|
|
|
|
+ // calendar1.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ // // 分
|
|
|
|
+ // calendar1.set(Calendar.MINUTE, 0);
|
|
|
|
+ // // 秒
|
|
|
|
+ // calendar1.set(Calendar.SECOND, 0);
|
|
|
|
+ // // 毫秒
|
|
|
|
+ // calendar1.set(Calendar.MILLISECOND, 0);
|
|
|
|
+ // spp.setYearmonth(calendar1.getTime());
|
|
|
|
+ //}
|
|
|
|
+ // 烧结else
|
|
|
|
+ if (arr1[k].trim().indexOf("1#烧结") != -1) {
|
|
|
|
+ spp.setParentid("SJ");
|
|
|
|
+ spp.setLine("AT3013");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if (arr1[k].trim().indexOf("2#烧结") != -1) {
|
|
|
|
+ spp.setParentid("SJ");
|
|
|
|
+ spp.setLine("AT3014");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if (arr1[k].trim().indexOf("3#烧结") != -1) {
|
|
|
|
+ spp.setParentid("SJ");
|
|
|
|
+ spp.setLine("AT3015");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
|
|
+ // 铁水
|
|
|
|
+ else if (arr1[k].trim().indexOf("1#高炉") != -1) {
|
|
|
|
+ spp.setParentid("LT");
|
|
|
|
+ spp.setLine("AT3001");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if (arr1[k].trim().indexOf("2#高炉") != -1) {
|
|
|
|
+ spp.setParentid("LT");
|
|
|
|
+ spp.setLine("AT3002");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if (arr1[k].trim().indexOf("3#高炉") != -1) {
|
|
|
|
+ spp.setParentid("LT");
|
|
|
|
+ spp.setLine("AT3003");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if (arr1[k].trim().indexOf("4#高炉") != -1) {
|
|
|
|
+ spp.setParentid("LT");
|
|
|
|
+ spp.setLine("AT3004");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
|
|
+ // 钢坯
|
|
|
|
+ else if ("供高线一车间方坯".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("LG");
|
|
|
|
+ spp.setLine("AT2005-1");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("供高线二车间方坯".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("LG");
|
|
|
|
+ spp.setLine("AT2006-1");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("异形坯".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("LG");
|
|
|
|
+ spp.setLine("AT2007-1");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("外销方坯".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("LG");
|
|
|
|
+ spp.setLine("AT3008-1");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
|
|
+ // 钢轧厂
|
|
|
|
+ else if ("高线一车间".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("ZG");
|
|
|
|
+ spp.setLine("AT2005");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("高线二车间".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("ZG");
|
|
|
|
+ spp.setLine("AT2006");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("H型钢".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("ZG");
|
|
|
|
+ spp.setLine("AT2007");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
|
|
+ // 机焦厂
|
|
|
|
+ else if (arr1[k].trim().indexOf("成品焦") != -1) {
|
|
|
|
+ spp.setProductid("成品焦");
|
|
|
|
+ spp.setParentid("JJZ");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(BigDecimal.ZERO);
|
|
|
|
+ for (int m = 0;m <= 2; m++ ){
|
|
|
|
+ if ("高炉用量".equals(arr2[k+m].trim())) {
|
|
|
|
+ spp.setWeight1(new BigDecimal(arr[k+m].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("外销数量".equals(arr2[k+m].trim())) {
|
|
|
|
+ spp.setWeight2(new BigDecimal(arr[k+m].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ k +=2;
|
|
|
|
+ } else if (arr1[k].trim().indexOf("小粒焦") != -1) {
|
|
|
|
+ spp.setProductid("小粒焦");
|
|
|
|
+ spp.setParentid("JJZ");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(BigDecimal.ZERO);
|
|
|
|
+ for (int m = 0;m <= 2; m++ ) {
|
|
|
|
+ if ("高炉用量".equals(arr2[k+m].trim())) {
|
|
|
|
+ spp.setWeight1(new BigDecimal(arr[k+m].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("外销数量".equals(arr2[k+m].trim())) {
|
|
|
|
+ spp.setWeight2(new BigDecimal(arr[k+m].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ k +=2;
|
|
|
|
+ } else if (arr1[k].trim().indexOf("除尘焦粉") != -1) {
|
|
|
|
+ spp.setProductid("除尘焦粉");
|
|
|
|
+ spp.setParentid("JJZ");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(BigDecimal.ZERO);
|
|
|
|
+ for (int m = 0;m <= 2; m++ ) {
|
|
|
|
+ if ("高炉用量".equals(arr2[k+m].trim())) {
|
|
|
|
+ spp.setWeight1(new BigDecimal(arr[k+m].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("外销数量".equals(arr2[k+m].trim())) {
|
|
|
|
+ spp.setWeight2(new BigDecimal(arr[k+m].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ k +=2;
|
|
|
|
+ } else if (arr1[k].trim().indexOf("焦粉") != -1) {
|
|
|
|
+ spp.setProductid("焦粉");
|
|
|
|
+ spp.setParentid("JJZ");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight2(BigDecimal.ZERO);
|
|
|
|
+ for (int m = 0;m <= 2; m++ ) {
|
|
|
|
+ if ("烧结用量".equals(arr2[k+m].trim())) {
|
|
|
|
+ spp.setWeight1(new BigDecimal(arr[k+m].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("预计外购".equals(arr2[k+m].trim())) {
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k+m].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ k +=2;
|
|
|
|
+ }
|
|
|
|
+ // 发电厂
|
|
|
|
+ else if (arr1[k].trim().indexOf("40MW") != -1) {
|
|
|
|
+ spp.setParentid("FDC");
|
|
|
|
+ spp.setLine("AT4002");
|
|
|
|
+ spp.setUnit("Kwh");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if (arr1[k].trim().indexOf("45MW") != -1) {
|
|
|
|
+ spp.setParentid("FDC");
|
|
|
|
+ spp.setLine("AT4003");
|
|
|
|
+ spp.setUnit("Kwh");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if (arr1[k].trim().indexOf("25MW") != -1) {
|
|
|
|
+ spp.setParentid("FDC");
|
|
|
|
+ spp.setLine("AT4001");
|
|
|
|
+ spp.setUnit("Kwh");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if (arr1[k].trim().indexOf("15MW") != -1) {
|
|
|
|
+ spp.setParentid("FDC");
|
|
|
|
+ spp.setLine("AT4004");
|
|
|
|
+ spp.setUnit("Kwh");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if (arr1[k].trim().indexOf("TRT") != -1) {
|
|
|
|
+ spp.setParentid("FDC");
|
|
|
|
+ spp.setLine("AT3022");
|
|
|
|
+ spp.setUnit("Kwh");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
|
|
+ // 机焦副产品
|
|
|
|
+ else if ("焦油".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("JJF");
|
|
|
|
+ spp.setLine("AT3024");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("粗笨".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("JJF");
|
|
|
|
+ spp.setLine("AT3009");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("硫铵".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("JJF");
|
|
|
|
+ spp.setLine("AT3010");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("硫酸".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("JJF");
|
|
|
|
+ spp.setLine("AT3025");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("洗煤".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("JJH");
|
|
|
|
+ spp.setProductid("AT2012");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ }
|
|
|
|
+ // 建材
|
|
|
|
+ else if (arr1[k].trim().indexOf("1#回转窑") != -1) {
|
|
|
|
+ spp.setParentid("JCS");
|
|
|
|
+ spp.setLine("AT3011");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if (arr1[k].trim().indexOf("2#回转窑") != -1) {
|
|
|
|
+ spp.setParentid("JCS");
|
|
|
|
+ spp.setLine("AT3012");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else if ("矿渣粉".equals(arr1[k].trim())) {
|
|
|
|
+ spp.setParentid("JCW");
|
|
|
|
+ spp.setProductid("AT2014");
|
|
|
|
+ spp.setUnit("吨");
|
|
|
|
+ spp.setWeight(new BigDecimal(arr[k].trim()).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
|
+ } else {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ spp.setCjr(payload.getUserName());
|
|
|
|
+ spp.setCjsj(new Date());
|
|
|
|
+ lists.add(spp);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} catch (Exception e){
|
|
} catch (Exception e){
|