Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

xiahan 1 rok temu
rodzic
commit
ab03097b26

+ 1 - 1
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/config/EquMaintenanceStandardListener.java

@@ -83,7 +83,7 @@ public class EquMaintenanceStandardListener extends AnalysisEventListener<EquMai
                 .setCreatedate(date)
                 .setModifydate(date)
                 .setId(SecurityUtil.getUUID())
-                .setTenantid(currentUser.getTenantid())
+                .setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1])
                 //                .setTenantid("0001S31000000000J0TR")
                 .setCreateusername(currentUser.getName())
                 .setCreateuserid(currentUser.getId())

+ 16 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/dao/EquFrockTestRecordDao.java

@@ -0,0 +1,16 @@
+package com.rongwei.bscommon.sys.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwei.bsentity.domain.EquFrockListDo;
+import com.rongwei.bsentity.domain.EquFrockTestRecordDo;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+public interface EquFrockTestRecordDao extends BaseMapper<EquFrockTestRecordDo> {
+    @Select("select FROCKNUM from equ_frock_list where DELETED='0'")
+    List<EquFrockListDo> getAllFrocknum();
+
+    @Select("select FROCKNUM,DATE(TESTDATE) as TESTDATE from equ_frock_test_record where DELETED='0'")
+    List<EquFrockTestRecordDo> getFrockRecord();
+}

+ 18 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquFrockTestRecordService.java

@@ -0,0 +1,18 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.domain.EquFrockTestRecordDo;
+import com.rongwei.rwcommon.base.R;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * <p>
+ * 设备子系统——工装周期检测记录 服务类
+ * </p>
+ *
+ * @author dlc
+ * @since 2023-11-24
+ */
+public interface EquFrockTestRecordService extends IService<EquFrockTestRecordDo> {
+    R importEquFrockTestRecord(MultipartFile file);
+}

+ 223 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquFrockTestRecordServiceImpl.java

@@ -0,0 +1,223 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bscommon.sys.dao.EquFrockTestRecordDao;
+import com.rongwei.bscommon.sys.service.EquFrockTestRecordService;
+import com.rongwei.bscommon.sys.utils.CommonUtils;
+import com.rongwei.bscommon.sys.utils.DateUtils;
+import com.rongwei.bscommon.sys.utils.ExcelUtils;
+import com.rongwei.bscommon.sys.utils.StringUtil;
+import com.rongwei.bsentity.domain.EquFrockListDo;
+import com.rongwei.bsentity.domain.EquFrockTestRecordDo;
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommon.utils.SecurityUtil;
+import com.rongwei.rwcommon.utils.StringUtils;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class EquFrockTestRecordServiceImpl extends ServiceImpl<EquFrockTestRecordDao, EquFrockTestRecordDo> implements EquFrockTestRecordService {
+
+    @Autowired
+    private EquFrockTestRecordDao equFrockTestRecordDao;
+
+    @Autowired
+    private EquFrockTestRecordService equFrockTestRecordService;
+
+    @Override
+    @Transactional
+    public R importEquFrockTestRecord(MultipartFile file) {
+        StringBuilder allStrBuilder = new StringBuilder();
+        List<EquFrockTestRecordDo> equFrockTestRecordDos = new ArrayList<>();
+        try {
+            Sheet sheet = new XSSFWorkbook(file.getInputStream()).getSheetAt(0);
+            int lastRowNum = sheet.getLastRowNum();
+
+            //获取系统所有的工装编号
+            List<EquFrockListDo> equFrockListDoList = equFrockTestRecordDao.getAllFrocknum();
+
+            //获取已检测的工装编号
+            List<EquFrockTestRecordDo> equFrockTestRecordDoList = equFrockTestRecordDao.getFrockRecord();
+
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            SysUserVo currentUser = CommonUtils.getCurrentUser();
+            Date date = new Date();
+
+            for (int i = 2; i <= lastRowNum; i++) {
+                StringBuilder stringBuilder = new StringBuilder();
+                EquFrockTestRecordDo equFrockTestRecordDo = new EquFrockTestRecordDo();
+                Row row = sheet.getRow(i);
+                if (ExcelUtils.isRowEmpty(row)) {
+                    continue;
+                }
+                String ownedfactory = row.getCell(1) == null ? "" : row.getCell(1).toString().trim();
+                String frockname = row.getCell(2) == null ? "" : row.getCell(2).toString().trim();
+                String usedept = row.getCell(3) == null ? "" : row.getCell(3).toString().trim();
+                String frocknum = row.getCell(4) == null ? "" : row.getCell(4).toString().trim();
+                String belongequname = row.getCell(5) == null ? "" : row.getCell(5).toString().trim();
+                String exctestdate = row.getCell(6) == null ? "" : String.valueOf(DateUtils.importExcelFormatExcel((XSSFCell) row.getCell(6)));
+                String diameter = row.getCell(7) == null ? "" : row.getCell(7).toString().trim();
+                String hs1 = row.getCell(8) == null ? "" : row.getCell(8).toString().trim();
+                String hs2 = row.getCell(9) == null ? "" : row.getCell(9).toString().trim();
+                String hs3 = row.getCell(10) == null ? "" : row.getCell(10).toString().trim();
+                String hs4 = row.getCell(11) == null ? "" : row.getCell(11).toString().trim();
+                String hs5 = row.getCell(12) == null ? "" : row.getCell(12).toString().trim();
+                String hs6 = row.getCell(13) == null ? "" : row.getCell(13).toString().trim();
+                String hs7 = row.getCell(14) == null ? "" : row.getCell(14).toString().trim();
+                String hs8 = row.getCell(15) == null ? "" : row.getCell(15).toString().trim();
+                String hs9 = row.getCell(16) == null ? "" : row.getCell(16).toString().trim();
+                String state = row.getCell(17) == null ? "" : row.getCell(17).toString().trim();
+                String remark = row.getCell(18) == null ? "" : row.getCell(18).toString().trim();
+                if (StringUtils.isBlank(ownedfactory)) {
+                    stringBuilder.append("所属工厂不能为空 ");
+                }
+                if (StringUtils.isBlank(frockname)) {
+                    stringBuilder.append("工装名称不能为空 ");
+                }
+                if (StringUtils.isBlank(usedept)) {
+                    stringBuilder.append("使用车间不能为空 ");
+                }
+                String testdate = "";
+                if (StringUtils.isBlank(exctestdate)) {
+                    stringBuilder.append("检定日期不能为空 ");
+                } else {
+                    testdate = dateFormat.format(DateUtils.importExcelFormatExcel((XSSFCell) row.getCell(6))).split(" ")[0];
+                }
+                if (StringUtils.isBlank(frocknum)) {
+                    stringBuilder.append("工装编号不能为空 ");
+                } else {
+                    if (equFrockListDoList.stream().anyMatch(item -> item.getFrocknum().equals(frocknum))) {
+                        if (equFrockTestRecordDoList.stream().anyMatch(item -> item.getFrocknum().equals(frocknum) && item.getTestdate().toString().equals(exctestdate))) {
+                            stringBuilder.append(frockname + "(" + frocknum + ")已存在" + testdate + "的检测记录,不可重复导入 ");
+                        }
+                    } else {
+                        stringBuilder.append("工装编号" + frocknum + "在系统中不存在 ");
+                    }
+                }
+                if (StringUtils.isBlank(belongequname)) {
+                    stringBuilder.append("工装所属不能为空 ");
+                }
+                if (StringUtils.isBlank(state)) {
+                    stringBuilder.append("状态不能为空 ");
+                }
+                if (StringUtils.isNotBlank(diameter)) {
+                    diameter = StringUtil.formatDecimal(diameter);
+                } else {
+                    stringBuilder.append("直径mm不能为空 ");
+                }
+                if (StringUtils.isNotBlank(hs1)) {
+                    hs1 = StringUtil.formatDecimal(hs1);
+                } else {
+                    stringBuilder.append("检测硬度值(HS1)不能为空 ");
+                }
+                if (StringUtils.isNotBlank(hs2)) {
+                    hs2 = StringUtil.formatDecimal(hs2);
+                } else {
+                    stringBuilder.append("检测硬度值(HS2)不能为空 ");
+                }
+                if (StringUtils.isNotBlank(hs3)) {
+                    hs3 = StringUtil.formatDecimal(hs3);
+                } else {
+                    stringBuilder.append("检测硬度值(HS3)不能为空 ");
+                }
+                if (StringUtils.isNotBlank(hs4)) {
+                    hs4 = StringUtil.formatDecimal(hs4);
+                } else {
+                    stringBuilder.append("检测硬度值(HS4)不能为空 ");
+                }
+                if (StringUtils.isNotBlank(hs5)) {
+                    hs5 = StringUtil.formatDecimal(hs5);
+                } else {
+                    stringBuilder.append("检测硬度值(HS5)不能为空 ");
+                }
+                if (StringUtils.isNotBlank(hs6)) {
+                    hs6 = StringUtil.formatDecimal(hs6);
+                } else {
+                    stringBuilder.append("检测硬度值(HS6)不能为空 ");
+                }
+                if (StringUtils.isNotBlank(hs7)) {
+                    hs7 = StringUtil.formatDecimal(hs7);
+                } else {
+                    stringBuilder.append("检测硬度值(HS7)不能为空 ");
+                }
+                if (StringUtils.isNotBlank(hs8)) {
+                    hs8 = StringUtil.formatDecimal(hs8);
+                } else {
+                    stringBuilder.append("检测硬度值(HS8)不能为空 ");
+                }
+                if (StringUtils.isNotBlank(hs9)) {
+                    hs9 = StringUtil.formatDecimal(hs9);
+                } else {
+                    stringBuilder.append("检测硬度值(HS9)不能为空 ");
+                }
+                if (equFrockTestRecordDos.stream().anyMatch(item -> item.getFrocknum().equals(frocknum) && item.getTestdate().toString().equals(exctestdate))) {
+                    stringBuilder.append("工装编号" + frocknum + "、检定日期" + testdate + "数据重复");
+                }
+
+                if (StringUtil.isNotBlank(stringBuilder)) {
+                    allStrBuilder.append("第").append(i + 1).append("行").append(stringBuilder).append("<br>");
+                } else {
+                    equFrockTestRecordDo.setId(SecurityUtil.getUUID())
+                            .setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1])
+                            .setCreatedate(date)
+                            .setModifydate(date)
+                            .setCreateusername(currentUser.getName())
+                            .setCreateuserid(currentUser.getId())
+                            .setModifyusername(currentUser.getName())
+                            .setModifyuserid(currentUser.getId())
+                            .setOwnedfactory(ownedfactory)
+                            .setFrockname(frockname)
+                            .setUsedept(usedept)
+                            .setFrocknum(frocknum)
+                            .setBelongequname(belongequname)
+                            .setTestdate(dateFormat.parse(testdate + " 00:00:00"))
+                            .setDiameter(new BigDecimal(diameter))
+                            .setHs1(BigDecimal.valueOf(Double.parseDouble(hs1)))
+                            .setHs2(BigDecimal.valueOf(Double.parseDouble(hs2)))
+                            .setHs3(BigDecimal.valueOf(Double.parseDouble(hs3)))
+                            .setHs4(BigDecimal.valueOf(Double.parseDouble(hs4)))
+                            .setHs5(BigDecimal.valueOf(Double.parseDouble(hs5)))
+                            .setHs6(BigDecimal.valueOf(Double.parseDouble(hs6)))
+                            .setHs7(BigDecimal.valueOf(Double.parseDouble(hs7)))
+                            .setHs8(BigDecimal.valueOf(Double.parseDouble(hs8)))
+                            .setHs9(BigDecimal.valueOf(Double.parseDouble(hs9)))
+                            .setState(state)
+                            .setRemark(remark);
+                    equFrockTestRecordDos.add(equFrockTestRecordDo);
+                }
+            }
+        } catch (IOException | ParseException e) {
+            e.printStackTrace();
+        }
+
+        String errMsg = allStrBuilder.toString();
+        if (StringUtils.isNotBlank(errMsg)) {
+            return R.error(errMsg);
+        } else {
+            if (equFrockTestRecordDos.size() > 0) {
+                if (equFrockTestRecordService.saveOrUpdateBatch(equFrockTestRecordDos)) {
+                    return R.ok();
+                } else {
+                    return R.error("上传失败");
+                }
+            } else {
+                return R.ok("没有可上传的数据");
+            }
+        }
+    }
+}

+ 4 - 4
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/MaintenanceServiceImpl.java

@@ -420,7 +420,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
             SysSerialVo sysSerialVo = new SysSerialVo();
             sysSerialVo.setModulecode("equ_maintenance_standard_aq_code_BC");
             sysSerialVo.setResetrule("date:yyyy");
-            sysSerialVo.setRuleTemplateStr(PlantEnum.addrOf(currentUser.getTenantid())+"-"+maintenanceSchedule.getPlantype()+"-@{date:yyyyMM}@{serialNumber:#00000}");
+            sysSerialVo.setRuleTemplateStr(PlantEnum.addrOf(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1])+"-"+maintenanceSchedule.getPlantype()+"-@{date:yyyyMM}@{serialNumber:#00000}");
             R serialNumberCode = rwAdminFeign.getSerialNumberCode(sysSerialVo);
             EquMaintenanceTaskDo equMaintenanceTask = new EquMaintenanceTaskDo();
             BeanUtils.copyProperties( maintenanceSchedule,equMaintenanceTask);
@@ -433,7 +433,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
                     .setModifyuserid(currentUser.getId())
                     .setModifyusername(currentUser.getName())
                     .setModifydate(newDate)
-                    .setTenantid(currentUser.getTenantid());
+                    .setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1]);
             if ("200".equals(serialNumberCode.getCode())){
 
                 Object data = serialNumberCode.getData();
@@ -476,8 +476,8 @@ public class MaintenanceServiceImpl implements MaintenanceService {
                             .setCreatedate(newDate)
                             .setModifyuserid(currentUser.getId())
                             .setModifyusername(currentUser.getName())
-                            .setModifydate(newDate);
-                    // .setTenantid(currentUser.getTenantid());
+                            .setModifydate(newDate)
+                    .setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1]);
                     return equPartsSetoutTaskDo;
                 }).collect(Collectors.toList())).flatMap(Collection::stream).distinct().collect(Collectors.toList());
     }

+ 124 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/utils/DateUtils.java

@@ -0,0 +1,124 @@
+package com.rongwei.bscommon.sys.utils;
+
+import com.rongwei.commonservice.serial.service.SysSerialNumberService;
+import com.rongwei.commonservice.service.RedisService;
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
+import org.apache.commons.lang.StringUtils;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Utils class
+ * 工具类
+ *
+ * @author XH
+ * @date 2021/05/27
+ */
+@Component
+public class DateUtils {
+
+    @Autowired
+    private RedisService autoRedisService;
+    @Autowired
+    private SysSerialNumberService autoSysSerialNumberService;
+
+    private static RedisService redisService;
+    private static SysSerialNumberService sysSerialNumberService;
+
+
+    /**
+     * 时间格式
+     */
+    public static class DatePattern {
+        public static final String DATE_PATTERN_YMD_HOUR = "yyyy/MM/dd HH";
+    }
+
+    private static final Logger log = LoggerFactory.getLogger(DateUtils.class.getName());
+    private static final Pattern STR_IS_DATE_LAYOUT_PATTERN = Pattern.compile("^(?:(?!0000)[0-9]{4}([-/.年]?)(?:(?:0?[1-9]|1[0-2])([-/.月]?)(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])([-/.月]?)(?:29|30)([日]?)|(?:0?[13578]|1[02])([-/.月]?)31)([日]?)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.月]?)0?2([-/.月]?)29([日]?))$");
+    /**
+     * excel 导入时间格式类型
+     */
+    private static final List<String> IMPORT_EXCEL_DATE_FORMAT_TYPE = new ArrayList<String>() {{
+        add(DatePattern.DATE_PATTERN_YMD_HOUR);
+    }};
+
+    /**
+     * 获取当前的登陆人信息
+     *
+     * @return
+     */
+    public static SysUserVo getCurrentUser() {
+        // 获取当前登录人信息
+        SysUserVo currUser = null;
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        if (attributes != null) {
+            HttpServletRequest request = attributes.getRequest();
+            if (request != null) {
+                String token = request.getHeader("token");
+                if (com.rongwei.rwcommon.utils.StringUtils.isNotEmpty(token)) {
+                    currUser = redisService.getLoginUser(token);
+                }
+            }
+        }
+        return currUser;
+    }
+
+
+    /**
+     * 校验字符串是否为 日期格式
+     *
+     * @param str
+     * @return
+     */
+    public static boolean strIsDateLayout(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        Matcher matcher = STR_IS_DATE_LAYOUT_PATTERN.matcher(str);
+        if (matcher.matches()) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public static Date importExcelFormatExcel(XSSFCell objValue) {
+        if (objValue == null) {
+            return null;
+        }
+        if (StringUtils.isBlank(objValue.toString())) {
+            return null;
+        }
+        try {
+            return objValue.getDateCellValue();
+        } catch (Exception e) {
+            log.debug("当前单元格不是时间格式");
+        }
+        AtomicReference<Date> date = new AtomicReference<>();
+        IMPORT_EXCEL_DATE_FORMAT_TYPE.forEach(format -> {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format, Locale.ENGLISH);
+            try {
+                date.set(simpleDateFormat.parse(objValue.toString()));
+            } catch (ParseException e) {
+                log.error("excel解析时 时间格式化出现异常!时间格式:{},日期:{}", format, objValue);
+            }
+        });
+        return date.get();
+    }
+}

+ 209 - 0
cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquFrockListDo.java

@@ -0,0 +1,209 @@
+package com.rongwei.bsentity.domain;
+
+import lombok.NoArgsConstructor;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author  cyn
+ * @create 2023-12-13 14:01
+ */
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class EquFrockListDo {
+
+    /**
+     * table name:ID
+     * table type:varchar(36)
+     * table comment:主键ID
+     */
+    private String id;
+
+    /**
+     * table name:TENANTID
+     * table type:varchar(36)
+     * table comment:租户ID
+     */
+    private String tenantid;
+
+    /**
+     * table name:ROPTION
+     * table type:text
+     * table comment:扩展json格式配置
+     */
+    private String roption;
+
+    /**
+     * table name:DELETED
+     * table type:varchar(1)
+     * table comment:是否删除Y/N
+     */
+    private String deleted;
+
+    /**
+     * table name:REMARK
+     * table type:varchar(2000)
+     * table comment:备注
+     */
+    private String remark;
+
+    /**
+     * table name:CREATEDATE
+     * table type:datetime
+     * table comment:创建时间
+     */
+    private Date createdate;
+
+    /**
+     * table name:CREATEUSERID
+     * table type:varchar(36)
+     * table comment:创建用户ID
+     */
+    private String createuserid;
+
+    /**
+     * table name:MODIFYDATE
+     * table type:datetime
+     * table comment:修改日期
+     */
+    private Date modifydate;
+
+    /**
+     * table name:MODIFYUSERID
+     * table type:varchar(36)
+     * table comment:修改用户ID
+     */
+    private String modifyuserid;
+
+    /**
+     * table name:CREATEUSERNAME
+     * table type:varchar(20)
+     * table comment:创建人
+     */
+    private String createusername;
+
+    /**
+     * table name:MODIFYUSERNAME
+     * table type:varchar(20)
+     * table comment:修改人
+     */
+    private String modifyusername;
+
+    /**
+     * table name:OWNEDFACTORY
+     * table type:varchar(255)
+     * table comment:所属工厂
+     */
+    private String ownedfactory;
+
+    /**
+     * table name:FROCKNAME
+     * table type:varchar(255)
+     * table comment:工装名称
+     */
+    private String frockname;
+
+    /**
+     * table name:SPEC
+     * table type:varchar(255)
+     * table comment:规格型号
+     */
+    private String spec;
+
+    /**
+     * table name:FROCKNUM
+     * table type:varchar(255)
+     * table comment:工装编号
+     */
+    private String frocknum;
+
+    /**
+     * table name:NUMBER
+     * table type:decimal(18,2)
+     * table comment:数量
+     */
+    private BigDecimal number;
+
+    /**
+     * table name:RECEIVE
+     * table type:datetime
+     * table comment:工装接收日期
+     */
+    private Date receive;
+
+    /**
+     * table name:BELONGEQUID
+     * table type:varchar(36)
+     * table comment:工装所属设备ID
+     */
+    private String belongequid;
+
+    /**
+     * table name:BELONGEQUNUM
+     * table type:varchar(255)
+     * table comment:所属设备编号
+     */
+    private String belongequnum;
+
+    /**
+     * table name:BELONGEQUNAME
+     * table type:varchar(255)
+     * table comment:所属设备名称
+     */
+    private String belongequname;
+
+    /**
+     * table name:MANUFACTURER
+     * table type:varchar(255)
+     * table comment:生产厂家
+     */
+    private String manufacturer;
+
+    /**
+     * table name:USESTATE
+     * table type:varchar(20)
+     * table comment:使用状态
+     */
+    private String usestate;
+
+    /**
+     * table name:EXPECTOBSOLEDATE
+     * table type:datetime
+     * table comment:预计报废时间
+     */
+    private Date expectobsoledate;
+
+    /**
+     * table name:FACTOBSOLEDATE
+     * table type:datetime
+     * table comment:实际报废时间
+     */
+    private Date factobsoledate;
+
+    /**
+     * table name:INSPECTID
+     * table type:varchar(36)
+     * table comment:验收表ID
+     */
+    private String inspectid;
+
+    /**
+     * table name:USEDEPTID
+     * table type:varchar(36)
+     * table comment:使用部门车间id
+     */
+    private String usedeptid;
+
+    /**
+     * table name:USEDEPTNAME
+     * table type:varchar(255)
+     * table comment:使用部门车间名称
+     */
+    private String usedeptname;
+
+}

+ 257 - 0
cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquFrockTestRecordDo.java

@@ -0,0 +1,257 @@
+package com.rongwei.bsentity.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.NoArgsConstructor;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author  cyn 
+ * @create 2023-12-11 10:38 
+ */
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("equ_frock_test_record")
+public class EquFrockTestRecordDo implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * table name:ID
+	 * table type:varchar(36)
+	 * table comment:主键ID
+	 */
+	private String id;
+
+	/**
+	 * table name:TENANTID
+	 * table type:varchar(36)
+	 * table comment:租户ID
+	 */
+	private String tenantid;
+
+	/**
+	 * table name:ROPTION
+	 * table type:text
+	 * table comment:扩展json格式配置
+	 */
+	private String roption;
+
+	/**
+	 * table name:DELETED
+	 * table type:varchar(1)
+	 * table comment:是否删除Y/N
+	 */
+	private String deleted;
+
+	/**
+	 * table name:REMARK
+	 * table type:varchar(2000)
+	 * table comment:备注
+	 */
+	private String remark;
+
+	/**
+	 * table name:CREATEDATE
+	 * table type:datetime
+	 * table comment:创建时间
+	 */
+	private Date createdate;
+
+	/**
+	 * table name:CREATEUSERID
+	 * table type:varchar(36)
+	 * table comment:创建用户ID
+	 */
+	private String createuserid;
+
+	/**
+	 * table name:MODIFYDATE
+	 * table type:datetime
+	 * table comment:修改日期
+	 */
+	private Date modifydate;
+
+	/**
+	 * table name:MODIFYUSERID
+	 * table type:varchar(36)
+	 * table comment:修改用户ID
+	 */
+	private String modifyuserid;
+
+	/**
+	 * table name:CREATEUSERNAME
+	 * table type:varchar(20)
+	 * table comment:创建人
+	 */
+	private String createusername;
+
+	/**
+	 * table name:MODIFYUSERNAME
+	 * table type:varchar(20)
+	 * table comment:修改人
+	 */
+	private String modifyusername;
+
+	/**
+	 * table name:OWNEDFACTORYID
+	 * table type:varchar(36)
+	 * table comment:所属工厂ID
+	 */
+	private String ownedfactoryid;
+
+	/**
+	 * table name:OWNEDFACTORY
+	 * table type:varchar(255)
+	 * table comment:所属工厂
+	 */
+	private String ownedfactory;
+
+	/**
+	 * table name:FROCKID
+	 * table type:varchar(36)
+	 * table comment:工装ID
+	 */
+	private String frockid;
+
+	/**
+	 * table name:FROCKNAME
+	 * table type:varchar(255)
+	 * table comment:工装名称
+	 */
+	private String frockname;
+
+	/**
+	 * table name:FROCKNUM
+	 * table type:varchar(255)
+	 * table comment:工装编号
+	 */
+	private String frocknum;
+
+	/**
+	 * table name:USEDEPTID
+	 * table type:varchar(255)
+	 * table comment:使用部门ID
+	 */
+	private String usedeptid;
+
+	/**
+	 * table name:USEDEPT
+	 * table type:varchar(255)
+	 * table comment:使用部门
+	 */
+	private String usedept;
+
+	/**
+	 * table name:BELONGEQUID
+	 * table type:varchar(36)
+	 * table comment:工装所属设备ID
+	 */
+	private String belongequid;
+
+	/**
+	 * table name:BELONGEQUNAME
+	 * table type:varchar(255)
+	 * table comment:工装所属设备名称
+	 */
+	private String belongequname;
+
+	/**
+	 * table name:TESTDATE
+	 * table type:datetime
+	 * table comment:检定日期
+	 */
+	private Date testdate;
+
+	/**
+	 * table name:DIAMETER
+	 * table type:decimal(18,6)
+	 * table comment:直径mm
+	 */
+	private BigDecimal diameter;
+
+	/**
+	 * table name:STATE
+	 * table type:varchar(20)
+	 * table comment:状态
+	 */
+	private String state;
+
+	/**
+	 * table name:FACTOBSOLEDATE
+	 * table type:datetime
+	 * table comment:实际报废时间
+	 */
+	private Date factobsoledate;
+
+	/**
+	 * table name:HS1
+	 * table type:decimal(18,6)
+	 * table comment:检测硬度值(HS1)
+	 */
+	private BigDecimal hs1;
+
+	/**
+	 * table name:HS2
+	 * table type:decimal(18,6)
+	 * table comment:检测硬度值(HS2)
+	 */
+	private BigDecimal hs2;
+
+	/**
+	 * table name:HS3
+	 * table type:decimal(18,6)
+	 * table comment:检测硬度值(HS3)
+	 */
+	private BigDecimal hs3;
+
+	/**
+	 * table name:HS4
+	 * table type:decimal(18,6)
+	 * table comment:检测硬度值(HS4)
+	 */
+	private BigDecimal hs4;
+
+	/**
+	 * table name:HS5
+	 * table type:decimal(18,6)
+	 * table comment:检测硬度值(HS5)
+	 */
+	private BigDecimal hs5;
+
+	/**
+	 * table name:HS6
+	 * table type:decimal(18,6)
+	 * table comment:检测硬度值(HS6)
+	 */
+	private BigDecimal hs6;
+
+	/**
+	 * table name:HS7
+	 * table type:decimal(18,6)
+	 * table comment:检测硬度值(HS7)
+	 */
+	private BigDecimal hs7;
+
+	/**
+	 * table name:HS8
+	 * table type:decimal(18,6)
+	 * table comment:检测硬度值(HS8)
+	 */
+	private BigDecimal hs8;
+
+	/**
+	 * table name:HS9
+	 * table type:decimal(18,6)
+	 * table comment:检测硬度值(HS9)
+	 */
+	private BigDecimal hs9;
+
+}

+ 38 - 0
cx-equipment/cx-equipment-server/src/main/java/com/rongwei/bsserver/sys/controller/EquFrockTestRecordController.java

@@ -0,0 +1,38 @@
+package com.rongwei.bsserver.sys.controller;
+
+import com.rongwei.bscommon.sys.service.EquFrockTestRecordService;
+import com.rongwei.bscommon.sys.utils.FileCheckUtil;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommon.utils.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+
+@RestController
+@RequestMapping("/equFrockTestRecord")
+public class EquFrockTestRecordController {
+
+    @Autowired
+    private EquFrockTestRecordService equFrockTestRecordService;
+
+    @Autowired
+    FileCheckUtil checkUtil;
+
+    @RequestMapping("/importEquFrockTestRecord")
+    @ResponseBody
+    public R importEquFrockTestRecord(@RequestParam MultipartFile file, HttpServletRequest request) throws Exception {
+        if (file == null){
+            return R.error("文件解析失败");
+        }
+        String errorMsg = checkUtil.fileCheckDetail(file,"d55d1e0878874b179a1a8dbbcd507f18");
+        if (StringUtils.isNotBlank(errorMsg)){
+            return R.error(errorMsg);
+        }
+        return equFrockTestRecordService.importEquFrockTestRecord(file);
+    }
+}