Explorar o código

dcs车间单独一个表,不和设备位置公用

hfxc226 %!s(int64=2) %!d(string=hai) anos
pai
achega
a111514be8

+ 69 - 0
platform-dao/src/main/java/com/platform/dao/test/Cbdk.java

@@ -0,0 +1,69 @@
+package com.platform.dao.test;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @Description
+ * @Author chenli
+ * @Date 2019/8/5
+ * @Version Copyright (c) 2019,北京乾元坤和科技有限公司 All rights reserved.
+ */
+@Data
+@Accessors(chain = true)
+public class Cbdk implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * 地块编码
+     */
+    private String DKBM;
+    /**
+     * 发包方编码
+     */
+    private String FBFBM;
+    /**
+     * 承包方编码
+     */
+    private String CBFBM;
+    /**
+     *
+     */
+    private String CBJYQQDFS;
+    /**
+     * 合同面积
+     */
+    private String HTMJ;
+    /**
+     * 承包合同编码
+     */
+    private String CBHTBM;
+    /**
+     * 合同编码
+     */
+    private String LZHTBM;
+    /**
+     *
+     */
+    private String CBJYQZBM;
+    /**
+     * 原合同面积
+     */
+    private String YHTMJ;
+    /**
+     *合同面积亩
+     */
+    private String HTMJM;
+    /**
+     *原合同面积亩
+     */
+    private String YHTMJM;
+    /**
+     *
+     */
+    private String SFQQQG;
+
+}

+ 94 - 0
platform-dao/src/main/java/com/platform/dao/test/Cbf.java

@@ -0,0 +1,94 @@
+package com.platform.dao.test;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @Description
+ * @Author chenli
+ * @Date 2019/8/5
+ * @Version Copyright (c) 2019,北京乾元坤和科技有限公司 All rights reserved.
+ */
+@Data
+@Accessors(chain = true)
+public class Cbf implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 发包方名称
+     */
+    private String FBFMC;
+    /**
+     * 承包方身份证
+     */
+    private String CBFBM;
+    /**
+     * 承包方身份证
+     */
+    private String CBFLX;
+    /**
+     * 成员姓名
+     */
+    private String CBFMC;
+    /**
+     * 成员性别1男,2女
+     */
+    private String CBFZJLX;
+    /**
+     * 成员
+     */
+    private String CBFZJHM;
+    /**
+     * 成员证件号码
+     */
+    private String CBFDZ;
+    /**
+     *
+     */
+    private String YZBM;
+    /**
+     *
+     */
+    private String LXDH;
+    /**
+     *
+     */
+    private String CBFCYSL;
+    /**
+     *
+     */
+    private String CBFDCRQ;
+    /**
+     *
+     */
+    private String CBFDCY;
+    /**
+     * 成员
+     */
+    private String CBFDCJS;
+    /**
+     * 成员证件号码
+     */
+    private String GSJS;
+    /**
+     *
+     */
+    private String GSJSR;
+    /**
+     *
+     */
+    private String GSSHRQ;
+    /**
+     *
+     */
+    private String GSSHR;
+    /**
+     *
+     */
+    private String FBFBM;
+
+}

+ 77 - 0
platform-dao/src/main/java/com/platform/dao/test/Cy.java

@@ -0,0 +1,77 @@
+package com.platform.dao.test;
+
+import com.platform.office.annotation.Excel;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @Description
+ * @Author chenli
+ * @Date 2019/8/5
+ * @Version Copyright (c) 2019,北京乾元坤和科技有限公司 All rights reserved.
+ */
+@Data
+@Accessors(chain = true)
+public class Cy implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 发包方编码
+     */
+    @Excel(name = "FBFBM")
+    private String FBFBM;
+    /**
+     * 发包方名称
+     */
+    @Excel(name = "FBFMC")
+    private String FBFMC;
+    /**
+     * 承包方身份证
+     */
+    @Excel(name = "CBFBM")
+    private String CBFBM;
+    /**
+     * 成员姓名
+     */
+    @Excel(name = "CYXM")
+    private String CYXM;
+    /**
+     * 成员性别1男,2女
+     */
+    @Excel(name = "CYXB")
+    private String CYXB;
+    /**
+     * 成员
+     */
+    @Excel(name = "CYZJLX")
+    private String CYZJLX;
+    /**
+     * 成员证件号码
+     */
+    @Excel(name = "CYZJHM")
+    private String CYZJHM;
+    /**
+     *
+     */
+    @Excel(name = "YHZGX")
+    private String YHZGX;
+    /**
+     *
+     */
+    @Excel(name = "CYBZ")
+    private String CYBZ;
+    /**
+     *
+     */
+    @Excel(name = "SFGYR")
+    private String SFGYR;
+    /**
+     *
+     */
+    @Excel(name = "CYBZSM")
+    private String CYBZSM;
+
+}

+ 194 - 0
platform-dao/src/main/java/com/platform/dao/test/Util.java

@@ -0,0 +1,194 @@
+package com.platform.dao.test;
+
+import com.platform.common.util.IdGeneratorUtils;
+import com.platform.common.util.StringUtils;
+import com.platform.dao.util.CustomExcelImportUtil;
+import com.platform.dao.util.ExcelUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.POIXMLDocument;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.openxml4j.opc.OPCPackage;
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+@Slf4j
+public class Util {
+
+    public static void main(String[] args) throws IOException, InvalidFormatException {
+        String oldFilePath = "F:\\公司\\临泉\\修改测试\\安徽省阜阳市临泉县田桥乡前王村东王组-成员表.xls";// 原始文件
+        String newFilePath = "F:\\公司\\临泉\\修改测试\\东王组承包方家庭成员信息.xlsx";// 修改后的文件
+        List<Cy> oldList = getListCy(new FileInputStream(oldFilePath));
+       /* for(Cy item: oldList){
+            if(StringUtils.isNotEmpty(item.getFBFBM())){
+                log.info(item.toString());
+            }
+        }*/
+
+        List<Cy> newList = getListCy(new FileInputStream(newFilePath));
+        newList.forEach(item->{
+            if(StringUtils.isNotEmpty(item.getFBFBM())){
+                log.info(item.toString());
+            }
+        });
+
+        log.info(oldList.size() + "");
+        log.info(newList.size() + "");
+    }
+
+    public static List<Cy> getListCy(InputStream inputstream) throws IOException, InvalidFormatException {
+        if (inputstream == null) {
+            return Collections.emptyList();
+        }
+        Workbook book = null;
+        if (!(inputstream.markSupported())) {
+            inputstream = new PushbackInputStream(inputstream, 8);
+        }
+        if (POIFSFileSystem.hasPOIFSHeader(inputstream)) {
+            book = new HSSFWorkbook(inputstream);
+        } else if (POIXMLDocument.hasOOXMLHeader(inputstream)) {
+            book = new XSSFWorkbook(OPCPackage.open(inputstream));
+        }
+        Sheet sheet = book.getSheetAt(0);
+        int rowCounts = sheet.getLastRowNum();
+        List<Cy> result = new ArrayList<>(rowCounts);
+        Cy record = null;
+
+        StringBuffer error = new StringBuffer();
+        for (int i = 1; i <= rowCounts; i++) {
+            record = new Cy();
+            Row row = sheet.getRow(i);
+            if(CustomExcelImportUtil.isRowEmpty(row)){
+                continue;
+            }
+            try {
+                //i,j i:行 j:列
+                record.setFBFBM(CustomExcelImportUtil.getCellValue(row.getCell(0)));
+                record.setFBFMC(CustomExcelImportUtil.getCellValue(row.getCell(1)));
+                record.setCBFBM(CustomExcelImportUtil.getCellValue(row.getCell(2)));
+                record.setCYXM(CustomExcelImportUtil.getCellValue(row.getCell(3)));
+                record.setCYXB(CustomExcelImportUtil.getCellValue(row.getCell(4)));
+                record.setCYZJLX(CustomExcelImportUtil.getCellValue(row.getCell(5)));
+                record.setCYZJHM(CustomExcelImportUtil.getCellValue(row.getCell(6)));
+                record.setYHZGX(CustomExcelImportUtil.getCellValue(row.getCell(7)));
+                record.setCYBZ(CustomExcelImportUtil.getCellValue(row.getCell(8)));
+                record.setSFGYR(CustomExcelImportUtil.getCellValue(row.getCell(9)));
+                record.setCYBZSM(CustomExcelImportUtil.getCellValue(row.getCell(10)));
+                result.add(record);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+
+
+    public static List<Cbf> getListCbf(InputStream inputstream) throws IOException, InvalidFormatException {
+        if (inputstream == null) {
+            return Collections.emptyList();
+        }
+        Workbook book = null;
+        if (!(inputstream.markSupported())) {
+            inputstream = new PushbackInputStream(inputstream, 8);
+        }
+        if (POIFSFileSystem.hasPOIFSHeader(inputstream)) {
+            book = new HSSFWorkbook(inputstream);
+        } else if (POIXMLDocument.hasOOXMLHeader(inputstream)) {
+            book = new XSSFWorkbook(OPCPackage.open(inputstream));
+        }
+        Sheet sheet = book.getSheetAt(0);
+        int rowCounts = sheet.getLastRowNum();
+        List<Cbf> result = new ArrayList<>(rowCounts);
+        Cbf record = null;
+
+        StringBuffer error = new StringBuffer();
+        for (int i = 1; i <= rowCounts; i++) {
+            record = new Cbf();
+            Row row = sheet.getRow(i);
+            if(CustomExcelImportUtil.isRowEmpty(row)){
+                continue;
+            }
+            try {
+                //i,j i:行 j:列
+                record.setFBFMC(CustomExcelImportUtil.getCellValue(row.getCell(0)));
+                record.setCBFBM(CustomExcelImportUtil.getCellValue(row.getCell(1)));
+                record.setCBFLX(CustomExcelImportUtil.getCellValue(row.getCell(2)));
+                record.setCBFMC(CustomExcelImportUtil.getCellValue(row.getCell(3)));
+                record.setCBFZJLX(CustomExcelImportUtil.getCellValue(row.getCell(4)));
+                record.setCBFZJHM(CustomExcelImportUtil.getCellValue(row.getCell(5)));
+                record.setCBFDZ(CustomExcelImportUtil.getCellValue(row.getCell(6)));
+                record.setYZBM(CustomExcelImportUtil.getCellValue(row.getCell(7)));
+                record.setLXDH(CustomExcelImportUtil.getCellValue(row.getCell(8)));
+                record.setCBFCYSL(CustomExcelImportUtil.getCellValue(row.getCell(9)));
+                record.setCBFDCRQ(CustomExcelImportUtil.getCellValue(row.getCell(10)));
+                record.setCBFDCY(CustomExcelImportUtil.getCellValue(row.getCell(11)));
+                record.setCBFDCJS(CustomExcelImportUtil.getCellValue(row.getCell(12)));
+                record.setGSJS(CustomExcelImportUtil.getCellValue(row.getCell(13)));
+                record.setGSJSR(CustomExcelImportUtil.getCellValue(row.getCell(14)));
+                record.setGSSHRQ(CustomExcelImportUtil.getCellValue(row.getCell(15)));
+                record.setGSSHR(CustomExcelImportUtil.getCellValue(row.getCell(16)));
+                record.setFBFBM(CustomExcelImportUtil.getCellValue(row.getCell(17)));
+                result.add(record);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    public static List<Cbdk> getListCbdk(InputStream inputstream) throws IOException, InvalidFormatException {
+        if (inputstream == null) {
+            return Collections.emptyList();
+        }
+        Workbook book = null;
+        if (!(inputstream.markSupported())) {
+            inputstream = new PushbackInputStream(inputstream, 8);
+        }
+        if (POIFSFileSystem.hasPOIFSHeader(inputstream)) {
+            book = new HSSFWorkbook(inputstream);
+        } else if (POIXMLDocument.hasOOXMLHeader(inputstream)) {
+            book = new XSSFWorkbook(OPCPackage.open(inputstream));
+        }
+        Sheet sheet = book.getSheetAt(0);
+        int rowCounts = sheet.getLastRowNum();
+        List<Cbdk> result = new ArrayList<>(rowCounts);
+        Cbdk record = null;
+
+        StringBuffer error = new StringBuffer();
+        for (int i = 1; i <= rowCounts; i++) {
+            record = new Cbdk();
+            Row row = sheet.getRow(i);
+            if(CustomExcelImportUtil.isRowEmpty(row)){
+                continue;
+            }
+            try {
+                //i,j i:行 j:列
+                record.setDKBM(CustomExcelImportUtil.getCellValue(row.getCell(0)));
+                record.setFBFBM(CustomExcelImportUtil.getCellValue(row.getCell(1)));
+                record.setCBFBM(CustomExcelImportUtil.getCellValue(row.getCell(2)));
+                record.setCBJYQQDFS(CustomExcelImportUtil.getCellValue(row.getCell(3)));
+                record.setHTMJ(CustomExcelImportUtil.getCellValue(row.getCell(4)));
+                record.setCBHTBM(CustomExcelImportUtil.getCellValue(row.getCell(5)));
+                record.setLZHTBM(CustomExcelImportUtil.getCellValue(row.getCell(6)));
+                record.setCBJYQZBM(CustomExcelImportUtil.getCellValue(row.getCell(7)));
+                record.setYHTMJ(CustomExcelImportUtil.getCellValue(row.getCell(8)));
+                record.setHTMJM(CustomExcelImportUtil.getCellValue(row.getCell(9)));
+                record.setYHTMJM(CustomExcelImportUtil.getCellValue(row.getCell(10)));
+                record.setSFQQQG(CustomExcelImportUtil.getCellValue(row.getCell(11)));
+                result.add(record);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+}

+ 4 - 2
platform-dao/src/main/java/com/platform/dao/util/CustomExcelImportUtil.java

@@ -566,14 +566,16 @@ public class CustomExcelImportUtil {
         // 判断数据的类型
         switch (cell.getCellType()) {
             case Cell.CELL_TYPE_NUMERIC: // 数字
-                if (HSSFDateUtil.isCellDateFormatted(cell)) {
+                /*if (HSSFDateUtil.isCellDateFormatted(cell)) {
                     Date date = cell.getDateCellValue();
                     cellValue = DateFormatUtils.format(date, "yyyy-MM-dd");
                 } else {
                     double value = cell.getNumericCellValue();
                     DecimalFormat df = new DecimalFormat("0");
                     cellValue = df.format(value);
-                }
+                }*/
+                double value = cell.getNumericCellValue();
+                cellValue = value + "";
                 break;
             case Cell.CELL_TYPE_STRING: // 字符串
                 cellValue = String.valueOf(cell.getStringCellValue());

+ 2 - 2
platform-office/src/main/java/com/platform/office/poi/excel/imports/ExcelImportServer.java

@@ -167,8 +167,8 @@ public class ExcelImportServer extends ImportBaseService {
         while (rows.hasNext() && (row == null || sheet.getLastRowNum() - row.getRowNum() > params.getLastOfInvalidRow())) {
             row = rows.next();
             int tempNum = params.getKeyIndex();
-            System.out.println("---------------111------------"+tempNum);
-            System.out.println("----------------3333-----------"+row.getCell(tempNum));
+            //System.out.println("---------------111------------"+tempNum);
+            //System.out.println("----------------3333-----------"+row.getCell(tempNum));
             // 判断是集合元素还是不是集合元素,如果是就继续加入这个集合,不是就创建新的对象
             if ((row.getCell(params.getKeyIndex()) == null && StringUtils.isNotEmpty(getKeyValue(row.getCell(params.getKeyIndex())))) && object != null) {
                 for (ExcelCollectionParams param : excelCollection) {

+ 4 - 0
platform-service/src/main/java/com/platform/service/remote/impl/RemotePositionServiceImpl.java

@@ -81,6 +81,8 @@ public class RemotePositionServiceImpl extends BaseServiceImpl<RemotePositionMap
 
     @Override
     public RemotePosition saveModelByDTO(RemotePositionDTO model) {
+        model.setOpcFlag(YesNoEnum.YES.getValue());
+        model.setLightFlag(YesNoEnum.NO.getValue());
         // 获取父级
         String parentId = model.getParentId();
         RemotePosition parent = null;
@@ -117,6 +119,8 @@ public class RemotePositionServiceImpl extends BaseServiceImpl<RemotePositionMap
 
     @Override
     public void modModelByDTO(RemotePositionDTO model) {
+        model.setOpcFlag(YesNoEnum.YES.getValue());
+        model.setLightFlag(YesNoEnum.NO.getValue());
         Weekend<RemotePosition> weekend = new Weekend<>(RemotePosition.class);
         WeekendCriteria<RemotePosition, Object> weekendCriteria = weekend.weekendCriteria();
         weekendCriteria.andEqualTo(RemotePosition::getNo, model.getNo());