Browse Source

[delete]

删除旧版无用的箱子产品对象 workform_box_product_list和系统中对应的前端所有代码和后端所有代码 和对应的系统菜单数据
删除旧版无用的数据采集对象 workform_head和系统中对应的前端所有代码和后端所有代码 和对应的系统菜单数据
dev
liuxiaoxu 1 month ago
parent
commit
39fcf67418
  1. 369
      ruoyi-admin/src/main/java/com/ruoyi/ck/controller/WorkformHeadController.java
  2. 135
      ruoyi-admin/src/main/java/com/ruoyi/ck/domain/WorkformBoxProduct.java
  3. 206
      ruoyi-admin/src/main/java/com/ruoyi/ck/domain/WorkformHead.java
  4. 65
      ruoyi-admin/src/main/java/com/ruoyi/ck/mapper/WorkformBoxProductMapper.java
  5. 80
      ruoyi-admin/src/main/java/com/ruoyi/ck/mapper/WorkformHeadMapper.java
  6. 64
      ruoyi-admin/src/main/java/com/ruoyi/ck/service/IWorkformBoxProductService.java
  7. 87
      ruoyi-admin/src/main/java/com/ruoyi/ck/service/IWorkformHeadService.java
  8. 140
      ruoyi-admin/src/main/java/com/ruoyi/ck/service/impl/WorkformBoxProductServiceImpl.java
  9. 153
      ruoyi-admin/src/main/java/com/ruoyi/ck/service/impl/WorkformHeadServiceImpl.java
  10. 94
      ruoyi-admin/src/main/resources/mapper/ck/WorkformBoxProductMapper.xml
  11. 125
      ruoyi-admin/src/main/resources/mapper/ck/WorkformHeadMapper.xml

369
ruoyi-admin/src/main/java/com/ruoyi/ck/controller/WorkformHeadController.java

@ -1,369 +0,0 @@
//package com.ruoyi.ck.controller;
//
//import com.alibaba.druid.util.StringUtils;
//import com.ruoyi.ck.domain.BoxWorkformHead;
//import com.ruoyi.ck.domain.WorkformBoxProduct;
//import com.ruoyi.ck.domain.WorkformHead;
//import com.ruoyi.ck.service.IBoxWorkformHeadService;
//import com.ruoyi.ck.service.IWorkformBoxProductService;
//import com.ruoyi.ck.service.IWorkformHeadService;
//import com.ruoyi.ck.utils.Result;
//import com.ruoyi.common.annotation.Log;
//import com.ruoyi.common.core.controller.BaseController;
//import com.ruoyi.common.core.page.TableDataInfo;
//import com.ruoyi.common.enums.BusinessType;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
///**
// * 数据采集Controller
// *
// * @author sunzhenhu
// * @date 2021-08-05
// */
//@Controller
//@RequestMapping("/ck/workform")
//public class WorkformHeadController extends BaseController {
// private String prefix = "ck/workform";
//
// @Autowired
// private IBoxWorkformHeadService boxWorkformHeadService;
// @Autowired
// private IWorkformHeadService workformHeadService;
// @Autowired
// private IWorkformBoxProductService workformBoxProductService;
//
//
// @RequiresPermissions("ck:workform:view")
// @GetMapping()
// public String workform() {
// return prefix + "/workform";
// }
//
//
// /**
// * 查询数据采集列表
// */
// @RequestMapping("/list")
// @ResponseBody
// public TableDataInfo list(Long boxId) {
// startPage();
// List<WorkformBoxProduct> list = workformBoxProductService.selectWorkformBoxProductByBoxId(boxId);
// return getDataTable(list);
// }
//
//
// /**
// * 查询数据采集单号
// */
// @PostMapping("/queryByCode")
// @ResponseBody
// public Map<String, Object> queryByCode(@RequestBody WorkformHead workformHead) {
// System.out.println(workformHead);
// Map<String, Object> result = new HashMap<String, Object>();
// WorkformHead workformHead1 = workformHeadService.selectWorkformHeadByCode(workformHead);
// BoxWorkformHead boxWorkformHead = new BoxWorkformHead();
// boxWorkformHead.setWorkformCode(workformHead.getFormCode());
// List<BoxWorkformHead> boxWorkformHeads = boxWorkformHeadService.selectBoxWorkformHeadList(boxWorkformHead);
// result.put("workformHead", workformHead1);
// result.put("boxWorkformHeads", boxWorkformHeads);
// return result;
// }
//
// /**
// * 新增保存数据采集单
// */
// @RequiresPermissions("ck:workform:add")
// @Log(title = "数据采集", businessType = BusinessType.INSERT)
// @PostMapping("/add")
// @ResponseBody
// public Map<String, Object> addSave(WorkformHead workformHead) {
// Map map = new HashMap();
// if (workformHead.getFormCode().equals("")) {
// map.put("value", 0);
// map.put("msg", "添加失败,单号为空");
// return map;
// } else if (workformHead.getFormNeedNum() == null) {
// map.put("value", 0);
// map.put("msg", "添加失败,数量为空");
// return map;
// }
// workformHead.setVendor("JASH1");
// StringBuilder builder = new StringBuilder();
// builder.append("0001K0001");
// workformHead.setBatch(builder.toString());
// workformHead.setFormTemplate("1");
// workformHead.setPassNum(0);
// workformHead.setFaildNum(0);
// int i = workformHeadService.insertWorkformHead(workformHead);
// if (i > 0) {
//// WorkformHead result= workformHeadService.selectWorkformHeadById(workformHead.getId());
// map.put("msg", "添加成功");
// map.put("value", 1);
// map.put("workformHead", workformHead);
// } else {
// map.put("value", 0);
// map.put("msg", "添加失败,单号重复");
// }
//
// return map;
// }
//
//
// @Log(title = "设置box", businessType = BusinessType.OTHER)
// @PostMapping("/setBox")
// @ResponseBody
// public Map<String, Object> setBoxList(BoxWorkformHead boxWorkformHead) {
//
// int i = boxWorkformHeadService.setBoxNumWorkform(boxWorkformHead);
// List<BoxWorkformHead> boxWorkformHeads = boxWorkformHeadService.selectBoxWorkformHeadList(boxWorkformHead);
//
// Map map = new HashMap();
// if (i == 0) {
// map.put("msg", "设置失败");
// map.put("value", 0);
// } else {
// map.put("msg", "设置成功");
// map.put("code", 0);
// map.put("boxWorkformHeads", boxWorkformHeads);
// map.put("value", 1);
// }
// return map;
// }
//
//
// /**
// * 导出数据采集列表
// */
//// @RequiresPermissions("ck:workform:export")
//// @Log(title = "数据采集", businessType = BusinessType.EXPORT)
//// @PostMapping("/export")
//// @ResponseBody
//// public AjaxResult export(WorkformHead workformHead)
//// {
//// List<WorkformHead> list = workformHeadService.selectWorkformHeadList(workformHead);
//// ExcelUtil<WorkformHead> util = new ExcelUtil<WorkformHead>(WorkformHead.class);
//// return util.exportExcel(list, "数据采集数据");
//// }
//
//// /**
//// * 修改数据采集
//// */
//// @GetMapping("/edit/{id}")
//// public String edit(@PathVariable("id") Integer id, ModelMap mmap)
//// {
//// WorkformHead workformHead = workformHeadService.selectWorkformHeadById(id);
//// mmap.put("workformHead", workformHead);
//// return prefix + "/edit";
//// }
//
// /**
// * 修改保存数据采集
// */
// @Log(title = "数据采集", businessType = BusinessType.UPDATE)
// @PostMapping("/edit")
// @ResponseBody
// public Map<String, Object> editSave(WorkformHead workformHead) {
// Map map = new HashMap();
// int i = workformHeadService.updateWorkformHead(workformHead);
// if (i > 0) {
// map.put("msg", "修改成功");
// map.put("value", 1);
// return map;
// } else {
// map.put("msg", "修改失败");
// map.put("value", 0);
// return map;
// }
// }
//
// /**
// * 删除数据采集
// */
// @RequiresPermissions("ck:workform:remove")
// @Log(title = "数据采集", businessType = BusinessType.DELETE)
// @PostMapping("/remove")
// @ResponseBody
// public Result remove(String boxCode)throws Exception {
// if (StringUtils.isEmpty(boxCode)){
// return Result.getFailResult("箱号不能为空!",null);
// }
// return boxWorkformHeadService.deleteBox(boxCode);
// }
//
//
// @GetMapping("/getBox")
// @ResponseBody
// public Map<String, Object> queryBoxById(Long id) {
// BoxWorkformHead boxWorkformHead = boxWorkformHeadService.selectBoxWorkformHeadById(id);
// Map map = new HashMap();
// if (boxWorkformHead == null) {
// map.put("msg", "数据异常");
// map.put("value", 0);
// } else {
// map.put("msg", "查询成功");
// map.put("boxWorkformHead", boxWorkformHead);
// map.put("value", 1);
// }
// return map;
// }
//
// @RequestMapping("/getProductList")
// @ResponseBody
// public Map<String, Object> getProductList(Long boxId) {
// BoxWorkformHead boxWorkformHead = boxWorkformHeadService.selectBoxWorkformHeadById(boxId);
// WorkformHead workformHead = new WorkformHead();
// workformHead.setFormCode(boxWorkformHead.getWorkformCode());
// workformHead = workformHeadService.selectWorkformHeadByCode(workformHead);
// Map map = new HashMap();
// if (boxWorkformHead == null) {
// map.put("msg", "数据异常");
// map.put("value", 0);
// } else {
// map.put("msg", "查询成功");
// map.put("boxWorkformHead", boxWorkformHead);
// map.put("workformHead", workformHead);
// map.put("value", 1);
// }
// return map;
// }
//
//
// /**
// * 新增产品列表
// */
//// @RequiresPermissions("ck:product:add")
// @Log(title = "添加sn", businessType = BusinessType.INSERT)
// @PostMapping("/addSn")
// @ResponseBody
// public Map<String, Object> addSn(@RequestBody WorkformBoxProduct workformBoxProduct) {
// Map map = new HashMap();
// if (workformBoxProduct.getCode().equals("")) {
// map.put("sn", workformBoxProduct.getCode());
// map.put("msg", "内容为空");
// map.put("value", 0);
// }
// int i = workformBoxProductService.insertWorkformBoxProduct(workformBoxProduct);
// if (i == 0) {
// map.put("sn", workformBoxProduct.getCode());
// map.put("msg", "添加失败");
// map.put("value", 0);
// } else if (i == -1) {
// map.put("sn", workformBoxProduct.getCode());
// map.put("msg", "不符合规则");
// map.put("value", -1);
// } else {
// BoxWorkformHead boxWorkformHead = boxWorkformHeadService.selectBoxWorkformHeadById(Long.valueOf(workformBoxProduct.getBoxId()));
// WorkformHead workformHead = new WorkformHead();
// workformHead.setFormCode(boxWorkformHead.getWorkformCode());
// workformHead = workformHeadService.selectWorkformHeadByCode(workformHead);
// workformHead.setPassNum(workformHead.getPassNum() + 1);
// workformHeadService.updateWorkformHead(workformHead);
// map.put("msg", "添加成功");
// map.put("boxWorkformHead", boxWorkformHead);
// map.put("workformHead", workformHead);
// map.put("value", 1);
// }
// return map;
// }
//
//
// //检查上一次产品型号记录
// @PostMapping("/checkWlCode")
// @ResponseBody
// public Map<String, Object> checkWlCode(@RequestBody WorkformHead workformHead) {
// Map map = new HashMap();
// BoxWorkformHead boxWorkformHead = workformHeadService.checkWlCode(workformHead);
// if (boxWorkformHead != null) {
// map.put("msg", "查询成功");
// map.put("boxWorkformHead", boxWorkformHead);
// map.put("value", 1);
// } else {
// map.put("msg", "没有相同型号记录");
// map.put("value", 0);
// }
// return map;
// }
//
//
// //打印标签
// @PostMapping("/print")
// @ResponseBody
// public Map<String, Object> print(@RequestBody BoxWorkformHead boxWorkformHead) {
// Map map = new HashMap();
// boxWorkformHead = boxWorkformHeadService.selectBoxWorkformHeadById(boxWorkformHead.getId());
// int i = boxWorkformHeadService.printBoxTag(boxWorkformHead);
// if (i > 0) {
// boxWorkformHead = boxWorkformHeadService.selectBoxWorkformHeadById(boxWorkformHead.getId());
// map.put("msg", "打印成功");
// map.put("boxWorkformHead", boxWorkformHead);
// map.put("value", 1);
// } else {
// map.put("msg", "异常");
// map.put("value", 0);
// }
// return map;
// }
//
// //箱号扫码查询
// @PostMapping("/boxQuery")
// @ResponseBody
// public Map<String, Object> boxQuery(@RequestBody String qr) {
// Map map = new HashMap();
// //第一位为箱号
// String[] strings = qr.split(";");
// BoxWorkformHead boxWorkformHead = new BoxWorkformHead();
// boxWorkformHead.setBoxCode(strings[0]);
// List<BoxWorkformHead> boxWorkformHeads = boxWorkformHeadService.selectBoxWorkformHeadList(boxWorkformHead);
// if (boxWorkformHeads.size() > 0) {
// boxWorkformHead = boxWorkformHeads.get(0);
// WorkformHead workformHead = new WorkformHead();
// workformHead.setFormCode(boxWorkformHead.getWorkformCode());
// workformHead = workformHeadService.selectWorkformHeadByCode(workformHead);
//
// BoxWorkformHead temp = new BoxWorkformHead();
// temp.setWorkformCode(workformHead.getFormCode());
//
// boxWorkformHeads = boxWorkformHeadService.selectBoxWorkformHeadList(temp);
//
// map.put("msg", "查询成功");
// map.put("boxWorkformHead", boxWorkformHead);
// map.put("boxWorkformHeads", boxWorkformHeads);
// map.put("workformHead", workformHead);
// map.put("value", 1);
// } else {
// map.put("msg", "查询失败");
// map.put("value", 0);
// }
// return map;
// }
//
//
// //sn查询
// @PostMapping("/snQuery")
// @ResponseBody
// public Map<String, Object> snQuery(@RequestBody String qr) {
// WorkformBoxProduct workformBoxProduct = new WorkformBoxProduct();
// workformBoxProduct.setCode(qr);
// List<WorkformBoxProduct> workformBoxProducts = workformBoxProductService.selectWorkformBoxProductList(workformBoxProduct);
// Map map = new HashMap();
// if (workformBoxProducts.size() > 0) {
// workformBoxProduct = workformBoxProducts.get(0);
// BoxWorkformHead boxWorkformHead = boxWorkformHeadService.selectBoxWorkformHeadById(Long.valueOf(workformBoxProduct.getBoxId()));
// map.put("msg", "查询成功");
// map.put("boxWorkformHead", boxWorkformHead);
// map.put("workformBoxProduct", workformBoxProduct);
// map.put("value", 1);
// } else {
// map.put("msg", "查询失败");
// map.put("value", 0);
// }
// return map;
// }
//}

135
ruoyi-admin/src/main/java/com/ruoyi/ck/domain/WorkformBoxProduct.java

@ -1,135 +0,0 @@
package com.ruoyi.ck.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 箱子产品对象 workform_box_product_list
*
* @author sunzhenhu
* @date 2021-08-10
*/
public class WorkformBoxProduct extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 自增主键 */
private Long id;
/** sn号码 */
@Excel(name = "sn号码")
private String code;
/** 箱子代码 */
@Excel(name = "箱子代码")
private String boxCode;
/** 箱子id */
@Excel(name = "箱子id")
private Integer boxId;
/** 备注信息 */
@Excel(name = "备注信息")
private String remake;
/** 属于产品 */
@Excel(name = "属于产品")
private String name;
/** 完成日期 */
@Excel(name = "过站日期")
private String space1;
/** */
@Excel(name = "测试人员")
private String space2;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setBoxCode(String boxCode)
{
this.boxCode = boxCode;
}
public String getBoxCode()
{
return boxCode;
}
public void setBoxId(Integer boxId)
{
this.boxId = boxId;
}
public Integer getBoxId()
{
return boxId;
}
public void setRemake(String remake)
{
this.remake = remake;
}
public String getRemake()
{
return remake;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setSpace1(String space1)
{
this.space1 = space1;
}
public String getSpace1()
{
return space1;
}
public void setSpace2(String space2)
{
this.space2 = space2;
}
public String getSpace2()
{
return space2;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("code", getCode())
.append("boxCode", getBoxCode())
.append("boxId", getBoxId())
.append("remake", getRemake())
.append("name", getName())
.append("space1", getSpace1())
.append("space2", getSpace2())
.toString();
}
}

206
ruoyi-admin/src/main/java/com/ruoyi/ck/domain/WorkformHead.java

@ -1,206 +0,0 @@
package com.ruoyi.ck.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 数据采集对象 workform_head
*
* @author sunzhenhu
* @date 2021-08-05
*/
public class WorkformHead extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Integer id;
/** 表单编码 */
@Excel(name = "表单编码")
private String formCode;
/** 表单模板对应的id */
@Excel(name = "表单模板对应的id")
private String formTemplate;
/** 工单数量 */
@Excel(name = "工单数量")
private Integer formNeedNum;
/** 失败数量 */
@Excel(name = "失败数量")
private Integer faildNum;
/** 过站数量 */
@Excel(name = "过站数量")
private Integer passNum;
/** 产品料号 */
@Excel(name = "产品料号")
private String wlCode;
/** 描述信息 */
@Excel(name = "描述信息")
private String special;
/** 厂商代码 */
@Excel(name = "厂商代码")
private String vendor;
/** 批次 */
@Excel(name = "批次")
private String batch;
private String snPrefix;
private String other;
private String spare1;
private String spare2;
private String spare3;
private String spare4;
public void setId(Integer id)
{
this.id = id;
}
public Integer getId()
{
return id;
}
public void setFormCode(String formCode)
{
this.formCode = formCode;
}
public String getFormCode()
{
return formCode;
}
public void setFormTemplate(String formTemplate)
{
this.formTemplate = formTemplate;
}
public String getFormTemplate()
{
return formTemplate;
}
public void setFormNeedNum(Integer formNeedNum)
{
this.formNeedNum = formNeedNum;
}
public Integer getFormNeedNum()
{
return formNeedNum;
}
public void setFaildNum(Integer faildNum)
{
this.faildNum = faildNum;
}
public Integer getFaildNum()
{
return faildNum;
}
public void setPassNum(Integer passNum)
{
this.passNum = passNum;
}
public Integer getPassNum()
{
return passNum;
}
public void setWlCode(String wlCode)
{
this.wlCode = wlCode;
}
public String getWlCode()
{
return wlCode;
}
public void setSpecial(String special)
{
this.special = special;
}
public String getSpecial()
{
return special;
}
public void setVendor(String vendor)
{
this.vendor = vendor;
}
public String getVendor()
{
return vendor;
}
public void setBatch(String batch)
{
this.batch = batch;
}
public String getBatch()
{
return batch;
}
public String getSnPrefix() {
return snPrefix;
}
public void setSnPrefix(String snPrefix) {
this.snPrefix = snPrefix;
}
public String getSpare1() {
return spare1;
}
public void setSpare1(String spare1) {
this.spare1 = spare1;
}
public String getSpare2() {
return spare2;
}
public void setSpare2(String spare2) {
this.spare2 = spare2;
}
public String getSpare3() {
return spare3;
}
public void setSpare3(String spare3) {
this.spare3 = spare3;
}
public String getSpare4() {
return spare4;
}
public void setSpare4(String spare4) {
this.spare4 = spare4;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getOther() {
return other;
}
public void setOther(String other) {
this.other = other;
}
}

65
ruoyi-admin/src/main/java/com/ruoyi/ck/mapper/WorkformBoxProductMapper.java

@ -1,65 +0,0 @@
package com.ruoyi.ck.mapper;
import com.ruoyi.ck.domain.WorkformBoxProduct;
import java.util.List;
/**
* 箱子产品Mapper接口
*
* @author sunzhenhu
* @date 2021-08-10
*/
public interface WorkformBoxProductMapper
{
/**
* 查询箱子产品
*
* @param id 箱子ID
* @return 箱子产品
*/
public List<WorkformBoxProduct> selectWorkformBoxProductByBoxId(Long id);
/**
* 查询箱子产品列表
*
* @param workformBoxProduct 箱子产品
* @return 箱子产品集合
*/
public List<WorkformBoxProduct> selectWorkformBoxProductList(WorkformBoxProduct workformBoxProduct);
/**
* 新增箱子产品
*
* @param workformBoxProduct 箱子产品
* @return 结果
*/
public int insertWorkformBoxProduct(WorkformBoxProduct workformBoxProduct);
/**
* 修改箱子产品
*
* @param workformBoxProduct 箱子产品
* @return 结果
*/
public int updateWorkformBoxProduct(WorkformBoxProduct workformBoxProduct);
/**
* 删除箱子产品
*
* @param id 箱子产品ID
* @return 结果
*/
public int deleteWorkformBoxProductById(Long id);
/**
* 批量删除箱子产品
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWorkformBoxProductByIds(String[] ids);
public int deleteWorkformBoxProductByBoxId(int boxId);
}

80
ruoyi-admin/src/main/java/com/ruoyi/ck/mapper/WorkformHeadMapper.java

@ -1,80 +0,0 @@
package com.ruoyi.ck.mapper;
import com.ruoyi.ck.domain.WorkformHead;
import java.util.List;
/**
* 数据采集Mapper接口
*
* @author sunzhenhu
* @date 2021-08-05
*/
public interface WorkformHeadMapper
{
/**
* 查询数据采集
*
* @param id 数据采集ID
* @return 数据采集
*/
public WorkformHead selectWorkformHeadById(Integer id);
/**
* 查询数据采集
*
* @param workformHead 数据采集Code
* @return 数据采集
*/
public WorkformHead selectWorkformHeadByCode(WorkformHead workformHead);
/**
* 查询相同型号的数据采集
*
* @param workformHead 型号等相关参数
* @return 数据采集
*/
public List<WorkformHead> selectWorkformHeadByCodeWlCode(WorkformHead workformHead);
/**
* 查询数据采集列表
*
* @param workformHead 数据采集
* @return 数据采集集合
*/
public List<WorkformHead> selectWorkformHeadList(WorkformHead workformHead);
/**
* 新增数据采集
*
* @param workformHead 数据采集
* @return 结果
*/
public int insertWorkformHead(WorkformHead workformHead);
/**
* 修改数据采集
*
* @param workformHead 数据采集
* @return 结果
*/
public int updateWorkformHead(WorkformHead workformHead);
/**
* 删除数据采集
*
* @param id 数据采集ID
* @return 结果
*/
public int deleteWorkformHeadById(Integer id);
/**
* 批量删除数据采集
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWorkformHeadByIds(String[] ids);
}

64
ruoyi-admin/src/main/java/com/ruoyi/ck/service/IWorkformBoxProductService.java

@ -1,64 +0,0 @@
package com.ruoyi.ck.service;
import com.ruoyi.ck.domain.WorkformBoxProduct;
import java.util.List;
/**
* 箱子产品Service接口
*
* @author sunzhenhu
* @date 2021-08-10
*/
public interface IWorkformBoxProductService
{
/**
* 查询箱子产品
*
* @param id 箱子ID
* @return 箱子产品
*/
public List<WorkformBoxProduct> selectWorkformBoxProductByBoxId(Long id);
/**
* 查询箱子产品列表
*
* @param workformBoxProduct 箱子产品
* @return 箱子产品集合
*/
public List<WorkformBoxProduct> selectWorkformBoxProductList(WorkformBoxProduct workformBoxProduct);
/**
* 新增箱子产品
*
* @param workformBoxProduct 箱子产品
* @return 结果
*/
public int insertWorkformBoxProduct(WorkformBoxProduct workformBoxProduct);
/**
* 修改箱子产品
*
* @param workformBoxProduct 箱子产品
* @return 结果
*/
public int updateWorkformBoxProduct(WorkformBoxProduct workformBoxProduct);
/**
* 批量删除箱子产品
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWorkformBoxProductByIds(String ids);
/**
* 删除箱子产品信息
*
* @param id 箱子产品ID
* @return 结果
*/
public int deleteWorkformBoxProductById(Long id);
}

87
ruoyi-admin/src/main/java/com/ruoyi/ck/service/IWorkformHeadService.java

@ -1,87 +0,0 @@
package com.ruoyi.ck.service;
import com.ruoyi.ck.domain.BoxWorkformHead;
import com.ruoyi.ck.domain.WorkformHead;
import java.util.List;
/**
* 数据采集Service接口
*
* @author sunzhenhu
* @date 2021-08-05
*/
public interface IWorkformHeadService
{
/**
* 查询数据采集
*
* @param id 数据采集ID
* @return 数据采集
*/
public WorkformHead selectWorkformHeadById(Integer id);
/**
* 查询数据采集列表
*
* @param workformHead 数据采集
* @return 数据采集集合
*/
public List<WorkformHead> selectWorkformHeadList(WorkformHead workformHead);
/**
* 查询数据采集列表
*
* @param workformHead 数据采集
* @return 数据采集集合
*/
public WorkformHead selectWorkformHeadByCode(WorkformHead workformHead);
/**
* 新增数据采集
*
* @param workformHead 数据采集
* @return 结果
*/
public int insertWorkformHead(WorkformHead workformHead);
/**
* 修改数据采集
*
* @param workformHead 数据采集
* @return 结果
*/
public int updateWorkformHead(WorkformHead workformHead);
/**
* 批量删除数据采集
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWorkformHeadByIds(String ids);
/**
* 删除数据采集信息
*
* @param id 数据采集ID
* @return 结果
*/
public int deleteWorkformHeadById(Integer id);
/**
* 根据产品型号查询箱号规则
*
* @return 结果
*/
public BoxWorkformHead checkWlCode(WorkformHead workformHead);
/**
* 查询相同型号的数据采集
*
* @param workformHead 型号等相关参数
* @return 数据采集
*/
public List<WorkformHead> selectWorkformHeadByCodeWlCode(WorkformHead workformHead);
}

140
ruoyi-admin/src/main/java/com/ruoyi/ck/service/impl/WorkformBoxProductServiceImpl.java

@ -1,140 +0,0 @@
package com.ruoyi.ck.service.impl;
import com.ruoyi.ck.domain.BoxWorkformHead;
import com.ruoyi.ck.domain.WorkformBoxProduct;
import com.ruoyi.ck.domain.WorkformHead;
import com.ruoyi.ck.mapper.BoxWorkformHeadMapper;
import com.ruoyi.ck.mapper.WorkformBoxProductMapper;
import com.ruoyi.ck.mapper.WorkformHeadMapper;
import com.ruoyi.ck.service.IWorkformBoxProductService;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 箱子产品Service业务层处理
*
* @author sunzhenhu
* @date 2021-08-10
*/
@Service
public class WorkformBoxProductServiceImpl implements IWorkformBoxProductService
{
@Autowired
private WorkformBoxProductMapper workformBoxProductMapper;
@Autowired
private BoxWorkformHeadMapper boxWorkformHeadMapper;
@Autowired
private WorkformHeadMapper workformHeadMapper;
@Override
public List<WorkformBoxProduct> selectWorkformBoxProductByBoxId(Long id) {
return workformBoxProductMapper.selectWorkformBoxProductByBoxId(id);
}
/**
* 查询箱子产品列表
*
* @param workformBoxProduct 箱子产品
* @return 箱子产品
*/
@Override
public List<WorkformBoxProduct> selectWorkformBoxProductList(WorkformBoxProduct workformBoxProduct)
{
return workformBoxProductMapper.selectWorkformBoxProductList(workformBoxProduct);
}
/**
* 新增箱子产品
*
* @param workformBoxProduct 箱子产品
* @return 结果
*/
@Override
@Transactional
public int insertWorkformBoxProduct(WorkformBoxProduct workformBoxProduct) {
int i=0;
WorkformBoxProduct temp=new WorkformBoxProduct();
temp.setCode(workformBoxProduct.getCode());
//得到添加的箱子,前后端都判断是否满了
BoxWorkformHead boxWorkformHead=boxWorkformHeadMapper.selectBoxWorkformHeadById(Long.valueOf(workformBoxProduct.getBoxId()));
WorkformHead workformHead=new WorkformHead();
workformHead.setFormCode(boxWorkformHead.getWorkformCode());
workformHead = workformHeadMapper.selectWorkformHeadByCode(workformHead);
String snPrefix = workformHead.getSnPrefix();
//
if (!workformBoxProduct.getCode().contains(snPrefix)){
return -1;
}
//箱子数量满了,结束
if (boxWorkformHead.getCurrNum()>=boxWorkformHead.getMaxNum()){
return i;
}
//判断是否扫过sn
List<WorkformBoxProduct> workformBoxProducts = workformBoxProductMapper.selectWorkformBoxProductList(temp);
if (workformBoxProducts.size()>0){
//扫过,结束
return i;
}
//初始化日期
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateTime=df.format(new Date());
workformBoxProduct.setSpace1(dateTime);
String userName = ShiroUtils.getSysUser().getUserName();
workformBoxProduct.setSpace2(userName);
//添加产品
i=workformBoxProductMapper.insertWorkformBoxProduct(workformBoxProduct);
if (i>0){//添加成功
boxWorkformHead.setCurrNum(boxWorkformHead.getCurrNum()+1);
i=boxWorkformHeadMapper.updateBoxWorkformHead(boxWorkformHead);
}else {//添加失败
return i;
}
return i;
}
/**
* 修改箱子产品
*
* @param workformBoxProduct 箱子产品
* @return 结果
*/
@Override
public int updateWorkformBoxProduct(WorkformBoxProduct workformBoxProduct)
{
return workformBoxProductMapper.updateWorkformBoxProduct(workformBoxProduct);
}
/**
* 删除箱子产品对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteWorkformBoxProductByIds(String ids)
{
return workformBoxProductMapper.deleteWorkformBoxProductByIds(Convert.toStrArray(ids));
}
/**
* 删除箱子产品信息
*
* @param id 箱子产品ID
* @return 结果
*/
@Override
public int deleteWorkformBoxProductById(Long id)
{
return workformBoxProductMapper.deleteWorkformBoxProductById(id);
}
}

153
ruoyi-admin/src/main/java/com/ruoyi/ck/service/impl/WorkformHeadServiceImpl.java

@ -1,153 +0,0 @@
package com.ruoyi.ck.service.impl;
import com.ruoyi.ck.domain.BoxWorkformHead;
import com.ruoyi.ck.domain.WorkformHead;
import com.ruoyi.ck.mapper.BoxWorkformHeadMapper;
import com.ruoyi.ck.mapper.WorkformHeadMapper;
import com.ruoyi.ck.service.IWorkformHeadService;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 数据采集Service业务层处理
*
* @author sunzhenhu
* @date 2021-08-05
*/
@Service
public class WorkformHeadServiceImpl implements IWorkformHeadService
{
@Autowired
private WorkformHeadMapper workformHeadMapper;
@Autowired
private BoxWorkformHeadMapper boxWorkformHeadMapper;
/**
* 查询数据采集
*
* @param id 数据采集ID
* @return 数据采集
*/
@Override
public WorkformHead selectWorkformHeadById(Integer id)
{
return workformHeadMapper.selectWorkformHeadById(id);
}
/**
* 查询数据采集列表
*
* @param workformHead 数据采集
* @return 数据采集
*/
@Override
public List<WorkformHead> selectWorkformHeadList(WorkformHead workformHead)
{
return workformHeadMapper.selectWorkformHeadList(workformHead);
}
@Override
public WorkformHead selectWorkformHeadByCode(WorkformHead workformHead) {
return workformHeadMapper.selectWorkformHeadByCode(workformHead);
}
/**
* 新增数据采集
*
* @param workformHead 数据采集
* @return 结果
*/
@Override
public int insertWorkformHead(WorkformHead workformHead)
{
// WorkformHead workformHead1 = workformHeadMapper.selectWorkformHeadByCode(temp);
if (workformHead.getSnPrefix()!=null&&!workformHead.getSnPrefix().equals("")){
WorkformHead isContain = workformHeadMapper.selectWorkformHeadByCode(workformHead);
if (isContain!=null){
return 0;
}else {
workformHead.setCreateTime(DateUtils.getNowDate());
}
}
return workformHeadMapper.insertWorkformHead(workformHead);
}
/**
* 修改数据采集
*
* @param workformHead 数据采集
* @return 结果
*/
@Override
public int updateWorkformHead(WorkformHead workformHead)
{
return workformHeadMapper.updateWorkformHead(workformHead);
}
/**
* 删除数据采集对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteWorkformHeadByIds(String ids)
{
return workformHeadMapper.deleteWorkformHeadByIds(Convert.toStrArray(ids));
}
/**
* 删除数据采集信息
*
* @param id 数据采集ID
* @return 结果
*/
@Override
public int deleteWorkformHeadById(Integer id)
{
return workformHeadMapper.deleteWorkformHeadById(id);
}
/**
* 根据产品型号查询箱号规则
* @param workformHead 产品相关信息
* @return 结果
*/
@Override
public BoxWorkformHead checkWlCode(WorkformHead workformHead) {
List<WorkformHead> workformHeadList = workformHeadMapper.selectWorkformHeadByCodeWlCode(workformHead);
System.out.println(workformHeadList);
if (workformHeadList.size()<=0){
return null;
}
workformHead=workformHeadList.get(workformHeadList.size()-1);
BoxWorkformHead boxWorkformHead=new BoxWorkformHead();
boxWorkformHead.setWorkformCode(workformHead.getFormCode());
List<BoxWorkformHead> boxWorkformHeadList = boxWorkformHeadMapper.selectBoxWorkformHeadList(boxWorkformHead);
if (boxWorkformHeadList.size()<=0){
return null;
}
boxWorkformHead=boxWorkformHeadList.get(boxWorkformHeadList.size()-1);
return boxWorkformHead;
}
/**
* 查询相同型号的数据采集
*
* @param workformHead 型号等相关参数
* @return 数据采集
*/
@Override
public List<WorkformHead> selectWorkformHeadByCodeWlCode(WorkformHead workformHead) {
return workformHeadMapper.selectWorkformHeadByCodeWlCode(workformHead);
}
}

94
ruoyi-admin/src/main/resources/mapper/ck/WorkformBoxProductMapper.xml

@ -1,94 +0,0 @@
<?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.ck.mapper.WorkformBoxProductMapper">
<resultMap type="WorkformBoxProduct" id="WorkformBoxProductResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="boxCode" column="box_code" />
<result property="boxId" column="box_id" />
<result property="remake" column="remake" />
<result property="name" column="name" />
<result property="space1" column="space1" />
<result property="space2" column="space2" />
</resultMap>
<sql id="selectWorkformBoxProductVo">
select id, code, box_code, box_id, remake, name, space1, space2 from workform_box_product_list
</sql>
<select id="selectWorkformBoxProductList" parameterType="WorkformBoxProduct" resultMap="WorkformBoxProductResult">
<include refid="selectWorkformBoxProductVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="boxCode != null and boxCode != ''"> and box_code = #{boxCode}</if>
<if test="boxId != null "> and box_id = #{boxId}</if>
<if test="remake != null and remake != ''"> and remake = #{remake}</if>
<if test="name != null and name != ''"> and name = #{name}</if>
<if test="space1 != null and space1 != ''"> and space1 = #{space1}</if>
<if test="space2 != null and space2 != ''"> and space2 = #{space2}</if>
</where>
</select>
<select id="selectWorkformBoxProductByBoxId" parameterType="Long" resultMap="WorkformBoxProductResult">
<include refid="selectWorkformBoxProductVo"/>
where box_id = #{boxId}
Order BY id DESC
</select>
<insert id="insertWorkformBoxProduct" parameterType="WorkformBoxProduct" useGeneratedKeys="true" keyProperty="id">
insert into workform_box_product_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null">code,</if>
<if test="boxCode != null and boxCode != ''">box_code,</if>
<if test="boxId != null">box_id,</if>
<if test="remake != null">remake,</if>
<if test="name != null">name,</if>
<if test="space1 != null">space1,</if>
<if test="space2 != null">space2,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null">#{code},</if>
<if test="boxCode != null and boxCode != ''">#{boxCode},</if>
<if test="boxId != null">#{boxId},</if>
<if test="remake != null">#{remake},</if>
<if test="name != null">#{name},</if>
<if test="space1 != null">#{space1},</if>
<if test="space2 != null">#{space2},</if>
</trim>
</insert>
<update id="updateWorkformBoxProduct" parameterType="WorkformBoxProduct">
update workform_box_product_list
<trim prefix="SET" suffixOverrides=",">
<if test="code != null">code = #{code},</if>
<if test="boxCode != null and boxCode != ''">box_code = #{boxCode},</if>
<if test="boxId != null">box_id = #{boxId},</if>
<if test="remake != null">remake = #{remake},</if>
<if test="name != null">name = #{name},</if>
<if test="space1 != null">space1 = #{space1},</if>
<if test="space2 != null">space2 = #{space2},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWorkformBoxProductById" parameterType="Long">
delete from workform_box_product_list where id = #{id}
</delete>
<delete id="deleteWorkformBoxProductByBoxId" parameterType="int">
delete from workform_box_product_list where box_id = #{boxId}
</delete>
<delete id="deleteWorkformBoxProductByIds" parameterType="String">
delete from workform_box_product_list where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

125
ruoyi-admin/src/main/resources/mapper/ck/WorkformHeadMapper.xml

@ -1,125 +0,0 @@
<?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.ck.mapper.WorkformHeadMapper">
<resultMap type="WorkformHead" id="WorkformHeadResult">
<result property="id" column="id" />
<result property="formCode" column="form_code" />
<result property="formTemplate" column="form_template" />
<result property="formNeedNum" column="form_need_num" />
<result property="faildNum" column="faild_num" />
<result property="passNum" column="pass_num" />
<result property="createTime" column="create_time" />
<result property="wlCode" column="wlCode" />
<result property="special" column="special" />
<result property="vendor" column="vendor" />
<result property="batch" column="batch" />
<result property="snPrefix" column="sn_prefix" />
<result property="other" column="other" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
</resultMap>
<sql id="selectWorkformHeadVo">
select id, form_code, form_template, form_need_num, faild_num, pass_num, create_time, wlCode, special, vendor, batch ,sn_prefix,other,spare1,spare2,spare3,spare4 from workform_head
</sql>
<select id="selectWorkformHeadList" parameterType="WorkformHead" resultMap="WorkformHeadResult">
<include refid="selectWorkformHeadVo"/>
<where>
<if test="formCode != null and formCode != ''"> and form_code = #{formCode}</if>
<if test="formTemplate != null and formTemplate != ''"> and form_template = #{formTemplate}</if>
<if test="formNeedNum != null "> and form_need_num = #{formNeedNum}</if>
<if test="faildNum != null "> and faild_num = #{faildNum}</if>
<if test="passNum != null "> and pass_num = #{passNum}</if>
<if test="wlCode != null and wlCode != ''"> and wlCode = #{wlCode}</if>
<if test="special != null and special != ''"> and special = #{special}</if>
<if test="vendor != null and vendor != ''"> and vendor = #{vendor}</if>
<if test="batch != null and batch != ''"> and batch = #{batch}</if>
<if test="snPrefix != null and batch != ''"> and snPrefix = #{snPrefix}</if>
<if test="other != null and batch != ''"> and other = #{other}</if>
</where>
</select>
<select id="selectWorkformHeadById" parameterType="Integer" resultMap="WorkformHeadResult">
<include refid="selectWorkformHeadVo"/>
where id = #{id}
</select>
<select id="selectWorkformHeadByCode" parameterType="WorkformHead" resultMap="WorkformHeadResult">
<include refid="selectWorkformHeadVo"/>
where form_code = #{formCode}
</select>
<select id="selectWorkformHeadByCodeWlCode" parameterType="WorkformHead" resultMap="WorkformHeadResult">
<include refid="selectWorkformHeadVo"/>
where form_code != #{formCode} and wlCode = #{wlCode}
</select>
<insert id="insertWorkformHead" parameterType="WorkformHead" useGeneratedKeys="true" keyProperty="id">
insert into workform_head
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="formCode != null">form_code,</if>
<if test="formTemplate != null">form_template,</if>
<if test="formNeedNum != null">form_need_num,</if>
<if test="faildNum != null">faild_num,</if>
<if test="passNum != null">pass_num,</if>
<if test="createTime != null">create_time,</if>
<if test="wlCode != null">wlCode,</if>
<if test="special != null">special,</if>
<if test="vendor != null">vendor,</if>
<if test="batch != null">batch,</if>
<if test="snPrefix != null">sn_Prefix,</if>
<if test="other != null">other,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="formCode != null">#{formCode},</if>
<if test="formTemplate != null">#{formTemplate},</if>
<if test="formNeedNum != null">#{formNeedNum},</if>
<if test="faildNum != null">#{faildNum},</if>
<if test="passNum != null">#{passNum},</if>
<if test="createTime != null">#{createTime},</if>
<if test="wlCode != null">#{wlCode},</if>
<if test="special != null">#{special},</if>
<if test="vendor != null">#{vendor},</if>
<if test="batch != null">#{batch},</if>
<if test="snPrefix != null">#{snPrefix},</if>
<if test="other != null">#{other},</if>
</trim>
</insert>
<update id="updateWorkformHead" parameterType="WorkformHead">
update workform_head
<trim prefix="SET" suffixOverrides=",">
<if test="formCode != null">form_code = #{formCode},</if>
<if test="formTemplate != null">form_template = #{formTemplate},</if>
<if test="formNeedNum != null">form_need_num = #{formNeedNum},</if>
<if test="faildNum != null">faild_num = #{faildNum},</if>
<if test="passNum != null">pass_num = #{passNum},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="wlCode != null">wlCode = #{wlCode},</if>
<if test="special != null">special = #{special},</if>
<if test="vendor != null">vendor = #{vendor},</if>
<if test="batch != null">batch = #{batch},</if>
<if test="snPrefix != null">sn_Prefix = #{snPrefix},</if>
<if test="other != null">other = #{other},</if>
</trim>
where form_code = #{formCode}
</update>
<delete id="deleteWorkformHeadById" parameterType="Integer">
delete from workform_head where id = #{id}
</delete>
<delete id="deleteWorkformHeadByIds" parameterType="String">
delete from workform_head where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save