Browse Source

ly 生产记录

ly 8 months ago
parent
commit
32420e4ec3

+ 7 - 0
master/pom.xml

@@ -477,6 +477,13 @@
             <artifactId>httpmime</artifactId>
             <version>4.5.12</version>
         </dependency>
+
+        <dependency>
+            <groupId>io.github.jpush</groupId>
+            <artifactId>jiguang-sdk</artifactId>
+            <version>5.0.4</version>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 11 - 0
master/src/main/java/com/ruoyi/project/plant/controller/TMtdDailyController.java

@@ -24,6 +24,7 @@ import com.ruoyi.project.plant.domain.TMtdItem;
 import com.ruoyi.project.plant.mapper.TMtdDailyMapper;
 import com.ruoyi.project.plant.mapper.TMtdItemMapper;
 import com.ruoyi.project.plant.service.ITMtdEmailService;
+import com.ruoyi.project.production.controller.TPrdRecordController;
 import com.ruoyi.project.sems.safecheck.domain.TSpecWeekcheck;
 import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.mapper.SysUserMapper;
@@ -77,6 +78,8 @@ public class TMtdDailyController extends BaseController {
     private ISysUserService sysUserService;
     @Resource
     private TMtdDailyMapper tMtdDailyMapper;
+    @Autowired
+    private TPrdRecordController tPrdRecordController;
 
     /**
      * 查询调度会议列表
@@ -192,6 +195,11 @@ public class TMtdDailyController extends BaseController {
         tMtdDailyService.insertTMtdDaily(tMtdDaily);
         String url = PreView(tMtdDaily.getId());
         tMtdDaily.setWordUrl(url);
+
+        new Thread(() -> {
+            tPrdRecordController.syncMeeting(tMtdDaily.getId());
+        },"同步生产记录").start();
+
         return toAjax(tMtdDailyService.updateTMtdDaily(tMtdDaily));
     }
 
@@ -207,6 +215,9 @@ public class TMtdDailyController extends BaseController {
         tMtdDailyService.updateTMtdDaily(tMtdDaily);
         String url = PreView(tMtdDaily.getId());
         tMtdDaily.setWordUrl(url);
+        new Thread(() -> {
+            tPrdRecordController.syncMeeting(tMtdDaily.getId());
+        },"同步生产记录").start();
         return toAjax(tMtdDailyService.updateTMtdDaily(tMtdDaily));
     }
 

+ 245 - 0
master/src/main/java/com/ruoyi/project/production/controller/TPrdRecordController.java

@@ -0,0 +1,245 @@
+package com.ruoyi.project.production.controller;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGUpdateStatement;
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.project.plant.domain.TMtdDaily;
+import com.ruoyi.project.plant.domain.TMtdItem;
+import com.ruoyi.project.plant.mapper.TMtdItemMapper;
+import com.ruoyi.project.plant.service.ITMtdDailyService;
+import com.ruoyi.project.production.domain.TPrdRecordItem;
+import com.ruoyi.project.production.mapper.TPrdRecordItemMapper;
+import com.ruoyi.project.production.mapper.TPrdRecordMapper;
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
+import org.apache.poi.xwpf.usermodel.XWPFParagraph;
+import org.apache.poi.xwpf.usermodel.XWPFRun;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.production.domain.TPrdRecord;
+import com.ruoyi.project.production.service.ITPrdRecordService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+import javax.annotation.Resource;
+
+/**
+ * 生产记录Controller
+ *
+ * @author ssy
+ * @date 2024-10-08
+ */
+@RestController
+@RequestMapping("/production/prdRecord")
+public class TPrdRecordController extends BaseController
+{
+    @Autowired
+    private ITPrdRecordService tPrdRecordService;
+    @Autowired
+    private ITMtdDailyService tMtdDailyService;
+    @Resource
+    private TMtdItemMapper tMtdItemMapper;
+    @Resource
+    private TPrdRecordMapper tPrdRecordMapper;
+    @Resource
+    private TPrdRecordItemMapper tPrdRecordItemMapper;
+    /**
+     * 查询生产记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:prdRecord:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TPrdRecord tPrdRecord)
+    {
+        startPage();
+        List<TPrdRecord> list = tPrdRecordService.selectTPrdRecordList(tPrdRecord);
+        for (TPrdRecord r: list
+             ) {
+            TPrdRecordItem query = new TPrdRecordItem();
+            query.setDailyId(r.getId());
+            r.setContent("");
+            List<TPrdRecordItem> items = tPrdRecordItemMapper.selectTPrdRecordItemList(query);
+            int code = 1;
+            for (TPrdRecordItem i :items
+                 ) {
+                r.setContent(r.getContent() + code + "、" + i.getDescription() + "\n");
+                code++;
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出生产记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:prdRecord:export')")
+    @Log(title = "生产记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TPrdRecord param)
+    {
+        TPrdRecord tPrdRecord =  tPrdRecordService.selectTPrdRecordById(param.getId());
+        TPrdRecordItem query = new TPrdRecordItem();
+        query.setDailyId(param.getId());
+        List<TPrdRecordItem> items = tPrdRecordItemMapper.selectTPrdRecordItemList(query);
+        // 创建一个 Word 文档
+        XWPFDocument document = new XWPFDocument();
+        try {
+            // 创建输出文件的路径
+            FileOutputStream out = null;
+            // 添加每日的记录
+            addDayContent(document, tPrdRecord.getRecordDate(), items);
+            // 将内容写入文件
+            out = new FileOutputStream(ExcelUtil.getAbsoluteFile("daily_report.docx"));
+            document.write(out);
+            out.close();
+            System.out.println("Word 文档生成成功!");
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return AjaxResult.success("daily_report.docx");
+    }
+
+    // 添加每日的内容
+    private static void addDayContent(XWPFDocument document, Date date, List<TPrdRecordItem> items) {
+        // 添加日期为标题
+        XWPFParagraph dateParagraph = document.createParagraph();
+        XWPFRun dateRun = dateParagraph.createRun();
+        dateRun.setBold(true);
+        String pattern = "yyyy年MM月dd日"; // 定义日期格式化模板
+
+        SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); // 创建日期格式化器
+
+        String formattedDate = dateFormat.format(date); // 将日期转换为字符串
+        dateRun.setText(formattedDate);
+        dateRun.addCarriageReturn();
+
+        // 添加条目列表
+        for (int i = 0; i < items.size(); i++) {
+            XWPFParagraph itemParagraph = document.createParagraph();
+            XWPFRun itemRun = itemParagraph.createRun();
+            itemRun.setText((i + 1) + "、\t" + items.get(i).getDescription());
+        }
+    }
+
+    public void syncMeeting(long meetingId){
+        TMtdDaily tMtdDaily = tMtdDailyService.selectTMtdDailyById(meetingId);
+        if (tMtdDaily != null) {
+            TPrdRecord del = new TPrdRecord();
+            del.setRecordDate(tMtdDaily.getMeetingDate());
+            tPrdRecordMapper.deleteTPrdRecordByDate(del);
+        }
+        // 插入主表
+        TPrdRecord record = new TPrdRecord();
+        record.setRecordDate(tMtdDaily.getMeetingDate());
+        tPrdRecordMapper.insertTPrdRecord(record);
+        List<TPrdRecordItem> tPrdRecordItemList = new ArrayList<>();
+
+        TPrdRecordItem recordItem1= new TPrdRecordItem();
+        recordItem1.setDailyId(record.getId());
+        recordItem1.setDescription("裂解炉运行模式" +  tMtdDaily.getOptMode());
+        tPrdRecordItemList.add(recordItem1);
+
+        TPrdRecordItem recordItem2= new TPrdRecordItem();
+        recordItem2.setDescription("负荷:裂解:" +  tMtdDaily.getSplit()+ " AEU:" + tMtdDaily.getAeu() + " PGU:" + tMtdDaily.getPgu());
+        recordItem2.setDailyId(record.getId());
+        tPrdRecordItemList.add(recordItem2);
+
+        //获取item列表
+        TMtdItem item = new TMtdItem();
+        item.setDailyId(meetingId);
+        item.setItemType(0);
+        List<TMtdItem> item0 = tMtdItemMapper.selectTMtdItemList(item);
+
+        item.setItemType(1);
+        List<TMtdItem> item1 = tMtdItemMapper.selectTMtdItemList(item);
+        item0.addAll(item1);
+
+        item.setItemType(2);
+        List<TMtdItem> item2 = tMtdItemMapper.selectTMtdItemList(item);
+        item0.addAll(item2);
+
+        item.setItemType(3);
+        List<TMtdItem> item3 = tMtdItemMapper.selectTMtdItemList(item);
+        item0.addAll(item3);
+
+        for (TMtdItem i: item0
+        ) {
+            TPrdRecordItem recordItem= new TPrdRecordItem();
+            recordItem.setItem(i.getItem());
+            recordItem.setDailyId(record.getId());
+            recordItem.setDescription(i.getDescription());
+            tPrdRecordItemList.add(recordItem);
+        }
+        for (TPrdRecordItem i : tPrdRecordItemList
+             ) {
+            tPrdRecordItemMapper.insertTPrdRecordItem(i);
+        }
+
+    }
+
+    /**
+     * 获取生产记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('production:prdRecord:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        TPrdRecord tPrdRecord = tPrdRecordService.selectTPrdRecordById(id);
+        TPrdRecordItem query = new TPrdRecordItem();
+        query.setDailyId(tPrdRecord.getId());
+        List<TPrdRecordItem> items = tPrdRecordItemMapper.selectTPrdRecordItemList(query);
+
+        tPrdRecord.setItems(items);
+        return AjaxResult.success(tPrdRecord);
+    }
+
+    /**
+     * 新增生产记录
+     */
+    @PreAuthorize("@ss.hasPermi('production:prdRecord:add')")
+    @Log(title = "生产记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TPrdRecord tPrdRecord)
+    {
+        return toAjax(tPrdRecordService.insertTPrdRecord(tPrdRecord));
+    }
+
+    /**
+     * 修改生产记录
+     */
+    @PreAuthorize("@ss.hasPermi('production:prdRecord:edit')")
+    @Log(title = "生产记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TPrdRecord tPrdRecord)
+    {
+        logger.info(JSON.toJSONString(tPrdRecord));
+        return toAjax(tPrdRecordService.updateTPrdRecord(tPrdRecord));
+    }
+
+    /**
+     * 删除生产记录
+     */
+    @PreAuthorize("@ss.hasPermi('production:prdRecord:remove')")
+    @Log(title = "生产记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tPrdRecordService.deleteTPrdRecordByIds(ids));
+    }
+}

+ 103 - 0
master/src/main/java/com/ruoyi/project/production/controller/TPrdRecordItemController.java

@@ -0,0 +1,103 @@
+package com.ruoyi.project.production.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.production.domain.TPrdRecordItem;
+import com.ruoyi.project.production.service.ITPrdRecordItemService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+/**
+ * 生产记录详情Controller
+ *
+ * @author ssy
+ * @date 2024-10-10
+ */
+@RestController
+@RequestMapping("/production/item")
+public class TPrdRecordItemController extends BaseController
+{
+    @Autowired
+    private ITPrdRecordItemService tPrdRecordItemService;
+
+    /**
+     * 查询生产记录详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:item:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TPrdRecordItem tPrdRecordItem)
+    {
+        startPage();
+        List<TPrdRecordItem> list = tPrdRecordItemService.selectTPrdRecordItemList(tPrdRecordItem);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出生产记录详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:item:export')")
+    @Log(title = "生产记录详情", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TPrdRecordItem tPrdRecordItem)
+    {
+        List<TPrdRecordItem> list = tPrdRecordItemService.selectTPrdRecordItemList(tPrdRecordItem);
+        ExcelUtil<TPrdRecordItem> util = new ExcelUtil<TPrdRecordItem>(TPrdRecordItem.class);
+        return util.exportExcel(list, "item");
+    }
+
+    /**
+     * 获取生产记录详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('production:item:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tPrdRecordItemService.selectTPrdRecordItemById(id));
+    }
+
+    /**
+     * 新增生产记录详情
+     */
+    @PreAuthorize("@ss.hasPermi('production:item:add')")
+    @Log(title = "生产记录详情", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TPrdRecordItem tPrdRecordItem)
+    {
+        return toAjax(tPrdRecordItemService.insertTPrdRecordItem(tPrdRecordItem));
+    }
+
+    /**
+     * 修改生产记录详情
+     */
+    @PreAuthorize("@ss.hasPermi('production:item:edit')")
+    @Log(title = "生产记录详情", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TPrdRecordItem tPrdRecordItem)
+    {
+        return toAjax(tPrdRecordItemService.updateTPrdRecordItem(tPrdRecordItem));
+    }
+
+    /**
+     * 删除生产记录详情
+     */
+    @PreAuthorize("@ss.hasPermi('production:item:remove')")
+    @Log(title = "生产记录详情", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tPrdRecordItemService.deleteTPrdRecordItemByIds(ids));
+    }
+}

+ 198 - 0
master/src/main/java/com/ruoyi/project/production/domain/TPrdRecord.java

@@ -0,0 +1,198 @@
+package com.ruoyi.project.production.domain;
+
+import java.util.Date;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 生产记录对象 t_prd_record
+ *
+ * @author ssy
+ * @date 2024-10-08
+ */
+public class TPrdRecord extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 记录人 */
+    @Excel(name = "记录人")
+    private String recorder;
+
+    /** 记录时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date recordDate;
+
+    /** 删除 */
+    private Long delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private String updaterCode;
+
+    /** 更新日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 所属部门 */
+    @Excel(name = "所属部门")
+    private Long deptId;
+
+    List<TPrdRecordItem> items;
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    private String deptName;
+
+    private String content;
+
+    public List<TPrdRecordItem> getItems() {
+        return items;
+    }
+
+    public void setItems(List<TPrdRecordItem> items) {
+        this.items = items;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setRecorder(String recorder)
+    {
+        this.recorder = recorder;
+    }
+
+    public String getRecorder()
+    {
+        return recorder;
+    }
+    public void setRecordDate(Date recordDate)
+    {
+        this.recordDate = recordDate;
+    }
+
+    public Date getRecordDate()
+    {
+        return recordDate;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("recorder", getRecorder())
+            .append("recordDate", getRecordDate())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .append("remarks", getRemarks())
+            .toString();
+    }
+}

+ 202 - 0
master/src/main/java/com/ruoyi/project/production/domain/TPrdRecordItem.java

@@ -0,0 +1,202 @@
+package com.ruoyi.project.production.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 生产记录详情对象 t_prd_record_item
+ *
+ * @author ssy
+ * @date 2024-10-10
+ */
+public class TPrdRecordItem extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** daily_id */
+    @Excel(name = "daily_id")
+    private Long dailyId;
+
+    /** item */
+    @Excel(name = "item")
+    private String item;
+
+    /** 描述 */
+    @Excel(name = "描述")
+    private String description;
+
+    /** 执行人 */
+    @Excel(name = "执行人")
+    private String actionby;
+
+    /** 删除 */
+    private Long delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 更新人 */
+    @Excel(name = "更新人")
+    private String updaterCode;
+
+    /** 更新日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 所属部门 */
+    @Excel(name = "所属部门")
+    private Long deptId;
+    private String deptName;
+    /** item类 */
+    @Excel(name = "item类")
+    private Long itemType;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setDailyId(Long dailyId)
+    {
+        this.dailyId = dailyId;
+    }
+
+    public Long getDailyId()
+    {
+        return dailyId;
+    }
+    public void setItem(String item)
+    {
+        this.item = item;
+    }
+
+    public String getItem()
+    {
+        return item;
+    }
+    public void setDescription(String description)
+    {
+        this.description = description;
+    }
+
+    public String getDescription()
+    {
+        return description;
+    }
+    public void setActionby(String actionby)
+    {
+        this.actionby = actionby;
+    }
+
+    public String getActionby()
+    {
+        return actionby;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setItemType(Long itemType)
+    {
+        this.itemType = itemType;
+    }
+
+    public Long getItemType()
+    {
+        return itemType;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("dailyId", getDailyId())
+            .append("item", getItem())
+            .append("description", getDescription())
+            .append("actionby", getActionby())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .append("itemType", getItemType())
+            .toString();
+    }
+}

+ 63 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TPrdRecordItemMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.production.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.production.domain.TPrdRecordItem;
+
+/**
+ * 生产记录详情Mapper接口
+ *
+ * @author ssy
+ * @date 2024-10-10
+ */
+public interface TPrdRecordItemMapper
+{
+    /**
+     * 查询生产记录详情
+     *
+     * @param id 生产记录详情ID
+     * @return 生产记录详情
+     */
+    public TPrdRecordItem selectTPrdRecordItemById(Long id);
+
+    /**
+     * 查询生产记录详情列表
+     *
+     * @param tPrdRecordItem 生产记录详情
+     * @return 生产记录详情集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TPrdRecordItem> selectTPrdRecordItemList(TPrdRecordItem tPrdRecordItem);
+
+    /**
+     * 新增生产记录详情
+     *
+     * @param tPrdRecordItem 生产记录详情
+     * @return 结果
+     */
+    public int insertTPrdRecordItem(TPrdRecordItem tPrdRecordItem);
+
+    /**
+     * 修改生产记录详情
+     *
+     * @param tPrdRecordItem 生产记录详情
+     * @return 结果
+     */
+    public int updateTPrdRecordItem(TPrdRecordItem tPrdRecordItem);
+
+    /**
+     * 删除生产记录详情
+     *
+     * @param id 生产记录详情ID
+     * @return 结果
+     */
+    public int deleteTPrdRecordItemById(Long id);
+
+    /**
+     * 批量删除生产记录详情
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTPrdRecordItemByIds(Long[] ids);
+}

+ 66 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TPrdRecordMapper.java

@@ -0,0 +1,66 @@
+package com.ruoyi.project.production.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.plant.domain.TMtdDaily;
+import com.ruoyi.project.production.domain.TPrdRecord;
+
+/**
+ * 生产记录Mapper接口
+ *
+ * @author ssy
+ * @date 2024-10-08
+ */
+public interface TPrdRecordMapper
+{
+    /**
+     * 查询生产记录
+     *
+     * @param id 生产记录ID
+     * @return 生产记录
+     */
+    public TPrdRecord selectTPrdRecordById(Long id);
+
+    /**
+     * 查询生产记录列表
+     *
+     * @param tPrdRecord 生产记录
+     * @return 生产记录集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TPrdRecord> selectTPrdRecordList(TPrdRecord tPrdRecord);
+
+    /**
+     * 新增生产记录
+     *
+     * @param tPrdRecord 生产记录
+     * @return 结果
+     */
+    public int insertTPrdRecord(TPrdRecord tPrdRecord);
+
+    /**
+     * 修改生产记录
+     *
+     * @param tPrdRecord 生产记录
+     * @return 结果
+     */
+    public int updateTPrdRecord(TPrdRecord tPrdRecord);
+
+    /**
+     * 删除生产记录
+     *
+     * @param id 生产记录ID
+     * @return 结果
+     */
+    public int deleteTPrdRecordById(Long id);
+
+    /**
+     * 批量删除生产记录
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTPrdRecordByIds(Long[] ids);
+
+    void deleteTPrdRecordByDate(TPrdRecord tPrdRecord);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/production/service/ITPrdRecordItemService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.production.service;
+
+import java.util.List;
+import com.ruoyi.project.production.domain.TPrdRecordItem;
+
+/**
+ * 生产记录详情Service接口
+ *
+ * @author ssy
+ * @date 2024-10-10
+ */
+public interface ITPrdRecordItemService
+{
+    /**
+     * 查询生产记录详情
+     *
+     * @param id 生产记录详情ID
+     * @return 生产记录详情
+     */
+    public TPrdRecordItem selectTPrdRecordItemById(Long id);
+
+    /**
+     * 查询生产记录详情列表
+     *
+     * @param tPrdRecordItem 生产记录详情
+     * @return 生产记录详情集合
+     */
+    public List<TPrdRecordItem> selectTPrdRecordItemList(TPrdRecordItem tPrdRecordItem);
+
+    /**
+     * 新增生产记录详情
+     *
+     * @param tPrdRecordItem 生产记录详情
+     * @return 结果
+     */
+    public int insertTPrdRecordItem(TPrdRecordItem tPrdRecordItem);
+
+    /**
+     * 修改生产记录详情
+     *
+     * @param tPrdRecordItem 生产记录详情
+     * @return 结果
+     */
+    public int updateTPrdRecordItem(TPrdRecordItem tPrdRecordItem);
+
+    /**
+     * 批量删除生产记录详情
+     *
+     * @param ids 需要删除的生产记录详情ID
+     * @return 结果
+     */
+    public int deleteTPrdRecordItemByIds(Long[] ids);
+
+    /**
+     * 删除生产记录详情信息
+     *
+     * @param id 生产记录详情ID
+     * @return 结果
+     */
+    public int deleteTPrdRecordItemById(Long id);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/production/service/ITPrdRecordService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.production.service;
+
+import java.util.List;
+import com.ruoyi.project.production.domain.TPrdRecord;
+
+/**
+ * 生产记录Service接口
+ *
+ * @author ssy
+ * @date 2024-10-08
+ */
+public interface ITPrdRecordService
+{
+    /**
+     * 查询生产记录
+     *
+     * @param id 生产记录ID
+     * @return 生产记录
+     */
+    public TPrdRecord selectTPrdRecordById(Long id);
+
+    /**
+     * 查询生产记录列表
+     *
+     * @param tPrdRecord 生产记录
+     * @return 生产记录集合
+     */
+    public List<TPrdRecord> selectTPrdRecordList(TPrdRecord tPrdRecord);
+
+    /**
+     * 新增生产记录
+     *
+     * @param tPrdRecord 生产记录
+     * @return 结果
+     */
+    public int insertTPrdRecord(TPrdRecord tPrdRecord);
+
+    /**
+     * 修改生产记录
+     *
+     * @param tPrdRecord 生产记录
+     * @return 结果
+     */
+    public int updateTPrdRecord(TPrdRecord tPrdRecord);
+
+    /**
+     * 批量删除生产记录
+     *
+     * @param ids 需要删除的生产记录ID
+     * @return 结果
+     */
+    public int deleteTPrdRecordByIds(Long[] ids);
+
+    /**
+     * 删除生产记录信息
+     *
+     * @param id 生产记录ID
+     * @return 结果
+     */
+    public int deleteTPrdRecordById(Long id);
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/TPrdRecordItemServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.production.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.production.mapper.TPrdRecordItemMapper;
+import com.ruoyi.project.production.domain.TPrdRecordItem;
+import com.ruoyi.project.production.service.ITPrdRecordItemService;
+
+/**
+ * 生产记录详情Service业务层处理
+ *
+ * @author ssy
+ * @date 2024-10-10
+ */
+@Service
+public class TPrdRecordItemServiceImpl implements ITPrdRecordItemService
+{
+    @Autowired
+    private TPrdRecordItemMapper tPrdRecordItemMapper;
+
+    /**
+     * 查询生产记录详情
+     *
+     * @param id 生产记录详情ID
+     * @return 生产记录详情
+     */
+    @Override
+    public TPrdRecordItem selectTPrdRecordItemById(Long id)
+    {
+        return tPrdRecordItemMapper.selectTPrdRecordItemById(id);
+    }
+
+    /**
+     * 查询生产记录详情列表
+     *
+     * @param tPrdRecordItem 生产记录详情
+     * @return 生产记录详情
+     */
+    @Override
+    public List<TPrdRecordItem> selectTPrdRecordItemList(TPrdRecordItem tPrdRecordItem)
+    {
+        return tPrdRecordItemMapper.selectTPrdRecordItemList(tPrdRecordItem);
+    }
+
+    /**
+     * 新增生产记录详情
+     *
+     * @param tPrdRecordItem 生产记录详情
+     * @return 结果
+     */
+    @Override
+    public int insertTPrdRecordItem(TPrdRecordItem tPrdRecordItem)
+    {
+        return tPrdRecordItemMapper.insertTPrdRecordItem(tPrdRecordItem);
+    }
+
+    /**
+     * 修改生产记录详情
+     *
+     * @param tPrdRecordItem 生产记录详情
+     * @return 结果
+     */
+    @Override
+    public int updateTPrdRecordItem(TPrdRecordItem tPrdRecordItem)
+    {
+        return tPrdRecordItemMapper.updateTPrdRecordItem(tPrdRecordItem);
+    }
+
+    /**
+     * 批量删除生产记录详情
+     *
+     * @param ids 需要删除的生产记录详情ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTPrdRecordItemByIds(Long[] ids)
+    {
+        return tPrdRecordItemMapper.deleteTPrdRecordItemByIds(ids);
+    }
+
+    /**
+     * 删除生产记录详情信息
+     *
+     * @param id 生产记录详情ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTPrdRecordItemById(Long id)
+    {
+        return tPrdRecordItemMapper.deleteTPrdRecordItemById(id);
+    }
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/TPrdRecordServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.production.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.production.mapper.TPrdRecordMapper;
+import com.ruoyi.project.production.domain.TPrdRecord;
+import com.ruoyi.project.production.service.ITPrdRecordService;
+
+/**
+ * 生产记录Service业务层处理
+ *
+ * @author ssy
+ * @date 2024-10-08
+ */
+@Service
+public class TPrdRecordServiceImpl implements ITPrdRecordService
+{
+    @Autowired
+    private TPrdRecordMapper tPrdRecordMapper;
+
+    /**
+     * 查询生产记录
+     *
+     * @param id 生产记录ID
+     * @return 生产记录
+     */
+    @Override
+    public TPrdRecord selectTPrdRecordById(Long id)
+    {
+        return tPrdRecordMapper.selectTPrdRecordById(id);
+    }
+
+    /**
+     * 查询生产记录列表
+     *
+     * @param tPrdRecord 生产记录
+     * @return 生产记录
+     */
+    @Override
+    public List<TPrdRecord> selectTPrdRecordList(TPrdRecord tPrdRecord)
+    {
+        return tPrdRecordMapper.selectTPrdRecordList(tPrdRecord);
+    }
+
+    /**
+     * 新增生产记录
+     *
+     * @param tPrdRecord 生产记录
+     * @return 结果
+     */
+    @Override
+    public int insertTPrdRecord(TPrdRecord tPrdRecord)
+    {
+        return tPrdRecordMapper.insertTPrdRecord(tPrdRecord);
+    }
+
+    /**
+     * 修改生产记录
+     *
+     * @param tPrdRecord 生产记录
+     * @return 结果
+     */
+    @Override
+    public int updateTPrdRecord(TPrdRecord tPrdRecord)
+    {
+        return tPrdRecordMapper.updateTPrdRecord(tPrdRecord);
+    }
+
+    /**
+     * 批量删除生产记录
+     *
+     * @param ids 需要删除的生产记录ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTPrdRecordByIds(Long[] ids)
+    {
+        return tPrdRecordMapper.deleteTPrdRecordByIds(ids);
+    }
+
+    /**
+     * 删除生产记录信息
+     *
+     * @param id 生产记录ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTPrdRecordById(Long id)
+    {
+        return tPrdRecordMapper.deleteTPrdRecordById(id);
+    }
+}

+ 115 - 0
master/src/main/resources/mybatis/production/TPrdRecordItemMapper.xml

@@ -0,0 +1,115 @@
+<?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.ruoyi.project.production.mapper.TPrdRecordItemMapper">
+
+    <resultMap type="TPrdRecordItem" id="TPrdRecordItemResult">
+        <result property="id"    column="id"    />
+        <result property="dailyId"    column="daily_id"    />
+        <result property="item"    column="item"    />
+        <result property="description"    column="description"    />
+        <result property="actionby"    column="actionby"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createrCode"    column="creater_code"    />
+        <result property="createdate"    column="createdate"    />
+        <result property="updaterCode"    column="updater_code"    />
+        <result property="updatedate"    column="updatedate"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="itemType"    column="item_type"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTPrdRecordItemVo">
+        select d.id, d.daily_id, d.item, d.description, d.actionby, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.item_type from t_prd_record_item d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTPrdRecordItemList" parameterType="TPrdRecordItem" resultMap="TPrdRecordItemResult">
+        <include refid="selectTPrdRecordItemVo"/>
+        <where>
+            <if test="dailyId != null "> and daily_id = #{dailyId}</if>
+            <if test="item != null  and item != ''"> and item = #{item}</if>
+            <if test="description != null  and description != ''"> and description = #{description}</if>
+            <if test="actionby != null  and actionby != ''"> and actionby = #{actionby}</if>
+            <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="itemType != null "> and item_type = #{itemType}</if>
+            and d.del_flag = 0
+        </where>
+        order by id
+    </select>
+
+    <select id="selectTPrdRecordItemById" parameterType="Long" resultMap="TPrdRecordItemResult">
+        <include refid="selectTPrdRecordItemVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTPrdRecordItem" parameterType="TPrdRecordItem">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_prd_record_item.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_prd_record_item
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="dailyId != null">daily_id,</if>
+            <if test="item != null">item,</if>
+            <if test="description != null">description,</if>
+            <if test="actionby != null">actionby,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="itemType != null">item_type,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="dailyId != null">#{dailyId},</if>
+            <if test="item != null">#{item},</if>
+            <if test="description != null">#{description},</if>
+            <if test="actionby != null">#{actionby},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="itemType != null">#{itemType},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTPrdRecordItem" parameterType="TPrdRecordItem">
+        update t_prd_record_item
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="dailyId != null">daily_id = #{dailyId},</if>
+            <if test="item != null">item = #{item},</if>
+            <if test="description != null">description = #{description},</if>
+            <if test="actionby != null">actionby = #{actionby},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="itemType != null">item_type = #{itemType},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTPrdRecordItemById" parameterType="Long">
+        update t_prd_record_item set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTPrdRecordItemByIds" parameterType="String">
+        update t_prd_record_item set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+</mapper>

+ 110 - 0
master/src/main/resources/mybatis/production/TPrdRecordMapper.xml

@@ -0,0 +1,110 @@
+<?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.ruoyi.project.production.mapper.TPrdRecordMapper">
+
+    <resultMap type="TPrdRecord" id="TPrdRecordResult">
+        <result property="id"    column="id"    />
+        <result property="recorder"    column="recorder"    />
+        <result property="recordDate"    column="record_date"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createrCode"    column="creater_code"    />
+        <result property="createdate"    column="createdate"    />
+        <result property="updaterCode"    column="updater_code"    />
+        <result property="updatedate"    column="updatedate"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTPrdRecordVo">
+        select d.id, d.recorder, d.record_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_prd_record d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTPrdRecordList" parameterType="TPrdRecord" resultMap="TPrdRecordResult">
+        <include refid="selectTPrdRecordVo"/>
+        <where>
+            <if test="recorder != null  and recorder != ''"> and recorder = #{recorder}</if>
+            <if test="recordDate != null "> and record_date = #{recordDate}</if>
+            <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            and d.del_flag = 0
+        </where>
+        order by d.record_date desc
+    </select>
+
+    <select id="selectTPrdRecordById" parameterType="Long" resultMap="TPrdRecordResult">
+        <include refid="selectTPrdRecordVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTPrdRecord" parameterType="TPrdRecord">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_prd_record.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_prd_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="recorder != null">recorder,</if>
+            <if test="recordDate != null">record_date,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="remarks != null">remarks,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="recorder != null">#{recorder},</if>
+            <if test="recordDate != null">#{recordDate},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="remarks != null">#{remarks},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTPrdRecord" parameterType="TPrdRecord">
+        update t_prd_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="recorder != null">recorder = #{recorder},</if>
+            <if test="recordDate != null">record_date = #{recordDate},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTPrdRecordById" parameterType="Long">
+        update t_prd_record set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTPrdRecordByIds" parameterType="String">
+        update t_prd_record set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <update id="deleteTPrdRecordByDate" parameterType="TPrdRecord">
+        update t_prd_record set del_flag = 2 where record_date = #{recordDate}
+    </update>
+
+
+</mapper>

+ 53 - 0
ui/src/api/production/prdRecord.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询生产记录列表
+export function listPrdRecord(query) {
+  return request({
+    url: '/production/prdRecord/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询生产记录详细
+export function getPrdRecord(id) {
+  return request({
+    url: '/production/prdRecord/' + id,
+    method: 'get'
+  })
+}
+
+// 新增生产记录
+export function addPrdRecord(data) {
+  return request({
+    url: '/production/prdRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改生产记录
+export function updatePrdRecord(data) {
+  return request({
+    url: '/production/prdRecord',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除生产记录
+export function delPrdRecord(id) {
+  return request({
+    url: '/production/prdRecord/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出生产记录
+export function exportPrdRecord(query) {
+  return request({
+    url: '/production/prdRecord/export',
+    method: 'get',
+    params: query
+  })
+}

+ 434 - 0
ui/src/views/production/prdRecord/index.vue

@@ -0,0 +1,434 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+
+      <el-form-item label="记录时间" prop="recordDate">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.recordDate"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择记录时间">
+        </el-date-picker>
+      </el-form-item>
+
+      <el-form-item label="备注" prop="remarks">
+        <el-input
+          v-model="queryParams.remarks"
+          placeholder="请输入备注"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['production:prdRecord:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['production:prdRecord:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['production:prdRecord:remove']"
+        >删除</el-button>
+      </el-col>
+        <el-col :span="1.5">
+            <el-button
+                    type="info"
+                    icon="el-icon-upload2"
+                    size="mini"
+                    @click="handleImport"
+                    v-hasPermi="['production:prdRecord:edit']"
+            >导入</el-button>
+        </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['production:prdRecord:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="prdRecordList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="记录时间" align="center" prop="recordDate" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.recordDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="记录人" align="center" prop="recorder" :show-overflow-tooltip="true"/>
+      <el-table-column label="内容" align="center" prop="content" width="720" >
+        <template slot-scope="scope">
+          <span style="white-space: pre-line;">{{ scope.row.content }}</span>
+        </template>
+      </el-table-column>
+
+
+
+      <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
+      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleExport(scope.row)"
+            v-hasPermi="['production:prdRecord:edit']"
+          >导出</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['production:prdRecord:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['production:prdRecord:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改生产记录对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+
+        <el-form-item label="记录时间" prop="recordDate">
+          <el-date-picker clearable size="small" style="width: 200px"
+            v-model="form.recordDate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择记录时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-card >
+          <el-row v-for="(item, index) in form.items">
+            <el-col :span="20">
+              <el-form-item  label="内容" prop="remarks">
+                <el-input v-model="item.description" type="textarea" placeholder="请输入" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="4">
+              <el-button  type="text" @click="deleteItem( index)">移除</el-button>
+
+            </el-col>
+          </el-row>
+
+        </el-card>
+        <el-button style="text-align: center" @click="addItem(3)">新增</el-button>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+      <!-- 用户导入对话框 -->
+      <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+          <el-upload
+                  ref="upload"
+                  :limit="1"
+                  accept=".xlsx, .xls"
+                  :headers="upload.headers"
+                  :action="upload.url + '?updateSupport=' + upload.updateSupport"
+                  :disabled="upload.isUploading"
+                  :on-progress="handleFileUploadProgress"
+                  :on-success="handleFileSuccess"
+                  :auto-upload="false"
+                  drag
+          >
+              <i class="el-icon-upload"></i>
+              <div class="el-upload__text">
+                  将文件拖到此处,或
+                  <em>点击上传</em>
+              </div>
+              <div class="el-upload__tip" slot="tip">
+                  <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+                  <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+              </div>
+              <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+          </el-upload>
+          <div slot="footer" class="dialog-footer">
+              <el-button type="primary" @click="submitFileForm">确 定</el-button>
+              <el-button @click="upload.open = false">取 消</el-button>
+          </div>
+      </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listPrdRecord, getPrdRecord, delPrdRecord, addPrdRecord, updatePrdRecord, exportPrdRecord, importTemplate} from "@/api/production/prdRecord";
+import { treeselect } from "@/api/system/dept";
+import { getToken } from "@/utils/auth";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "PrdRecord",
+  components: { Treeselect },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 生产记录表格数据
+      prdRecordList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+        // 用户导入参数
+        upload: {
+            // 是否显示弹出层(用户导入)
+            open: false,
+            // 弹出层标题(用户导入)
+            title: "",
+            // 是否禁用上传
+            isUploading: false,
+            // 是否更新已经存在的用户数据
+            updateSupport: 0,
+            // 设置上传的请求头部
+            headers: { Authorization: "Bearer " + getToken() },
+            // 上传的地址
+            url: process.env.VUE_APP_BASE_API + "/production/prdRecord/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        recorder: null,
+        recordDate: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  watch: {
+        // 根据名称筛选部门树
+        deptName(val) {
+            this.$refs.tree.filter(val);
+        }
+   },
+  created() {
+      //设置表格高度对应屏幕高度
+      this.$nextTick(() => {
+          this.clientHeight = document.body.clientHeight -250
+      })
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    /** 查询生产记录列表 */
+    getList() {
+      this.loading = true;
+      listPrdRecord(this.queryParams).then(response => {
+        this.prdRecordList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+     /** 查询部门下拉树结构 */
+     getTreeselect() {
+          treeselect().then(response => {
+              this.deptOptions = response.data;
+          });
+     },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        recorder: null,
+        recordDate: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加生产记录";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getPrdRecord(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改生产记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updatePrdRecord(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addPrdRecord(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delPrdRecord(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport(row) {
+      let param = {id:row.id}
+      this.$confirm('是否确认导出所有生产记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportPrdRecord(param);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    },
+      /** 导入按钮操作 */
+      handleImport() {
+          this.upload.title = "用户导入";
+          this.upload.open = true;
+      },
+      /** 下载模板操作 */
+      importTemplate() {
+          importTemplate().then(response => {
+              this.download(response.msg);
+          });
+      },
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+          this.upload.isUploading = true;
+      },
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
+          this.upload.open = false;
+          this.upload.isUploading = false;
+          this.$refs.upload.clearFiles();
+          this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+          this.getList();
+      },
+      // 提交上传文件
+      submitFileForm() {
+          this.$refs.upload.submit();
+      },
+    deleteItem( index) {
+        this.form.items.splice(index, 1)
+    },
+    addItem(type) {
+        this.form.items.push({description: ''})
+    },
+  }
+};
+</script>