|
@@ -8,6 +8,7 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import com.miniframe.core.ExecProcessFlow;
|
|
|
+import com.miniframe.core.exception.BusinessException;
|
|
|
import com.miniframe.core.ext.UtilTools;
|
|
|
import com.miniframe.generate.business.system.model.D10016BaseModel;
|
|
|
import com.miniframe.generate.comm.system.D_D10016_CHVALS_RECODE;
|
|
@@ -48,37 +49,42 @@ public class D10016Service extends D10016BaseModel implements ExecProcessFlow {
|
|
|
}
|
|
|
|
|
|
// Path path = Paths.get(outPath+"/"+fileName);
|
|
|
- FileReader fileReader = new FileReader(outPath+"/"+fileName);
|
|
|
- BufferedReader reader = new BufferedReader(fileReader);
|
|
|
- String line;
|
|
|
- int linNum =1;
|
|
|
- List<D_D10016_COCODES_RECODE> coodeList= new ArrayList<>();
|
|
|
- List<D_D10016_CHVALS_RECODE> chvalsList= new ArrayList<>();
|
|
|
- while ((line = reader.readLine()) != null) {
|
|
|
- String[] t = line.trim().split(",");
|
|
|
- if(linNum==1){
|
|
|
- for (int i=1;i<t.length;i++) {
|
|
|
- D_D10016_COCODES_RECODE cocode =new D_D10016_COCODES_RECODE();
|
|
|
- cocode.setCocode(t[i]);
|
|
|
- coodeList.add(cocode);
|
|
|
+ try{
|
|
|
+ FileReader fileReader = new FileReader(outPath+"/"+fileName);
|
|
|
+ BufferedReader reader = new BufferedReader(fileReader);
|
|
|
+ String line;
|
|
|
+ int linNum =1;
|
|
|
+ List<D_D10016_COCODES_RECODE> coodeList= new ArrayList<>();
|
|
|
+ List<D_D10016_CHVALS_RECODE> chvalsList= new ArrayList<>();
|
|
|
+ while ((line = reader.readLine()) != null) {
|
|
|
+ String[] t = line.trim().split(",");
|
|
|
+ if(linNum==1){
|
|
|
+ for (int i=1;i<t.length;i++) {
|
|
|
+ D_D10016_COCODES_RECODE cocode =new D_D10016_COCODES_RECODE();
|
|
|
+ cocode.setCocode(t[i]);
|
|
|
+ coodeList.add(cocode);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ D_D10016_CHVALS_RECODE chval=new D_D10016_CHVALS_RECODE();
|
|
|
+ chval.setChcode(t.length>0?t[0]:"0");
|
|
|
+ chval.setV1(t.length>1?t[1]:"0");
|
|
|
+ chval.setV2(t.length>2?t[2]:"0");
|
|
|
+ chval.setV3(t.length>3?t[3]:"0");
|
|
|
+ chval.setV4(t.length>4?t[4]:"0");
|
|
|
+ chval.setV5(t.length>5?t[5]:"0");
|
|
|
+ chval.setV6(t.length>6?t[6]:"0");
|
|
|
+ chvalsList.add(chval);
|
|
|
}
|
|
|
- }else {
|
|
|
- D_D10016_CHVALS_RECODE chval=new D_D10016_CHVALS_RECODE();
|
|
|
- chval.setChcode(t.length>0?t[0]:"0");
|
|
|
- chval.setV1(t.length>1?t[1]:"0");
|
|
|
- chval.setV2(t.length>2?t[2]:"0");
|
|
|
- chval.setV3(t.length>3?t[3]:"0");
|
|
|
- chval.setV4(t.length>4?t[4]:"0");
|
|
|
- chval.setV5(t.length>5?t[5]:"0");
|
|
|
- chval.setV6(t.length>6?t[6]:"0");
|
|
|
- chvalsList.add(chval);
|
|
|
+ linNum++;
|
|
|
}
|
|
|
- linNum++;
|
|
|
+ fileReader.close();
|
|
|
+ reader.close();
|
|
|
+ this.getD_d10016().setChvals(chvalsList);
|
|
|
+ this.getD_d10016().setCocodes(coodeList);
|
|
|
+ }catch (Exception e){
|
|
|
+ System.out.println(e);
|
|
|
+ throw new BusinessException("EB3100014");
|
|
|
}
|
|
|
- fileReader.close();
|
|
|
- reader.close();
|
|
|
- this.getD_d10016().setChvals(chvalsList);
|
|
|
- this.getD_d10016().setCocodes(coodeList);
|
|
|
|
|
|
// XIFileUtils.readFileAsString(outPath+"/"+fileName);
|
|
|
// String mimeType = MFMimeTypeUtils.getMimeType(path);
|