24282 1 year ago
parent
commit
70a376147e
17 changed files with 692 additions and 0 deletions
  1. 72 0
      sd-business/src/main/java/com/sd/business/controller/craft/CraftProductionLineController.java
  2. 26 0
      sd-business/src/main/java/com/sd/business/entity/craft/dto/CraftProductionLineDto.java
  3. 17 0
      sd-business/src/main/java/com/sd/business/entity/craft/dto/CraftProductionLineProcessDto.java
  4. 17 0
      sd-business/src/main/java/com/sd/business/entity/craft/dto/CraftProductionLineProcessSelectDto.java
  5. 27 0
      sd-business/src/main/java/com/sd/business/entity/craft/dto/CraftProductionLineSelectDto.java
  6. 47 0
      sd-business/src/main/java/com/sd/business/entity/craft/po/CraftProductionLine.java
  7. 59 0
      sd-business/src/main/java/com/sd/business/entity/craft/po/CraftProductionLineProcess.java
  8. 22 0
      sd-business/src/main/java/com/sd/business/entity/craft/vo/CraftProductionLineProcessVo.java
  9. 21 0
      sd-business/src/main/java/com/sd/business/entity/craft/vo/CraftProductionLineVo.java
  10. 26 0
      sd-business/src/main/java/com/sd/business/mapper/craft/CraftProductionLineMapper.java
  11. 26 0
      sd-business/src/main/java/com/sd/business/mapper/craft/CraftProductionLineProcessMapper.java
  12. 46 0
      sd-business/src/main/java/com/sd/business/service/craft/CraftProductionLineProcessService.java
  13. 46 0
      sd-business/src/main/java/com/sd/business/service/craft/CraftProductionLineService.java
  14. 57 0
      sd-business/src/main/java/com/sd/business/service/craft/impl/CraftProductionLineProcessServiceImpl.java
  15. 144 0
      sd-business/src/main/java/com/sd/business/service/craft/impl/CraftProductionLineServiceImpl.java
  16. 18 0
      sd-business/src/main/resources/mapper/craft/CraftProductionLineMapper.xml
  17. 21 0
      sd-business/src/main/resources/mapper/craft/CraftProductionLineProcessMapper.xml

+ 72 - 0
sd-business/src/main/java/com/sd/business/controller/craft/CraftProductionLineController.java

@@ -0,0 +1,72 @@
+package com.sd.business.controller.craft;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.sd.business.entity.craft.dto.CraftProductionLineDto;
+import com.sd.business.entity.craft.dto.CraftProductionLineSelectDto;
+import com.sd.business.entity.craft.vo.CraftProductionLineVo;
+import com.sd.business.service.craft.CraftProductionLineService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * <p>
+ * 工艺_产线 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@RestController
+@RequestMapping("/craftProductionLine")
+public class CraftProductionLineController {
+
+    @Autowired
+    private CraftProductionLineService craftProductionLineService;
+
+    /**
+     * 工艺_产线分页
+     */
+    @PostMapping("/page")
+    public Page<CraftProductionLineVo> page(@RequestBody CraftProductionLineSelectDto dto) {
+        return craftProductionLineService.getPage(dto);
+    }
+
+    /**
+     * 工艺_产线明细
+     */
+    @PostMapping("/detail")
+    public CraftProductionLineVo detail(@RequestBody BaseSelectDto dto) {
+        return craftProductionLineService.detail(dto.getId());
+    }
+
+    /**
+     * 工艺_产线新增
+     */
+    @PostMapping("/add")
+    public void add(@Validated @RequestBody CraftProductionLineDto craftProductionLineDto) {
+        craftProductionLineService.add(craftProductionLineDto);
+    }
+
+    /**
+     * 工艺_产线编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody CraftProductionLineDto craftProductionLineDto) {
+        craftProductionLineService.edit(craftProductionLineDto);
+    }
+
+    /**
+     * 工艺_产线删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        craftProductionLineService.delete(dto.getId());
+    }
+
+}

+ 26 - 0
sd-business/src/main/java/com/sd/business/entity/craft/dto/CraftProductionLineDto.java

@@ -0,0 +1,26 @@
+package com.sd.business.entity.craft.dto;
+
+import com.sd.business.entity.craft.po.CraftProductionLine;
+import com.sd.business.entity.craft.po.CraftProductionLineProcess;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * 工艺_产线新增编辑入参实体
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@Getter
+@Setter
+public class CraftProductionLineDto extends CraftProductionLine {
+
+    @Valid
+    @NotNull(message = "产线明细不能为空")
+    private List<CraftProductionLineProcess> craftProductionLineProcessList;
+
+}

+ 17 - 0
sd-business/src/main/java/com/sd/business/entity/craft/dto/CraftProductionLineProcessDto.java

@@ -0,0 +1,17 @@
+package com.sd.business.entity.craft.dto;
+
+import com.sd.business.entity.craft.po.CraftProductionLineProcess;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 工艺_产线工序关联新增编辑入参实体
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@Getter
+@Setter
+public class CraftProductionLineProcessDto extends CraftProductionLineProcess {
+
+}

+ 17 - 0
sd-business/src/main/java/com/sd/business/entity/craft/dto/CraftProductionLineProcessSelectDto.java

@@ -0,0 +1,17 @@
+package com.sd.business.entity.craft.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 工艺_产线工序关联列表查询入参实体
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@Getter
+@Setter
+public class CraftProductionLineProcessSelectDto extends BaseSelectDto {
+
+}

+ 27 - 0
sd-business/src/main/java/com/sd/business/entity/craft/dto/CraftProductionLineSelectDto.java

@@ -0,0 +1,27 @@
+package com.sd.business.entity.craft.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 工艺_产线列表查询入参实体
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@Getter
+@Setter
+public class CraftProductionLineSelectDto extends BaseSelectDto {
+
+    /**
+     * 产线编码
+     */
+    private String code;
+
+    /**
+     * 产线名称
+     */
+    private String name;
+
+}

+ 47 - 0
sd-business/src/main/java/com/sd/business/entity/craft/po/CraftProductionLine.java

@@ -0,0 +1,47 @@
+package com.sd.business.entity.craft.po;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.core.domain.BasePo;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * <p>
+ * 工艺_产线
+ * </p>
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@Getter
+@Setter
+@TableName("craft_production_line")
+public class CraftProductionLine extends BasePo {
+
+    /**
+     * 产线编码
+     */
+    @NotBlank(message = "产线编码不能为空")
+    private String code;
+
+    /**
+     * 产线名称
+     */
+    @NotBlank(message = "产线名称不能为空")
+    private String name;
+
+    /**
+     * 是否批量模式:1是 0否
+     */
+    @NotNull(message = "是否批量模式不能为空")
+    private Integer batchMode;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 59 - 0
sd-business/src/main/java/com/sd/business/entity/craft/po/CraftProductionLineProcess.java

@@ -0,0 +1,59 @@
+package com.sd.business.entity.craft.po;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.core.domain.BasePo;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * <p>
+ * 工艺_产线工序关联
+ * </p>
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@Getter
+@Setter
+@TableName("craft_production_line_process")
+public class CraftProductionLineProcess extends BasePo {
+
+    /**
+     * 工艺_产线id
+     */
+    private Long craftProductionLineId;
+
+    /**
+     * 工艺_工序id
+     */
+    @NotNull(message = "工序id不能为空")
+    private Long craftProcessId;
+
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
+     * 设备id
+     */
+    private Long equipmentId;
+
+    /**
+     * rfidIp
+     */
+    private String rfidIp;
+
+    /**
+     * rfid通道
+     */
+    private String rfidPassage;
+
+    /**
+     * 接口地址
+     */
+    private String interfaceAddress;
+
+}

+ 22 - 0
sd-business/src/main/java/com/sd/business/entity/craft/vo/CraftProductionLineProcessVo.java

@@ -0,0 +1,22 @@
+package com.sd.business.entity.craft.vo;
+
+import com.sd.business.entity.craft.po.CraftProductionLineProcess;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 工艺_产线工序关联列表查询返回值实体
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@Getter
+@Setter
+public class CraftProductionLineProcessVo extends CraftProductionLineProcess {
+
+    /**
+     * 工序名称
+     */
+    private String craftProcessName;
+
+}

+ 21 - 0
sd-business/src/main/java/com/sd/business/entity/craft/vo/CraftProductionLineVo.java

@@ -0,0 +1,21 @@
+package com.sd.business.entity.craft.vo;
+
+import com.sd.business.entity.craft.po.CraftProductionLine;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 工艺_产线列表查询返回值实体
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@Getter
+@Setter
+public class CraftProductionLineVo extends CraftProductionLine {
+
+    private List<CraftProductionLineProcessVo> craftProductionLineProcessList;
+
+}

+ 26 - 0
sd-business/src/main/java/com/sd/business/mapper/craft/CraftProductionLineMapper.java

@@ -0,0 +1,26 @@
+package com.sd.business.mapper.craft;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.sd.business.entity.craft.po.CraftProductionLine;
+import com.sd.business.entity.craft.vo.CraftProductionLineVo;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 工艺_产线 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2023-07-26
+ */
+public interface CraftProductionLineMapper extends BaseMapper<CraftProductionLine> {
+
+    /**
+     * 工艺_产线分页
+     */
+    Page<CraftProductionLineVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<CraftProductionLine> wrapper);
+
+}

+ 26 - 0
sd-business/src/main/java/com/sd/business/mapper/craft/CraftProductionLineProcessMapper.java

@@ -0,0 +1,26 @@
+package com.sd.business.mapper.craft;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.sd.business.entity.craft.po.CraftProductionLineProcess;
+import com.sd.business.entity.craft.vo.CraftProductionLineProcessVo;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 工艺_产线工序关联 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2023-07-26
+ */
+public interface CraftProductionLineProcessMapper extends BaseMapper<CraftProductionLineProcess> {
+
+    /**
+     * 工艺_产线工序关联分页
+     */
+    Page<CraftProductionLineProcessVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<CraftProductionLineProcess> wrapper);
+
+}

+ 46 - 0
sd-business/src/main/java/com/sd/business/service/craft/CraftProductionLineProcessService.java

@@ -0,0 +1,46 @@
+package com.sd.business.service.craft;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.service.BaseService;
+import com.sd.business.entity.craft.dto.CraftProductionLineProcessDto;
+import com.sd.business.entity.craft.dto.CraftProductionLineProcessSelectDto;
+import com.sd.business.entity.craft.po.CraftProductionLineProcess;
+import com.sd.business.entity.craft.vo.CraftProductionLineProcessVo;
+
+
+/**
+ * <p>
+ * 工艺_产线工序关联 服务类
+ * </p>
+ *
+ * @author
+ * @since 2023-07-26
+ */
+public interface CraftProductionLineProcessService extends BaseService<CraftProductionLineProcess> {
+
+    /**
+     * 工艺_产线工序关联分页
+     */
+    Page<CraftProductionLineProcessVo> getPage(CraftProductionLineProcessSelectDto dto);
+
+    /**
+     * 工艺_产线工序关联明细
+     */
+    CraftProductionLineProcessVo detail(Long id);
+
+    /**
+     * 工艺_产线工序关联新增
+     */
+    void add(CraftProductionLineProcessDto craftProductionLineProcessDto);
+
+    /**
+     * 工艺_产线工序关联编辑
+     */
+    void edit(CraftProductionLineProcessDto craftProductionLineProcessDto);
+
+    /**
+     * 工艺_产线工序关联删除
+     */
+    void delete(Long id);
+
+}

+ 46 - 0
sd-business/src/main/java/com/sd/business/service/craft/CraftProductionLineService.java

@@ -0,0 +1,46 @@
+package com.sd.business.service.craft;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.service.BaseService;
+import com.sd.business.entity.craft.dto.CraftProductionLineDto;
+import com.sd.business.entity.craft.dto.CraftProductionLineSelectDto;
+import com.sd.business.entity.craft.po.CraftProductionLine;
+import com.sd.business.entity.craft.vo.CraftProductionLineVo;
+
+
+/**
+ * <p>
+ * 工艺_产线 服务类
+ * </p>
+ *
+ * @author
+ * @since 2023-07-26
+ */
+public interface CraftProductionLineService extends BaseService<CraftProductionLine> {
+
+    /**
+     * 工艺_产线分页
+     */
+    Page<CraftProductionLineVo> getPage(CraftProductionLineSelectDto dto);
+
+    /**
+     * 工艺_产线明细
+     */
+    CraftProductionLineVo detail(Long id);
+
+    /**
+     * 工艺_产线新增
+     */
+    void add(CraftProductionLineDto craftProductionLineDto);
+
+    /**
+     * 工艺_产线编辑
+     */
+    void edit(CraftProductionLineDto craftProductionLineDto);
+
+    /**
+     * 工艺_产线删除
+     */
+    void delete(Long id);
+
+}

+ 57 - 0
sd-business/src/main/java/com/sd/business/service/craft/impl/CraftProductionLineProcessServiceImpl.java

@@ -0,0 +1,57 @@
+package com.sd.business.service.craft.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.sd.business.entity.craft.dto.CraftProductionLineProcessDto;
+import com.sd.business.entity.craft.dto.CraftProductionLineProcessSelectDto;
+import com.sd.business.entity.craft.po.CraftProductionLineProcess;
+import com.sd.business.entity.craft.vo.CraftProductionLineProcessVo;
+import com.sd.business.mapper.craft.CraftProductionLineProcessMapper;
+import com.sd.business.service.craft.CraftProductionLineProcessService;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * <p>
+ * 工艺_产线工序关联 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@Service
+public class CraftProductionLineProcessServiceImpl extends ServiceImpl<CraftProductionLineProcessMapper, CraftProductionLineProcess> implements CraftProductionLineProcessService {
+
+    @Override
+    public Page<CraftProductionLineProcessVo> getPage(CraftProductionLineProcessSelectDto dto) {
+        IWrapper<CraftProductionLineProcess> wrapper = getWrapper();
+        wrapper.orderByDesc("cplp", CraftProductionLineProcess::getId);
+        Page<CraftProductionLineProcessVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public CraftProductionLineProcessVo detail(Long id) {
+        CraftProductionLineProcess CraftProductionLineProcess = this.getById(id);
+        CraftProductionLineProcessVo result = BeanUtil.toBean(CraftProductionLineProcess, CraftProductionLineProcessVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(CraftProductionLineProcessDto craftProductionLineProcessDto) {
+        this.save(craftProductionLineProcessDto);
+    }
+
+    @Override
+    public void edit(CraftProductionLineProcessDto craftProductionLineProcessDto) {
+        this.updateById(craftProductionLineProcessDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 144 - 0
sd-business/src/main/java/com/sd/business/service/craft/impl/CraftProductionLineServiceImpl.java

@@ -0,0 +1,144 @@
+package com.sd.business.service.craft.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.domain.BaseIdPo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.sd.business.entity.craft.dto.CraftProductionLineDto;
+import com.sd.business.entity.craft.dto.CraftProductionLineSelectDto;
+import com.sd.business.entity.craft.po.CraftProductionLine;
+import com.sd.business.entity.craft.po.CraftProductionLineProcess;
+import com.sd.business.entity.craft.vo.CraftProductionLineProcessVo;
+import com.sd.business.entity.craft.vo.CraftProductionLineVo;
+import com.sd.business.mapper.craft.CraftProductionLineMapper;
+import com.sd.business.service.craft.CraftProcessService;
+import com.sd.business.service.craft.CraftProductionLineProcessService;
+import com.sd.business.service.craft.CraftProductionLineService;
+import com.sd.framework.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+
+/**
+ * <p>
+ * 工艺_产线 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-07-26
+ */
+@Service
+public class CraftProductionLineServiceImpl extends ServiceImpl<CraftProductionLineMapper, CraftProductionLine> implements CraftProductionLineService {
+
+    @Autowired
+    private CraftProductionLineProcessService craftProductionLineProcessService;
+
+    @Autowired
+    private CraftProcessService craftProcessService;
+
+    @Override
+    public Page<CraftProductionLineVo> getPage(CraftProductionLineSelectDto dto) {
+        IWrapper<CraftProductionLine> wrapper = getWrapper();
+        wrapper.orderByDesc("cpl", CraftProductionLine::getId);
+        wrapper.like("cpl", CraftProductionLine::getCode, dto.getCode());
+        wrapper.like("cpl", CraftProductionLine::getName, dto.getName());
+        Page<CraftProductionLineVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        List<CraftProductionLineVo> records = page.getRecords();
+        if (records.size() == 0) {
+            return page;
+        }
+
+        // 获取产线明细
+        List<Long> craftProductionLineIdList = records.stream().map(BaseIdPo::getId).collect(Collectors.toList());
+        List<CraftProductionLineProcess> tempCraftProductionLineProcessList = craftProductionLineProcessService.list(q -> q
+                .in(CraftProductionLineProcess::getCraftProductionLineId, craftProductionLineIdList)
+                .orderByAsc(CraftProductionLineProcess::getSort)
+        );
+        List<CraftProductionLineProcessVo> craftProductionLineProcessList =
+                BeanUtil.copyToList(tempCraftProductionLineProcessList, CraftProductionLineProcessVo.class);
+
+        // 赋值工序名称
+        craftProcessService.attributeAssign(
+                craftProductionLineProcessList,
+                CraftProductionLineProcess::getCraftProcessId,
+                (item, craftProcess) -> item.setCraftProcessName(craftProcess.getName()));
+
+        // 赋值产线明细
+        Map<Long, List<CraftProductionLineProcessVo>> craftProductionLineProcessMap = craftProductionLineProcessList
+                .stream().collect(Collectors.groupingBy(CraftProductionLineProcess::getCraftProductionLineId));
+        records.forEach(item -> item.setCraftProductionLineProcessList(
+                craftProductionLineProcessMap.getOrDefault(item.getId(), Collections.emptyList())));
+
+        return page;
+    }
+
+    @Override
+    public CraftProductionLineVo detail(Long id) {
+        CraftProductionLine craftProductionLine = this.getById(id);
+        Assert.notNull(craftProductionLine, "未知产线");
+        CraftProductionLineVo result = BeanUtil.toBean(craftProductionLine, CraftProductionLineVo.class);
+
+        // 获取产线明细
+        List<CraftProductionLineProcess> tempCraftProductionLineProcessList = craftProductionLineProcessService.list(q -> q
+                .eq(CraftProductionLineProcess::getCraftProductionLineId, id)
+                .orderByAsc(CraftProductionLineProcess::getSort)
+        );
+        List<CraftProductionLineProcessVo> craftProductionLineProcessList =
+                BeanUtil.copyToList(tempCraftProductionLineProcessList, CraftProductionLineProcessVo.class);
+
+        // 赋值工序名称
+        craftProcessService.attributeAssign(
+                craftProductionLineProcessList,
+                CraftProductionLineProcess::getCraftProcessId,
+                (item, craftProcess) -> item.setCraftProcessName(craftProcess.getName()));
+
+        // 赋值产线明细
+        result.setCraftProductionLineProcessList(craftProductionLineProcessList);
+
+        return result;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void add(CraftProductionLineDto dto) {
+        this.save(dto);
+
+        List<CraftProductionLineProcess> craftProductionLineProcessList = dto.getCraftProductionLineProcessList();
+        for (int i = 0; i < craftProductionLineProcessList.size(); i++) {
+            CraftProductionLineProcess craftProductionLineProcess = craftProductionLineProcessList.get(i);
+            craftProductionLineProcess.setCraftProductionLineId(dto.getId());
+            craftProductionLineProcess.setSort(i + 1);
+        }
+        craftProductionLineProcessService.saveBatch(craftProductionLineProcessList);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void edit(CraftProductionLineDto dto) {
+        this.updateById(dto);
+
+        List<CraftProductionLineProcess> craftProductionLineProcessList = dto.getCraftProductionLineProcessList();
+        for (int i = 0; i < craftProductionLineProcessList.size(); i++) {
+            CraftProductionLineProcess craftProductionLineProcess = craftProductionLineProcessList.get(i);
+            craftProductionLineProcess.setCraftProductionLineId(dto.getId());
+            craftProductionLineProcess.setSort(i + 1);
+        }
+        craftProductionLineProcessService.editLinked(craftProductionLineProcessList,
+                CraftProductionLineProcess::getCraftProductionLineId, dto.getId());
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+        craftProductionLineProcessService.remove(q -> q.eq(CraftProductionLineProcess::getCraftProductionLineId, id));
+    }
+
+}

+ 18 - 0
sd-business/src/main/resources/mapper/craft/CraftProductionLineMapper.xml

@@ -0,0 +1,18 @@
+<?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.sd.business.mapper.craft.CraftProductionLineMapper">
+    <select id="getPage" resultType="com.sd.business.entity.craft.vo.CraftProductionLineVo">
+        select cpl.id,
+               cpl.code,
+               cpl.name,
+               cpl.batch_mode,
+               cpl.remark,
+               cpl.create_user,
+               cpl.create_time,
+               cpl.update_user,
+               cpl.update_time
+        from craft_production_line cpl
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 21 - 0
sd-business/src/main/resources/mapper/craft/CraftProductionLineProcessMapper.xml

@@ -0,0 +1,21 @@
+<?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.sd.business.mapper.craft.CraftProductionLineProcessMapper">
+    <select id="getPage" resultType="com.sd.business.entity.craft.vo.CraftProductionLineProcessVo">
+        select cplp.id,
+               cplp.craft_production_line_id,
+               cplp.craft_process_id,
+               cplp.sort,
+               cplp.equipment_id,
+               cplp.rfid_ip,
+               cplp.rfid_passage,
+               cplp.interface_address,
+               cplp.create_user,
+               cplp.create_time,
+               cplp.update_user,
+               cplp.update_time
+        from craft_production_line_process cplp
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>