Kaynağa Gözat

导出 导入

Min 1 yıl önce
ebeveyn
işleme
bbb7eab459
15 değiştirilmiş dosya ile 546 ekleme ve 151 silme
  1. 2 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/PlanController.java
  2. 21 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/TaskTypeController.java
  3. 27 11
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Plan.java
  4. 0 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanMaterial.java
  5. 45 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/TaskType.java
  6. 16 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/TaskTypeMapper.java
  7. 1 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/PlanService.java
  8. 16 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/TaskTypeService.java
  9. 310 103
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java
  10. 20 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/TaskTypeServiceImpl.java
  11. 0 25
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  12. 5 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/PlanMapper.xml
  13. 17 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/TaskTypeMapper.xml
  14. 62 2
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue
  15. 4 3
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponentDetil.vue

+ 2 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/PlanController.java

@@ -73,8 +73,8 @@ public class PlanController {
     }
 
     @RequestMapping("/exportData")
-    public HttpRespMsg exportData(String date,Integer planType){
-        return planService.exportData(date,planType);
+    public HttpRespMsg exportData(String date,Integer planType,String steelStampNumber){
+        return planService.exportData(date,planType,steelStampNumber);
     }
 
 }

+ 21 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/TaskTypeController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2023-07-27
+ */
+@RestController
+@RequestMapping("/task-type")
+public class TaskTypeController {
+
+}
+

+ 27 - 11
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Plan.java

@@ -20,7 +20,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2023-07-25
+ * @since 2023-07-27
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -111,19 +111,11 @@ public class Plan extends Model<Plan> {
     private String foremanName;
 
     /**
-     * 计划类型 0-今日计划 1-明日计划 2-插单计划
+     * 计划类型 0-普通计划 1-插单计划
      */
     @TableField("plan_type")
     private Integer planType;
 
-    /**
-     * 计划日期
-     */
-    @TableField("plan_date")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    @JsonFormat( pattern="yyyy-MM-dd")
-    private LocalDate planDate;
-
     /**
      * 开工时间
      */
@@ -152,12 +144,30 @@ public class Plan extends Model<Plan> {
     @TableField("task_type_id")
     private Integer taskTypeId;
 
+    /**
+     * 任务类型名称
+     */
+    @TableField("task_type_name")
+    private String taskTypeName;
+
+    /**
+     * 质检类型:0-自检,1-互检,2-专检
+     */
+    @TableField("check_type")
+    private Integer checkType;
+
     /**
      * 任务变更通知号
      */
     @TableField("task_change_notice_num")
     private String taskChangeNoticeNum;
 
+    /**
+     * 计划人数
+     */
+    @TableField("plan_man_num")
+    private Integer planManNum;
+
     /**
      * 计划工时
      */
@@ -165,7 +175,7 @@ public class Plan extends Model<Plan> {
     private Double planWorkHour;
 
     /**
-     * 工钱
+     * 单价
      */
     @TableField("money_of_job")
     private BigDecimal moneyOfJob;
@@ -176,6 +186,12 @@ public class Plan extends Model<Plan> {
     @TableField("describtion")
     private String describtion;
 
+    /**
+     * 版本号
+     */
+    @TableField("version_number")
+    private String versionNumber;
+
 
     @Override
     protected Serializable pkVal() {

+ 0 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/PlanMaterial.java

@@ -103,8 +103,6 @@ public class PlanMaterial extends Model<PlanMaterial> {
     @TableField(exist = false)
     private ProdMaterial prodMaterial;
 
-    @TableField("material_id")
-    private Integer prodMaterialId;
     @Override
     protected Serializable pkVal() {
         return this.planId;

+ 45 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/TaskType.java

@@ -0,0 +1,45 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2023-07-27
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class TaskType extends Model<TaskType> {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 任务类型名称
+     */
+    @TableField("task_type_name")
+    private String taskTypeName;
+
+    @TableField("company_id")
+    private Integer companyId;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/TaskTypeMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.TaskType;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2023-07-27
+ */
+public interface TaskTypeMapper extends BaseMapper<TaskType> {
+
+}

+ 1 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/PlanService.java

@@ -23,7 +23,7 @@ public interface PlanService extends IService<Plan> {
 
     HttpRespMsg importData(MultipartFile multipartFile, Integer planType);
 
-    HttpRespMsg exportData(String date, Integer planType);
+    HttpRespMsg exportData(String date, Integer planType,String steelStampNumber);
 
     HttpRespMsg deptSet(String deptIds);
 

+ 16 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/TaskTypeService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.TaskType;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2023-07-27
+ */
+public interface TaskTypeService extends IService<TaskType> {
+
+}

+ 310 - 103
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java

@@ -22,6 +22,7 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
@@ -55,6 +56,8 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
     @Resource
     private PlanMapper planMapper;
     @Resource
+    private CompanyMapper companyMapper;
+    @Resource
     private WxCorpInfoService wxCorpInfoService;
     @Resource
     private HttpServletRequest request;
@@ -74,28 +77,35 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
     private ProductMapper productMapper;
     @Resource
     private PlanMaterialMapper planMaterialMapper;
+    @Resource
+    private TaskTypeMapper taskTypeMapper;
+
+    @Value(value = "${upload.path}")
+    private String path;
 
     @Override
     public HttpRespMsg getList(String date, String steelStampNumber, Integer planType,Integer deptId,Integer pageIndex,Integer pageSize) {
         HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         QueryWrapper<Plan> queryWrapper=new QueryWrapper();
         DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
-        if(planType==0){
-            queryWrapper.eq("start_date",LocalDate.now());
-        }else if(planType==1){
-            queryWrapper.eq("start_date",LocalDate.now().plusDays(1));
+        queryWrapper.eq("company_id",companyId);
+        if(planType!=2){
+            queryWrapper.eq("plan_type",0);
         }else {
-            queryWrapper.eq("plan_type",planType);
+            queryWrapper.eq("plan_type",1);
         }
         if(planType!=2){
             queryWrapper.eq("station_id",deptId);
         }
         if(!StringUtils.isEmpty(date)){
             LocalDate parse = LocalDate.parse(date,df);
-            queryWrapper.eq("plan_date",parse);
+            queryWrapper.eq("start_date",parse);
         }else {
-            LocalDate now = LocalDate.now();
-            queryWrapper.eq("plan_date",planType==0?now:now.plusDays(1));
+            if(planType!=2){
+                LocalDate now = LocalDate.now();
+                queryWrapper.eq("start_date",planType==0?now:now.plusDays(1));
+            }
         }
         if(!StringUtils.isEmpty(steelStampNumber)){
             queryWrapper.gt("steel_stamp_number_start",steelStampNumber);
@@ -121,25 +131,37 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
         if(plan.getProductId()!=null){
                 Product product = productMapper.selectById(plan.getProductId());
                 plan.setProductName(product.getName());
-            }
+        }
         if(plan.getId()==null){
-            if(count(new QueryWrapper<Plan>().eq("product_scheduling_num",plan.getProductSchedulingNum()))>0){
-                msg.setError("当前排产工单号已存在");
-                return msg;
+            if(plan.getProductSchedulingNum()!=null){
+                if(count(new QueryWrapper<Plan>().eq("product_scheduling_num",plan.getProductSchedulingNum()))>0){
+                    msg.setError("当前排产工单号已存在");
+                    return msg;
+                }
             }
             switch (plan.getPlanType()){
                 case 0:
-                    plan.setPlanDate(LocalDate.now());
+                    plan.setStartDate(LocalDate.now());
                     break;
                 case 1:
-                    plan.setPlanDate(LocalDate.now().plusDays(1));
+                    plan.setStartDate(LocalDate.now().plusDays(1));
                     break;
             }
+            if(plan.getPlanType()!=2){
+                plan.setPlanType(0);
+            }else {
+                plan.setPlanType(1);
+            }
             if(planMapper.insert(plan)<0){
                 msg.setError("验证失败");
                 return msg;
             }
         }else {
+            if(plan.getPlanType()!=2){
+                plan.setPlanType(0);
+            }else {
+                plan.setPlanType(1);
+            }
             if(planMapper.updateById(plan)<0){
                 msg.setError("验证失败");
                 return msg;
@@ -184,6 +206,7 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
     public HttpRespMsg importData(MultipartFile multipartFile, Integer planType) {
         HttpRespMsg msg=new HttpRespMsg();
         DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
         String fileName = multipartFile.getOriginalFilename();
         File file = new File(fileName == null ? "file" : fileName);
         InputStream inputStream = null;
@@ -218,91 +241,187 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
                 if (ExcelUtil.isRowEmpty(row)) {
                     continue;
                 }
-                //部门 排产工单号 产品名称 钢印号 数量 主工序 工位 开工时间 完工时间 描述
-                XSSFCell deptCell = row.getCell(0);
-                XSSFCell productSchedulingNumCell = row.getCell(1);
-                XSSFCell productNameCell = row.getCell(2);
-                XSSFCell steelStampNumberCell = row.getCell(3);
-                XSSFCell numCell = row.getCell(4);
-                XSSFCell mainProcessCell = row.getCell(5);
-                XSSFCell stationNameCell = row.getCell(6);
-                XSSFCell startDateCell = row.getCell(7);
-                XSSFCell endDateCell = row.getCell(8);
-                XSSFCell describtionCell = row.getCell(9);
-
-                if (deptCell != null) deptCell.setCellType(CellType.STRING);
-                if (productSchedulingNumCell != null) productSchedulingNumCell.setCellType(CellType.NUMERIC);
-                if (productNameCell != null) productNameCell.setCellType(CellType.STRING);
-                if (steelStampNumberCell != null) steelStampNumberCell.setCellType(CellType.STRING);
-                if (numCell != null) numCell.setCellType(CellType.NUMERIC);
-                if (mainProcessCell != null) mainProcessCell.setCellType(CellType.STRING);
-                if (stationNameCell != null) stationNameCell.setCellType(CellType.STRING);
-                if (startDateCell != null) startDateCell.setCellType(CellType.NUMERIC);
-                if (endDateCell != null) endDateCell.setCellType(CellType.NUMERIC);
-                if (describtionCell != null) describtionCell.setCellType(CellType.STRING);
                 Plan plan=new Plan();
-                plan.setPlanDate(planType==0?LocalDate.now():LocalDate.now().plusDays(1));
-                if(deptCell!=null){
-                    Optional<Department> first = departmentList.stream().filter(dl -> dl.getDepartmentName().equals(deptCell.getStringCellValue())).findFirst();
-                    if(first.isPresent()){
-                        plan.setStationId(first.get().getDepartmentId());
-                        plan.setStationName(first.get().getDepartmentName());
-                    }else {
-                        msg.setError("部门["+deptCell.getStringCellValue()+"]不存在");
-                        return msg;
+                plan.setCompanyId(companyId);
+                if(planType!=2){
+                    plan.setPlanType(0);
+                    //排产工单号 产品名称 钢印号 数量 主工序 工位 开工时间 完工时间 描述
+                    XSSFCell productSchedulingNumCell = row.getCell(0);
+                    XSSFCell productNameCell = row.getCell(1);
+                    XSSFCell steelStampNumberCell = row.getCell(2);
+                    XSSFCell numCell = row.getCell(3);
+                    XSSFCell mainProcessCell = row.getCell(4);
+                    XSSFCell stationNameCell = row.getCell(5);
+                    XSSFCell startDateCell = row.getCell(6);
+                    XSSFCell endDateCell = row.getCell(7);
+                    XSSFCell describtionCell = row.getCell(8);
+
+                    if (productSchedulingNumCell != null) productSchedulingNumCell.setCellType(CellType.STRING);
+                    if (productNameCell != null) productNameCell.setCellType(CellType.STRING);
+                    if (steelStampNumberCell != null) steelStampNumberCell.setCellType(CellType.STRING);
+                    if (numCell != null) numCell.setCellType(CellType.NUMERIC);
+                    if (mainProcessCell != null) mainProcessCell.setCellType(CellType.STRING);
+                    if (stationNameCell != null) stationNameCell.setCellType(CellType.STRING);
+                    if (startDateCell != null) startDateCell.setCellType(CellType.NUMERIC);
+                    if (endDateCell != null) endDateCell.setCellType(CellType.NUMERIC);
+                    if (describtionCell != null) describtionCell.setCellType(CellType.STRING);
+                    plan.setStartDate(planType==0?LocalDate.now():LocalDate.now().plusDays(1));
+                    if(productSchedulingNumCell!=null){
+                        if(count(new QueryWrapper<Plan>().eq("product_scheduling_num",productSchedulingNumCell.getStringCellValue()))>0){
+                            Optional<Plan> first = needInsertList.stream().filter(nl -> nl.getTaskChangeNoticeNum().equals(productSchedulingNumCell.getStringCellValue())).findFirst();
+                            if(first.isPresent()){
+                                msg.setError("已存在的排产工单号"+productSchedulingNumCell.getStringCellValue());
+                                return msg;
+                            }
+                        }
+                        plan.setProductSchedulingNum(productSchedulingNumCell.getStringCellValue());
                     }
-                }else {
-                    msg.setError("部门不能为空");
-                    return msg;
-                }
-                if(productSchedulingNumCell!=null){
-                    if(count(new QueryWrapper<Plan>().eq("product_scheduling_num",productSchedulingNumCell.getStringCellValue()))>0){
-                        msg.setError("已存在的排产工单号"+productSchedulingNumCell.getStringCellValue());
+                    if(productNameCell!=null){
+                        Optional<Product> first = productList.stream().filter(pl -> pl.getName().equals(productNameCell.getStringCellValue())).findFirst();
+                        if(first.isPresent()){
+                            plan.setProductId(first.get().getId());
+                            plan.setProductName(first.get().getName());
+                        }else {
+                            msg.setError("产品["+productNameCell.getStringCellValue()+"]不存在");
+                            return msg;
+                        }
+                    }
+                    if(steelStampNumberCell!=null){
+                        String value = steelStampNumberCell.getStringCellValue();
+                        String[] split = value.split("-");
+                        if(split.length>1){
+                            plan.setSteelStampNumberStart(split[0]);
+                            plan.setSteelStampNumberEnd(split[1]);
+                        }
+                    }else {
+                        msg.setError("钢印号不能为空");
                         return msg;
                     }
-                    plan.setProductSchedulingNum(productSchedulingNumCell.getStringCellValue());
-                }
-                if(productNameCell!=null){
-                    Optional<Product> first = productList.stream().filter(pl -> pl.getName().equals(productNameCell.getStringCellValue())).findFirst();
-                    if(first.isPresent()){
-                        plan.setProductId(first.get().getId());
-                        plan.setProductName(first.get().getName());
+                    plan.setNum(numCell==null?0:Double.valueOf(numCell.getNumericCellValue()).intValue());
+                    plan.setMainProcess(mainProcessCell==null?"":mainProcessCell.getStringCellValue());
+                    if(stationNameCell!=null){
+                        Optional<Department> first = departmentList.stream().filter(dl -> dl.getDepartmentName().equals(stationNameCell.getStringCellValue())).findFirst();
+                        if(first.isPresent()){
+                            plan.setStationId(first.get().getDepartmentId());
+                            plan.setStationName(first.get().getDepartmentName());
+                            Optional<User> user = userList.stream().filter(ul -> first.get().getManagerId() != null && ul.getId().equals(first.get().getManagerId())).findFirst();
+                            if(user.isPresent()){
+                                plan.setForemanId(user.get().getId());
+                                plan.setForemanName(user.get().getName());
+                            }
+                        }else {
+                            msg.setError("工位["+stationNameCell.getStringCellValue()+"]不存在");
+                            return msg;
+                        }
                     }else {
-                        msg.setError("产品["+productNameCell.getStringCellValue()+"]不存在");
+                        msg.setError("工位不能为空");
                         return msg;
                     }
-                }
-                if(steelStampNumberCell!=null){
-                    String value = steelStampNumberCell.getStringCellValue();
-                    String[] split = value.split("-");
-                    if(split.length>1){
-                        plan.setSteelStampNumberStart(split[0]);
-                        plan.setSteelStampNumberEnd(split[1]);
+                    if(startDateCell!=null){
+                        plan.setStartDate(planType==0?LocalDate.now():LocalDate.now().plusDays(1));
                     }
-                }
-                plan.setNum(numCell==null?0:Integer.valueOf(String.valueOf(numCell.getNumericCellValue())));
-                plan.setMainProcess(mainProcessCell==null?"":mainProcessCell.getStringCellValue());
-                if(stationNameCell!=null){
-                    Optional<Department> first = departmentList.stream().filter(dl -> dl.getDepartmentName().equals(stationNameCell.getStringCellValue())).findFirst();
-                    if(first.isPresent()){
-                        if(!first.get().getSuperiorId().equals(plan.getStationId())){
-                            msg.setError("工位["+stationNameCell.getStringCellValue()+"]不属于部门["+deptCell.getStringCellValue()+"]");
+                    if(endDateCell!=null){
+                        plan.setEndDate(LocalDate.parse(sdf.format(endDateCell.getDateCellValue()),df));
+                    }
+                    plan.setDescribtion(describtionCell==null?"":describtionCell.getStringCellValue());
+                }else {
+                    plan.setPlanType(1);
+                    /*插单计划*/
+                    //任务变更通知号 任务名称 任务类型 计划人数 数量 计划工时 单价 质检类型 工位 开工时间 完工时间 描述
+                    XSSFCell taskChangeNoticeNumCell = row.getCell(0);
+                    XSSFCell taskNameCell = row.getCell(1);
+                    XSSFCell taskTypeNameCell = row.getCell(2);
+                    XSSFCell planManNumCell = row.getCell(3);
+                    XSSFCell numCell = row.getCell(4);
+                    XSSFCell planWorkHourCell = row.getCell(5);
+                    XSSFCell moneyOfJobCell = row.getCell(6);
+                    XSSFCell checkTypeCell = row.getCell(7);
+                    XSSFCell stationNameCell = row.getCell(8);
+                    XSSFCell startDateCell = row.getCell(9);
+                    XSSFCell endDateCell = row.getCell(10);
+                    XSSFCell describtionCell = row.getCell(11);
+
+                    if (taskChangeNoticeNumCell != null) taskChangeNoticeNumCell.setCellType(CellType.STRING);
+                    if (taskNameCell != null) taskNameCell.setCellType(CellType.STRING);
+                    if (taskTypeNameCell != null) taskTypeNameCell.setCellType(CellType.STRING);
+                    if (planManNumCell != null) planManNumCell.setCellType(CellType.NUMERIC);
+                    if (numCell != null) numCell.setCellType(CellType.NUMERIC);
+                    if (planWorkHourCell != null) planWorkHourCell.setCellType(CellType.NUMERIC);
+                    if (moneyOfJobCell != null) moneyOfJobCell.setCellType(CellType.NUMERIC);
+                    if (checkTypeCell != null) checkTypeCell.setCellType(CellType.STRING);
+                    if (stationNameCell != null) stationNameCell.setCellType(CellType.STRING);
+                    if (startDateCell != null) startDateCell.setCellType(CellType.NUMERIC);
+                    if (endDateCell != null) endDateCell.setCellType(CellType.NUMERIC);
+                    if (describtionCell != null) describtionCell.setCellType(CellType.STRING);
+
+                    List<TaskType> taskTypeList = taskTypeMapper.selectList(new QueryWrapper<TaskType>().eq("company_id", companyId));
+
+                    if(taskChangeNoticeNumCell!=null){
+                        if(count(new QueryWrapper<Plan>().eq("product_scheduling_num",taskChangeNoticeNumCell.getStringCellValue()))>0){
+                            Optional<Plan> first = needInsertList.stream().filter(nl -> nl.getTaskChangeNoticeNum().equals(taskChangeNoticeNumCell.getStringCellValue())).findFirst();
+                            if(first.isPresent()){
+                                msg.setError("已存在的任务变更通知号"+taskChangeNoticeNumCell.getStringCellValue());
+                                return msg;
+                            }
+                        }
+                        plan.setTaskChangeNoticeNum(taskChangeNoticeNumCell.getStringCellValue());
+                    }
+                    if(taskNameCell!=null){
+                        plan.setTaskName(taskNameCell.getStringCellValue());
+                    }
+                    if(taskTypeNameCell!=null){
+                        Optional<TaskType> first = taskTypeList.stream().filter(tl -> tl.getTaskTypeName().equals(taskTypeNameCell.getStringCellValue())).findFirst();
+                        if(first.isPresent()){
+                            plan.setTaskTypeId(first.get().getId());
+                            plan.setTaskTypeName(first.get().getTaskTypeName());
+                        }
+                    }
+                    plan.setPlanManNum(planManNumCell==null?0:Double.valueOf(planManNumCell.getNumericCellValue()).intValue());
+                    plan.setNum(numCell==null?0:Double.valueOf(numCell.getNumericCellValue()).intValue());
+                    plan.setPlanWorkHour(numCell==null?0:Double.valueOf(numCell.getNumericCellValue()));
+                    if(moneyOfJobCell!=null){
+                        BigDecimal bigDecimal = new BigDecimal(moneyOfJobCell.getNumericCellValue());
+                        plan.setMoneyOfJob(bigDecimal);
+                    }
+                    if(checkTypeCell!=null){
+                        switch (taskTypeNameCell.getStringCellValue()){
+                            case "自检":
+                                plan.setCheckType(0);
+                                break;
+                            case "互检":
+                                plan.setCheckType(1);
+                                break;
+                            case "专检":
+                                plan.setCheckType(2);
+                                break;
+                        }
+                    }
+                    if(stationNameCell!=null){
+                        Optional<Department> first = departmentList.stream().filter(dl -> dl.getDepartmentName().equals(stationNameCell.getStringCellValue())).findFirst();
+                        if(first.isPresent()){
+                            plan.setStationId(first.get().getDepartmentId());
+                            plan.setStationName(first.get().getDepartmentName());
+                            Optional<User> user = userList.stream().filter(ul -> first.get().getManagerId() != null && ul.getId().equals(first.get().getManagerId())).findFirst();
+                            if(user.isPresent()){
+                                plan.setForemanId(user.get().getId());
+                                plan.setForemanName(user.get().getName());
+                            }
+                        }else {
+                            msg.setError("工位["+stationNameCell.getStringCellValue()+"]不存在");
                             return msg;
                         }
-                        plan.setStationId(first.get().getDepartmentId());
-                        plan.setStationName(first.get().getDepartmentName());
                     }else {
-                        msg.setError("工位["+stationNameCell.getStringCellValue()+"]不存在");
+                        msg.setError("工位不能为空");
                         return msg;
                     }
+                    if(startDateCell!=null){
+                        plan.setStartDate(LocalDate.parse(sdf.format(startDateCell.getDateCellValue()),df));
+                    }
+                    if(endDateCell!=null){
+                        plan.setEndDate(LocalDate.parse(sdf.format(endDateCell.getDateCellValue()),df));
+                    }
+                    plan.setDescribtion(describtionCell==null?"":describtionCell.getStringCellValue());
                 }
-                if(startDateCell!=null){
-                    plan.setStartDate(LocalDate.parse(startDateCell.getDateCellValue().toString(),df));
-                }
-                if(endDateCell!=null){
-                    plan.setEndDate(LocalDate.parse(endDateCell.getDateCellValue().toString(),df));
-                }
-                plan.setDescribtion(describtionCell==null?"":describtionCell.getStringCellValue());
                 needInsertList.add(plan);
             }
             if(needInsertList.size()>0){
@@ -343,12 +462,100 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
 //            file.deleteOnExit();//程序退出时删除临时文件
             System.out.println(file.delete());
         }
-        return null;
+        return msg;
     }
 
     @Override
-    public HttpRespMsg exportData(String date, Integer planType) {
-        return null;
+    public HttpRespMsg exportData(String date, Integer planType,String steelStampNumber) {
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        QueryWrapper<Plan> queryWrapper=new QueryWrapper();
+        DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        queryWrapper.eq("company_id",companyId);
+        if(planType!=2){
+            queryWrapper.eq("plan_type",0);
+        }else {
+            queryWrapper.eq("plan_type",1);
+        }
+        if(!StringUtils.isEmpty(date)){
+            LocalDate parse = LocalDate.parse(date,df);
+            queryWrapper.eq("start_date",parse);
+        }else {
+            if(planType!=2){
+                LocalDate now = LocalDate.now();
+                queryWrapper.eq("start_date",planType==0?now:now.plusDays(1));
+            }
+        }
+        if(!StringUtils.isEmpty(steelStampNumber)){
+            queryWrapper.gt("steel_stamp_number_start",steelStampNumber);
+            queryWrapper.lt("steel_stamp_number_end",steelStampNumber);
+        }
+        List<Plan> planList = planMapper.selectList(queryWrapper);
+        List<String> titleList=new ArrayList<>();
+        if(planType!=2){
+            titleList.add("排产工单号");
+            titleList.add("产品名称");
+            titleList.add("项目代码");
+            titleList.add("钢印号");
+            titleList.add("数量");
+            titleList.add("主工序");
+            titleList.add("工位");
+            titleList.add("工长");
+            titleList.add("开工时间");
+            titleList.add("完工时间");
+            titleList.add("描述");
+        }else {
+            titleList.add("任务变更通知号");
+            titleList.add("任务名称");
+            titleList.add("任务类型");
+            titleList.add("计划人数");
+            titleList.add("数量");
+            titleList.add("计划工时");
+            titleList.add("单价");
+            titleList.add("质检类型");
+            titleList.add("工位");
+            titleList.add("工长");
+            titleList.add("开工时间");
+            titleList.add("完工时间");
+            titleList.add("描述");
+        }
+        List<List<String>> dataList=new ArrayList<>();
+        dataList.add(titleList);
+        for (Plan plan : planList) {
+            List<String> item=new ArrayList<>();
+            if(planType!=2){
+                item.add(plan.getProductSchedulingNum());
+                item.add(plan.getProductName());
+                item.add(plan.getProjectCode());
+                item.add(plan.getSteelStampNumberStart()+"-"+plan.getSteelStampNumberEnd());
+                item.add(String.valueOf(plan.getNum()==null?"":plan.getNum()));
+                item.add(plan.getMainProcess()==null?"":plan.getMainProcess());
+                item.add(plan.getStationName());
+                item.add(plan.getForemanName()==null?"":plan.getForemanName());
+                item.add(df.format(plan.getStartDate()));
+                item.add(df.format(plan.getEndDate()));
+                item.add(plan.getDescribtion()==null?"":plan.getDescribtion());
+            }else {
+                item.add(plan.getTaskChangeNoticeNum());
+                item.add(plan.getTaskName());
+                item.add(plan.getTaskTypeName());
+                item.add(String.valueOf(plan.getPlanManNum()==null?"":plan.getPlanManNum()));
+                item.add(String.valueOf(plan.getNum()==null?"":plan.getNum()));
+                item.add(String.valueOf(plan.getPlanWorkHour()==null?"":plan.getPlanWorkHour()));
+                item.add(String.valueOf(plan.getMoneyOfJob()==null?"":plan.getMoneyOfJob()));
+                item.add(plan.getCheckType()==0?"自检":plan.getCheckType()==1?"互检":plan.getCheckType()==2?"专检":"");
+                item.add(plan.getStationName());
+                item.add(plan.getForemanName());
+                item.add(df.format(plan.getEndDate()));
+                item.add(plan.getDescribtion()==null?"":plan.getDescribtion());
+            }
+            dataList.add(item);
+        }
+        Company company = companyMapper.selectById(companyId);
+        String fileName=(planType==0?"今日计划":planType==1?"明日计划":planType==1?"插单计划":"")+company.getCompanyName()+System.currentTimeMillis();
+        String resp = ExcelUtil.exportGeneralExcelByTitleAndList(fileName, dataList, path);
+        msg.setData(resp);
+        return msg;
     }
 
     @Override
@@ -380,23 +587,23 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
         if(plan!=null){
             switch (type){
                 case 0:
-                    List<ProdProcedure> prodProcedureList = prodProcedureMapper.selectList(new QueryWrapper<ProdProcedure>().eq("product_id", plan.getProductId()));
+                    List<ProdProcedure> prodProcedureList = prodProcedureMapper.selectList(new QueryWrapper<ProdProcedure>().eq("product_id", plan.getProductId()).eq("version_number",plan.getVersionNumber()));
                     msg.setData(prodProcedureList);
                     break;
-                case 1:
-                    Map map=new HashMap();
-                    List<ProdMaterial> prodMaterialList = prodMaterialMapper.selectList(new QueryWrapper<ProdMaterial>().eq("product_id", plan.getProductId()));
-                    List<PlanMaterial> planMaterialList = planMaterialMapper.selectList(new QueryWrapper<PlanMaterial>().eq("plan_id", plan.getId()));
-                    planMaterialList.forEach(pl->{
-                        Optional<ProdMaterial> first = prodMaterialList.stream().filter(pt -> pt.getId().equals(pl.getProdMaterialId())).findFirst();
-                        if(first.isPresent()){
-                            pl.setProdMaterial(first.get());
-                        }else pl.setProdMaterial(new ProdMaterial());
-                    });
-                    map.put("material",prodMaterialList);
-                    map.put("lackMaterial",planMaterialList);
-                    msg.setData(map);
-                    break;
+//                case 1:
+//                    Map map=new HashMap();
+//                    List<ProdMaterial> prodMaterialList = prodMaterialMapper.selectList(new QueryWrapper<ProdMaterial>().eq("product_id", plan.getProductId()));
+//                    List<PlanMaterial> planMaterialList = planMaterialMapper.selectList(new QueryWrapper<PlanMaterial>().eq("plan_id", plan.getId()));
+//                    planMaterialList.forEach(pl->{
+//                        Optional<ProdMaterial> first = prodMaterialList.stream().filter(pt -> pt.getId().equals(pl.getProdMaterialId())).findFirst();
+//                        if(first.isPresent()){
+//                            pl.setProdMaterial(first.get());
+//                        }else pl.setProdMaterial(new ProdMaterial());
+//                    });
+//                    map.put("material",prodMaterialList);
+//                    map.put("lackMaterial",planMaterialList);
+//                    msg.setData(map);
+//                    break;
             }
         }
         return msg;

+ 20 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/TaskTypeServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.TaskType;
+import com.management.platform.mapper.TaskTypeMapper;
+import com.management.platform.service.TaskTypeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2023-07-27
+ */
+@Service
+public class TaskTypeServiceImpl extends ServiceImpl<TaskTypeMapper, TaskType> implements TaskTypeService {
+
+}

+ 0 - 25
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -276,31 +276,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                 } else if (msgType.equals(TEXT_CARD_MSG_REPORT_AGREE)) {
                     title = "日报审核通过";
                 }
-            } else {
-                jumpUrl = jumpUrl.replace("STATE", pageRouter);
-                if ("awayOffice".equals(pageRouter)) {
-                    //出差
-                    title = "出差通知";
-                    if (msgType.equals(TEXT_CARD_MSG_BUSTRIP_WAITING_AUDIT)) {
-                        title = "出差待审核";
-                    } else if (msgType.equals(TEXT_CARD_MSG_BUSTRIP_AGREE)) {
-                        title = "出差审核通过";
-                    } else if (msgType.equals(TEXT_CARD_MSG_BUSTRIP_DENY)) {
-                        title = "出差审核驳回";
-                    }
-                } else if ("expense".equals(pageRouter)) {
-                    //费用报销
-                    title = "费用报销通知";
-                    if (msgType.equals(TEXT_CARD_MSG_EXPENSE_AGREE)) {
-                        title = "费用报销审核通过";
-                    } else if (msgType.equals(TEXT_CARD_MSG_EXPENSE_DENY)) {
-                        title = "费用报销审核驳回";
-                    }
-                }
-                else if ("task".equals(pageRouter)) {
-                    //费用报销
-                    title = "工时管家:任务到期通知";
-                }
             }
             cardJson.put("title", title);
             cardJson.put("description", msg);

+ 5 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/PlanMapper.xml

@@ -19,20 +19,23 @@
         <result column="foreman_id" property="foremanId" />
         <result column="foreman_name" property="foremanName" />
         <result column="plan_type" property="planType" />
-        <result column="plan_date" property="planDate" />
         <result column="start_date" property="startDate" />
         <result column="end_date" property="endDate" />
         <result column="task_name" property="taskName" />
         <result column="task_type_id" property="taskTypeId" />
+        <result column="task_type_name" property="taskTypeName" />
+        <result column="check_type" property="checkType" />
         <result column="task_change_notice_num" property="taskChangeNoticeNum" />
+        <result column="plan_man_num" property="planManNum" />
         <result column="plan_work_hour" property="planWorkHour" />
         <result column="money_of_job" property="moneyOfJob" />
         <result column="describtion" property="describtion" />
+        <result column="version_number" property="versionNumber" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, product_scheduling_num, product_id, product_name, project_code, company_id, steel_stamp_number_start, steel_stamp_number_end, num, main_process, station_id, station_name, foreman_id, foreman_name, plan_type, plan_date, start_date, end_date, task_name, task_type_id, task_change_notice_num, plan_work_hour, money_of_job, describtion
+        id, product_scheduling_num, product_id, product_name, project_code, company_id, steel_stamp_number_start, steel_stamp_number_end, num, main_process, station_id, station_name, foreman_id, foreman_name, plan_type, start_date, end_date, task_name, task_type_id, task_type_name, check_type, task_change_notice_num, plan_man_num, plan_work_hour, money_of_job, describtion, version_number
     </sql>
 
 </mapper>

+ 17 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/TaskTypeMapper.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.management.platform.mapper.TaskTypeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.TaskType">
+        <id column="id" property="id" />
+        <result column="task_type_name" property="taskTypeName" />
+        <result column="company_id" property="companyId" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, task_type_name, company_id
+    </sql>
+
+</mapper>

+ 62 - 2
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue

@@ -41,8 +41,10 @@
               <el-link type="primary" :underline="false" @click="addPlan()">{{
                 `新增${titleText}`
               }}</el-link>
-              <el-link type="primary" :underline="false">{{ "导入" }}</el-link>
-              <el-link type="primary" :underline="false">{{ "导出" }}</el-link>
+              <el-upload ref="upload" action="#" :limit="1" :http-request="importData" :show-file-list="false">
+                    <el-link type="primary" :underline="false">{{ "导入" }}</el-link>
+              </el-upload>
+              <el-link type="primary" :underline="false" @click="exportData()" :download="this.planType==0?'今日计划':this.planType==1?'明日计划':this.planType==1?'插单计划':''+'.xlsx'">{{ "导出" }}</el-link>
             </span>
           </div>
         </div>
@@ -425,6 +427,7 @@ export default {
               message: "设置成功",
               type: "success",
             });
+            this.getHasSetPlanDeptList();
           } else {
             this.$message({
               message: res.msg,
@@ -678,6 +681,63 @@ export default {
         },
       });
     },
+    // 导入数据
+    importData(item){
+        this.tableDataLoading = true;
+        let formData = new FormData();
+        formData.append("file", item.file);
+        formData.append("planType",this.planType);
+        this.http.uploadFile('/plan/importData', formData,
+        res => {
+            this.$refs.upload.clearFiles();
+            this.tableDataLoading = false;
+            if (res.code == "ok") {
+                this.$message({
+                    message: '导入成功',
+                    type: "success"
+                });
+                this.getTableData(this.hasChooseDept);
+            } else {
+                this.$message({
+                    message: res.msg,
+                    type: "error"
+                });
+            }
+        },
+        error => {
+            this.$refs.upload.clearFiles();
+            this.tableDataLoading = false;
+            this.$message({
+                message: error,
+                type: "error"
+            });
+        });
+    },
+    exportData(){
+      let param = {
+          planType: this.planType,
+          date: this.planDate,
+          steelStampNumber: this.steelStampNumber,
+      }
+      this.http.post('/plan/exportData',param,
+      res => {
+          if (res.code == "ok") {
+              var filePath = res.data;
+              const a = document.createElement('a'); // 创建a标签
+              a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
+              a.setAttribute('href', filePath);// href链接
+              a.click(); //自执行点击事件
+              a.remove();
+          } 
+      },
+      error => {
+          this.$message({
+              message: error,
+              type: "error"
+          });
+          }
+      );
+    }
   },
 };
 </script>

+ 4 - 3
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponentDetil.vue

@@ -28,7 +28,7 @@
                     <el-table-column prop="productName" label="组员" width="180"></el-table-column>
                 </el-table>
             </div>
-            <div v-if="TabIndex == 1"  v-loading="tableDataLoading">
+            <!-- <div v-if="TabIndex == 1"  v-loading="tableDataLoading">
                 <el-table
                 :data="MaterialtableData"
                 :key="tableKey"
@@ -74,7 +74,7 @@
                         <template slot-scope="scope">{{ scope.row.lackNumber }}</template>
                     </el-table-column>
                 </el-table>
-            </div>
+            </div> -->
         </div>
         <!-- <div class="planComponentDetil-bon">3</div> -->
     </div>
@@ -90,7 +90,8 @@ export default {
             topText: '',
             leftText: '',
             id: '',
-            textArr: [{name: '派工单查看', value: 0}, {name: '物料单查看', value: 1}],
+            textArr: [{name: '派工单查看', value: 0}],
+            // textArr: [{name: '派工单查看', value: 0}, {name: '物料单查看', value: 1}],
             TabIndex: 0,
             tableDataLoading: false,
             JobtableData: [],