diff --git a/ruoyi-admin/src/main/java/com/ruoyi/ck/controller/BomController.java b/ruoyi-admin/src/main/java/com/ruoyi/ck/controller/BomController.java deleted file mode 100644 index a16f42bb..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/ck/controller/BomController.java +++ /dev/null @@ -1,224 +0,0 @@ -package com.ruoyi.ck.controller; - -import com.alibaba.fastjson.JSONObject; -import com.ruoyi.ck.domain.Bom; -import com.ruoyi.ck.domain.ItemInfo; -import com.ruoyi.ck.service.IBomService; -import com.ruoyi.ck.service.impl.ItemCPInfoServiceImpl; -import com.ruoyi.ck.utils.Result; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.ShiroUtils; -import com.ruoyi.common.utils.poi.ExcelUtil; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.List; - -/** - * 物料清单Controller - * - * @author ruoyi - * @date 2021-06-21 - */ -@Controller -@RequestMapping("/ck/bom") -public class BomController extends BaseController { - private String prefix = "ck/bom"; - - @Autowired - private IBomService bomService; - - @Autowired - private ItemCPInfoServiceImpl itemCPInfoService; - - @RequiresPermissions("ck:bom:view") - @GetMapping() - public String bom() { - return prefix + "/bom"; - } - - /** - * 查询物料清单列表 - */ - @RequiresPermissions("ck:bom:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(Bom bom) { - //startPage(); - List list = bomService.selectBomListByGroup(bom); - List data = calculateBomHierarchy(list, 1); - return getDataTable(data); - } - - /** - * 查询物料清单列表 - */ - @RequiresPermissions("ck:bom:list") - @PostMapping("/allList") - @ResponseBody - public TableDataInfo getList(Bom bom) { - //System.out.println(bom); - startPage(); - List list = bomService.selectBomList(bom); - return getDataTable(list); - } - - /** - * 导出物料清单列表 - */ - @RequiresPermissions("ck:bom:export") - @Log(title = "物料清单", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ResponseBody - public AjaxResult export(Bom bom) { - List list = bomService.selectBomList(bom); - ExcelUtil util = new ExcelUtil(Bom.class); - return util.exportExcel(list, "物料清单数据"); - } - - /** - * 导入宿舍列表 - */ - @PostMapping("/importData") - @ResponseBody - public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception - { - ExcelUtil util = new ExcelUtil(ItemInfo.class); - List userList = util.importExcel(file.getInputStream()); - String operName = ShiroUtils.getSysUser().getLoginName(); - String message = itemCPInfoService.importItem(userList, updateSupport, operName); - return AjaxResult.success(message); - } - /**、 - * 导出模板 - */ - @GetMapping("/importTemplate") - @ResponseBody - public AjaxResult importTemplate() - { - ExcelUtil util = new ExcelUtil(ItemInfo.class); - return util.importTemplateExcel("物料模板"); - } - - /** - * 新增物料清单 - */ - @GetMapping("/add") - public String add() { - return prefix + "/add"; - } - -// /** -// * 新增保存物料清单 -// */ -// @RequiresPermissions("ck:bom:add") -// @Log(title = "物料清单", businessType = BusinessType.INSERT) -// @PostMapping("/add") -// @ResponseBody -// public AjaxResult addSave(Bom bom) -// { -// return toAjax(bomService.insertBom(bom)); -// } - - /** - * 新增保存物料清单 - */ - @RequiresPermissions("ck:bom:add") - @Log(title = "物料清单", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public Result addSave(String jsonStr) throws Exception { - JSONObject jsonObject = JSONObject.parseObject(jsonStr); - Bom bom = jsonObject.toJavaObject(Bom.class); - return bomService.insertBom(bom); - } - - /** - * 修改物料清单 - */ - @GetMapping("/edit/{versionNo}/{cpCode}") - public String edit(@PathVariable("versionNo") String versionNo, @PathVariable("cpCode") String cpCode, ModelMap mmap) throws UnsupportedEncodingException { - Bom bom = new Bom(); - //String encode = URLEncoder.encode(cpCode, "GBK"); - bom.setVersionNo(versionNo); - bom.setCpCode(cpCode); - //System.out.println(bom); - List list = bomService.selectBomList(bom); - System.out.println(list.size()); - Bom temp = new Bom(); - if (list.size() > 0) { - temp = list.get(0); - } - mmap.put("bom", temp); - return prefix + "/edit"; - } - - /** - * 查询对应成品的原料清单列表 - */ - @RequiresPermissions("ck:bom:cpyllist") - @PostMapping("/cpyllist") - @ResponseBody - public TableDataInfo cpylList(Bom bom) { - startPage(); - List list = bomService.selectBomListByCodeVersion(bom); - return getDataTable(list); - } - - - /** - * 修改保存物料清单 - */ - @RequiresPermissions("ck:bom:edit") - @Log(title = "物料清单", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public Result editSave(String jsonStr) throws Exception{ - JSONObject jsonObject = JSONObject.parseObject(jsonStr); - Bom bom = jsonObject.toJavaObject(Bom.class); - return Result.getSuccessResult(bomService.updateBom(bom)); - } - - /** - * 删除物料清单 - */ - @RequiresPermissions("ck:bom:remove") - @Log(title = "物料清单", businessType = BusinessType.DELETE) - @PostMapping("/removeByCpcode") - @ResponseBody - public AjaxResult remove(Bom bom) { -// System.out.println(bom); - return toAjax(bomService.deleteByItem(bom)); -// return toAjax(1); - } - - - //计算bom阶级 - private List calculateBomHierarchy(List bomList, int bomClass) { - List finalList = new ArrayList<>(); - List tempList = new ArrayList<>(); - Bom tempBom = new Bom(); - for (Bom bom : bomList) { - bom.setBomHierarchy(bomClass + ""); - finalList.add(bom); - tempBom.setCpCode(bom.getWlCode()); - List boms = bomService.selectBomList(tempBom); - if (boms != null && boms.size() > 0) { - tempList = calculateBomHierarchy(boms, bomClass + 1); - } - } - finalList.addAll(tempList); - return finalList; - } - -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/ck/domain/Bom.java b/ruoyi-admin/src/main/java/com/ruoyi/ck/domain/Bom.java deleted file mode 100644 index 19c93075..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/ck/domain/Bom.java +++ /dev/null @@ -1,735 +0,0 @@ -package com.ruoyi.ck.domain; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * 物料清单对象 bom - * - * @author ruoyi - * @date 2021-06-21 - */ -public class Bom extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** */ - @Excel(name = "") - private String versionNo; - - /** 成品编号 */ - @Excel(name = "成品编号") - private String cpCode; - - /** 成品名称 */ - @Excel(name = "成品名称") - private String cpName; - - /** */ - @Excel(name = "") - private String cpType; - - /** */ - @Excel(name = "") - private String cpMachineNo; - - /** */ - @Excel(name = "") - private String cpDw; - - /** */ - @Excel(name = "") - private String wlCode; - - /** 道具名称 */ - @Excel(name = "道具名称") - private String itemname; - - /** 道具描述 */ - @Excel(name = "道具描述") - private String itemstandard; - - /** */ - @Excel(name = "") - private String stockDw; - - /** 使用量 */ - @Excel(name = "使用量") - private BigDecimal useNum; - - /** */ - @Excel(name = "") - private BigDecimal lostpre; - - /** */ - @Excel(name = "") - private String zpGuige; - - /** */ - @Excel(name = "") - private BigDecimal zpUseNum; - - /** */ - @Excel(name = "") - private Long mQty; - - /** */ - @Excel(name = "") - private String memolist; - - /** */ - @Excel(name = "") - private Integer nowversion; - - /** */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") - private Date begindate; - - /** */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") - private Date endtime; - - /** */ - @Excel(name = "") - private String wldm; - - /** */ - @Excel(name = "") - private String customno; - - /** */ - @Excel(name = "") - private Integer sendflag; - - /** */ - @Excel(name = "") - private Long YDWDH; - - /** */ - @Excel(name = "") - private Long ZLDWDH; - - /** */ - @Excel(name = "") - private Long ylWeight; - - /** */ - @Excel(name = "") - private Long zongzhongWeight; - - /** */ - @Excel(name = "") - private String pno; - - /** */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") - private Date Addtime; - - /** */ - @Excel(name = "") - private BigDecimal fuWidth; - - /** */ - @Excel(name = "") - private String yflItemclass; - - /** */ - @Excel(name = "") - private String mouldNo; - - /** */ - @Excel(name = "") - private Long standNowversion; - - /** */ - @Excel(name = "") - private Long comfirmFlag; - - /** */ - @Excel(name = "") - private String comfirmMan; - - /** */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") - private Date comfirmDate; - - /** */ - @Excel(name = "") - private String writeMan; - - /** */ - @Excel(name = "") - private String GongCha; - - /** */ - @Excel(name = "") - private String factoryMouldNo; - - /** */ - @Excel(name = "") - private Long mainMaterial; - - /** */ - @Excel(name = "") - private Long limitFlag; - - /** */ - @Excel(name = "") - private BigDecimal gongchaMore; - - /** */ - @Excel(name = "") - private BigDecimal gongchaSmall; - - /** */ - @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") - @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss") - private Date changtime; - - /** */ - @Excel(name = "") - private Long cpNum; - - /** */ - @Excel(name = "") - private String worklineclass; - - private List bomList; - - private String bomHierarchy; - - public String getBomHierarchy() { - return bomHierarchy; - } - - public void setBomHierarchy(String bomHierarchy) { - this.bomHierarchy = bomHierarchy; - } - - public List getBomList() { - return bomList; - } - - public void setBomList(List bomList) { - this.bomList = bomList; - } - - public void setVersionNo(String versionNo) - { - this.versionNo = versionNo; - } - - public String getVersionNo() - { - return versionNo; - } - public void setCpCode(String cpCode) - { - this.cpCode = cpCode; - } - - public String getCpCode() - { - return cpCode; - } - public void setCpName(String cpName) - { - this.cpName = cpName; - } - - public String getCpName() - { - return cpName; - } - public void setCpType(String cpType) - { - this.cpType = cpType; - } - - public String getCpType() - { - return cpType; - } - public void setCpMachineNo(String cpMachineNo) - { - this.cpMachineNo = cpMachineNo; - } - - public String getCpMachineNo() - { - return cpMachineNo; - } - public void setCpDw(String cpDw) - { - this.cpDw = cpDw; - } - - public String getCpDw() - { - return cpDw; - } - public void setWlCode(String wlCode) - { - this.wlCode = wlCode; - } - - public String getWlCode() - { - return wlCode; - } - - public String getItemname() { - return itemname; - } - - public void setItemname(String itemname) { - this.itemname = itemname; - } - - public String getItemstandard() { - return itemstandard; - } - - public void setItemstandard(String itemstandard) { - this.itemstandard = itemstandard; - } - - public void setStockDw(String stockDw) - { - this.stockDw = stockDw; - } - - public String getStockDw() - { - return stockDw; - } - public void setUseNum(BigDecimal useNum) - { - this.useNum = useNum; - } - - public BigDecimal getUseNum() - { - return useNum; - } - public void setLostpre(BigDecimal lostpre) - { - this.lostpre = lostpre; - } - - public BigDecimal getLostpre() - { - return lostpre; - } - public void setZpGuige(String zpGuige) - { - this.zpGuige = zpGuige; - } - - public String getZpGuige() - { - return zpGuige; - } - public void setZpUseNum(BigDecimal zpUseNum) - { - this.zpUseNum = zpUseNum; - } - - public BigDecimal getZpUseNum() - { - return zpUseNum; - } - public void setmQty(Long mQty) - { - this.mQty = mQty; - } - - public Long getmQty() - { - return mQty; - } - public void setMemolist(String memolist) - { - this.memolist = memolist; - } - - public String getMemolist() - { - return memolist; - } - public void setNowversion(Integer nowversion) - { - this.nowversion = nowversion; - } - - public Integer getNowversion() - { - return nowversion; - } - public void setBegindate(Date begindate) - { - this.begindate = begindate; - } - - public Date getBegindate() - { - return begindate; - } - public void setEndtime(Date endtime) - { - this.endtime = endtime; - } - - public Date getEndtime() - { - return endtime; - } - public void setWldm(String wldm) - { - this.wldm = wldm; - } - - public String getWldm() - { - return wldm; - } - public void setCustomno(String customno) - { - this.customno = customno; - } - - public String getCustomno() - { - return customno; - } - public void setSendflag(Integer sendflag) - { - this.sendflag = sendflag; - } - - public Integer getSendflag() - { - return sendflag; - } - public void setYDWDH(Long YDWDH) - { - this.YDWDH = YDWDH; - } - - public Long getYDWDH() - { - return YDWDH; - } - public void setZLDWDH(Long ZLDWDH) - { - this.ZLDWDH = ZLDWDH; - } - - public Long getZLDWDH() - { - return ZLDWDH; - } - public void setYlWeight(Long ylWeight) - { - this.ylWeight = ylWeight; - } - - public Long getYlWeight() - { - return ylWeight; - } - public void setZongzhongWeight(Long zongzhongWeight) - { - this.zongzhongWeight = zongzhongWeight; - } - - public Long getZongzhongWeight() - { - return zongzhongWeight; - } - public void setPno(String pno) - { - this.pno = pno; - } - - public String getPno() - { - return pno; - } - public void setAddtime(Date Addtime) - { - this.Addtime = Addtime; - } - - public Date getAddtime() - { - return Addtime; - } - public void setFuWidth(BigDecimal fuWidth) - { - this.fuWidth = fuWidth; - } - - public BigDecimal getFuWidth() - { - return fuWidth; - } - public void setYflItemclass(String yflItemclass) - { - this.yflItemclass = yflItemclass; - } - - public String getYflItemclass() - { - return yflItemclass; - } - public void setMouldNo(String mouldNo) - { - this.mouldNo = mouldNo; - } - - public String getMouldNo() - { - return mouldNo; - } - public void setStandNowversion(Long standNowversion) - { - this.standNowversion = standNowversion; - } - - public Long getStandNowversion() - { - return standNowversion; - } - public void setComfirmFlag(Long comfirmFlag) - { - this.comfirmFlag = comfirmFlag; - } - - public Long getComfirmFlag() - { - return comfirmFlag; - } - public void setComfirmMan(String comfirmMan) - { - this.comfirmMan = comfirmMan; - } - - public String getComfirmMan() - { - return comfirmMan; - } - public void setComfirmDate(Date comfirmDate) - { - this.comfirmDate = comfirmDate; - } - - public Date getComfirmDate() - { - return comfirmDate; - } - public void setWriteMan(String writeMan) - { - this.writeMan = writeMan; - } - - public String getWriteMan() - { - return writeMan; - } - public void setGongCha(String GongCha) - { - this.GongCha = GongCha; - } - - public String getGongCha() - { - return GongCha; - } - public void setFactoryMouldNo(String factoryMouldNo) - { - this.factoryMouldNo = factoryMouldNo; - } - - public String getFactoryMouldNo() - { - return factoryMouldNo; - } - public void setMainMaterial(Long mainMaterial) - { - this.mainMaterial = mainMaterial; - } - - public Long getMainMaterial() - { - return mainMaterial; - } - public void setLimitFlag(Long limitFlag) - { - this.limitFlag = limitFlag; - } - - public Long getLimitFlag() - { - return limitFlag; - } - public void setGongchaMore(BigDecimal gongchaMore) - { - this.gongchaMore = gongchaMore; - } - - public BigDecimal getGongchaMore() - { - return gongchaMore; - } - public void setGongchaSmall(BigDecimal gongchaSmall) - { - this.gongchaSmall = gongchaSmall; - } - - public BigDecimal getGongchaSmall() - { - return gongchaSmall; - } - public void setChangtime(Date changtime) - { - this.changtime = changtime; - } - - public Date getChangtime() - { - return changtime; - } - public void setCpNum(Long cpNum) - { - this.cpNum = cpNum; - } - - public Long getCpNum() - { - return cpNum; - } - public void setWorklineclass(String worklineclass) - { - this.worklineclass = worklineclass; - } - - public String getWorklineclass() - { - return worklineclass; - } - -// @Override -// public String toString() { -// return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) -// .append("versionNo", getVersionNo()) -// .append("cpCode", getCpCode()) -// .append("cpName", getCpName()) -// .append("cpType", getCpType()) -// .append("cpMachineNo", getCpMachineNo()) -// .append("cpDw", getCpDw()) -// .append("wlCode", getWlCode()) -// .append("itemname", getItemname()) -// .append("itemstandard", getItemstandard()) -// .append("stockDw", getStockDw()) -// .append("useNum", getUseNum()) -// .append("lostpre", getLostpre()) -// .append("zpGuige", getZpGuige()) -// .append("zpUseNum", getZpUseNum()) -// .append("mQty", getmQty()) -// .append("memolist", getMemolist()) -// .append("nowversion", getNowversion()) -// .append("begindate", getBegindate()) -// .append("endtime", getEndtime()) -// .append("wldm", getWldm()) -// .append("customno", getCustomno()) -// .append("sendflag", getSendflag()) -// .append("YDWDH", getYDWDH()) -// .append("ZLDWDH", getZLDWDH()) -// .append("ylWeight", getYlWeight()) -// .append("zongzhongWeight", getZongzhongWeight()) -// .append("pno", getPno()) -// .append("Addtime", getAddtime()) -// .append("fuWidth", getFuWidth()) -// .append("yflItemclass", getYflItemclass()) -// .append("mouldNo", getMouldNo()) -// .append("standNowversion", getStandNowversion()) -// .append("comfirmFlag", getComfirmFlag()) -// .append("comfirmMan", getComfirmMan()) -// .append("comfirmDate", getComfirmDate()) -// .append("writeMan", getWriteMan()) -// .append("GongCha", getGongCha()) -// .append("factoryMouldNo", getFactoryMouldNo()) -// .append("mainMaterial", getMainMaterial()) -// .append("limitFlag", getLimitFlag()) -// .append("gongchaMore", getGongchaMore()) -// .append("gongchaSmall", getGongchaSmall()) -// .append("changtime", getChangtime()) -// .append("cpNum", getCpNum()) -// .append("worklineclass", getWorklineclass()) -// .toString(); -// } - - - @Override - public String toString() { - return "Bom{" + - "versionNo='" + versionNo + '\'' + - ", cpCode='" + cpCode + '\'' + - ", cpName='" + cpName + '\'' + - ", cpType='" + cpType + '\'' + - ", cpMachineNo='" + cpMachineNo + '\'' + - ", cpDw='" + cpDw + '\'' + - ", wlCode='" + wlCode + '\'' + - ", itemname='" + itemname + '\'' + - ", itemstandard='" + itemstandard + '\'' + - ", stockDw='" + stockDw + '\'' + - ", useNum=" + useNum + - ", lostpre=" + lostpre + - ", zpGuige='" + zpGuige + '\'' + - ", zpUseNum=" + zpUseNum + - ", mQty=" + mQty + - ", memolist='" + memolist + '\'' + - ", nowversion=" + nowversion + - ", begindate=" + begindate + - ", endtime=" + endtime + - ", wldm='" + wldm + '\'' + - ", customno='" + customno + '\'' + - ", sendflag=" + sendflag + - ", YDWDH=" + YDWDH + - ", ZLDWDH=" + ZLDWDH + - ", ylWeight=" + ylWeight + - ", zongzhongWeight=" + zongzhongWeight + - ", pno='" + pno + '\'' + - ", Addtime=" + Addtime + - ", fuWidth=" + fuWidth + - ", yflItemclass='" + yflItemclass + '\'' + - ", mouldNo='" + mouldNo + '\'' + - ", standNowversion=" + standNowversion + - ", comfirmFlag=" + comfirmFlag + - ", comfirmMan='" + comfirmMan + '\'' + - ", comfirmDate=" + comfirmDate + - ", writeMan='" + writeMan + '\'' + - ", GongCha='" + GongCha + '\'' + - ", factoryMouldNo='" + factoryMouldNo + '\'' + - ", mainMaterial=" + mainMaterial + - ", limitFlag=" + limitFlag + - ", gongchaMore=" + gongchaMore + - ", gongchaSmall=" + gongchaSmall + - ", changtime=" + changtime + - ", cpNum=" + cpNum + - ", worklineclass='" + worklineclass + '\'' + - ", bomList=" + bomList + - ", bomHierarchy='" + bomHierarchy + '\'' + - '}'; - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/ck/mapper/BomMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/ck/mapper/BomMapper.java deleted file mode 100644 index 69902921..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/ck/mapper/BomMapper.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.ruoyi.ck.mapper; - -import com.ruoyi.ck.domain.Bom; - -import java.util.List; - -/** - * 物料清单Mapper接口 - * - * @author ruoyi - * @date 2021-06-21 - */ -public interface BomMapper -{ - /** - * 查询物料清单 - * - * @param versionNo 物料清单ID - * @return 物料清单 - */ - public Bom selectBomById(String versionNo); - - /** - * 查询物料清单列表 - * - * @param bom 物料清单 - * @return 物料清单集合 - */ - public List selectBomList(Bom bom); - - - /** - * 查询物料清单并根据成品代码分组 - * - * @param bom 物料清单 - * @return 物料清单集合 - */ - public List selectBomGroupByCPCode(Bom bom); - - /** - * 根据成品代码查询原料 - * - * @param bom 物料清单 - * @return 原料清单集合 - */ - public List selectBomListByCodeVersion(Bom bom); - - /** - * 新增物料清单 - * - * @param bom 物料清单 - * @return 结果 - */ - public int insertBom(Bom bom); - - /** - * 修改物料清单 - * - * @param bom 物料清单 - * @return 结果 - */ - public int updateBom(Bom bom); - - /** - * 删除物料清单 - * - * @param versionNo 物料清单ID - * @return 结果 - */ - public int deleteBomById(String versionNo); - - /** - * 批量删除物料清单 - * - * @param versionNos 需要删除的数据ID - * @return 结果 - */ - public int deleteBomByIds(String[] versionNos); - - - /** - * 删除物料清单 - * - * @param bom 需要删除的数据 - * @return 结果 - */ - public int deleteByItem(Bom bom); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/ck/service/IBomService.java b/ruoyi-admin/src/main/java/com/ruoyi/ck/service/IBomService.java deleted file mode 100644 index 8fbec04f..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/ck/service/IBomService.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.ruoyi.ck.service; - -import com.ruoyi.ck.domain.Bom; -import com.ruoyi.ck.utils.Result; - -import java.util.List; - -/** - * 物料清单Service接口 - * - * @author ruoyi - * @date 2021-06-21 - */ -public interface IBomService -{ - /** - * 查询物料清单 - * - * @param versionNo 物料清单ID - * @return 物料清单 - */ - public Bom selectBomById(String versionNo); - - /** - * 查询物料清单列表 - * - * @param bom 物料清单 - * @return 物料清单集合 - */ - public List selectBomList(Bom bom); - - - /** - * 查询物料清单列表分组 - * - * @param bom 物料清单 - * @return 物料清单分组集合 - */ - public List selectBomListByGroup(Bom bom); - - /** - * 根据成品代码查询原料 - * - * @param bom 物料清单 - * @return 原料清单集合 - */ - public List selectBomListByCodeVersion(Bom bom); - - /** - * 新增物料清单 - * - * @param bom 物料清单 - * @return 结果 - */ - public Result insertBom(Bom bom)throws Exception; - - /** - * 修改物料清单 - * - * @param bom 物料清单 - * @return 结果 - */ - public int updateBom(Bom bom); - - /** - * 批量删除物料清单 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteBomByIds(String ids); - - /** - * 删除物料清单信息 - * - * @param versionNo 物料清单ID - * @return 结果 - */ - public int deleteBomById(String versionNo); - - /** - * 删除物料清单 - * - * @param bom 需要删除的数据 - * @return 结果 - */ - public int deleteByItem(Bom bom); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/ck/service/impl/BomServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/ck/service/impl/BomServiceImpl.java deleted file mode 100644 index 63313436..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/ck/service/impl/BomServiceImpl.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.ruoyi.ck.service.impl; - -import com.ruoyi.ck.domain.Bom; -import com.ruoyi.ck.mapper.BomMapper; -import com.ruoyi.ck.service.IBomService; -import com.ruoyi.ck.utils.Result; -import com.ruoyi.common.core.domain.entity.SysUser; -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 java.util.Calendar; -import java.util.Date; -import java.util.List; - -/** - * 物料清单Service业务层处理 - * - * @author ruoyi - * @date 2021-06-21 - */ -@Service -public class BomServiceImpl implements IBomService { - @Autowired - private BomMapper bomMapper; - - @Autowired - private ItemCPInfoServiceImpl itemCPInfoServiceImpl; - - /** - * 查询物料清单 - * - * @param versionNo 物料清单ID - * @return 物料清单 - */ - @Override - public Bom selectBomById(String versionNo) { - return bomMapper.selectBomById(versionNo); - } - - /** - * 查询物料清单列表 - * - * @param bom 物料清单 - * @return 物料清单 - */ - @Override - public List selectBomList(Bom bom) { - return bomMapper.selectBomList(bom); - } - - @Override - public List selectBomListByGroup(Bom bom) { - return bomMapper.selectBomGroupByCPCode(bom); - } - - @Override - public List selectBomListByCodeVersion(Bom bom) { - return bomMapper.selectBomListByCodeVersion(bom); - } - - /** - * 新增物料清单 - * - * @param bom 物料清单 - * @return 结果 - */ - @Override - public Result insertBom(Bom bom) throws Exception { - List bomList = bom.getBomList(); - for (Bom eachBom : bomList) { - eachBom.setCpCode(bom.getCpCode()); - eachBom.setCpName(bom.getCpName()); - eachBom.setVersionNo(bom.getVersionNo()); - eachBom.setCpType(bom.getCpType()); - bomMapper.insertBom(eachBom); - } - return Result.getSuccessResult(null); - } - - /** - * 修改物料清单 - * - * @param bom 物料清单 - * @return 结果 - */ - @Override - public int updateBom(Bom bom) { - List bomList = bom.getBomList(); - Bom tempBom = new Bom(); - tempBom.setCpCode(bom.getCpCode()); - tempBom.setVersionNo(bom.getVersionNo()); - List boms = bomMapper.selectBomListByCodeVersion(tempBom); - if (bomList.size() != boms.size()) { - for (Bom eachFindBom : boms) { - String eachFindWlCode = eachFindBom.getWlCode(); - for (Bom eachGetBom : bomList) { - if (eachFindWlCode.equals(eachGetBom.getWlCode())) { - break; - } - bomMapper.deleteByItem(eachFindBom); - } - } - } - // 获取当前的用户信息 - SysUser currentUser = ShiroUtils.getSysUser(); - // 获取当前的用户名称 - String userName = currentUser.getUserName(); - bom.setWriteMan(userName); - Date time = Calendar.getInstance().getTime(); - bom.setChangtime(time); - return bomMapper.updateBom(bom); - } - - /** - * 删除物料清单对象 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - @Override - public int deleteBomByIds(String ids) { - return bomMapper.deleteBomByIds(Convert.toStrArray(ids)); - } - - /** - * 删除物料清单信息 - * - * @param versionNo 物料清单ID - * @return 结果 - */ - @Override - public int deleteBomById(String versionNo) { - return bomMapper.deleteBomById(versionNo); - } - - /** - * 删除物料清单 - * - * @param bom 需要删除的数据 - * @return 结果 - */ - @Override - public int deleteByItem(Bom bom) { - return bomMapper.deleteByItem(bom); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java index a8c02d33..215cdb14 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java @@ -1,7 +1,5 @@ package com.ruoyi.erp.controller; -import com.ruoyi.ck.domain.Bom; -import com.ruoyi.ck.domain.ItemInfo; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -14,10 +12,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.erp.domain.*; import com.ruoyi.erp.service.IErpBomService; import com.ruoyi.process.general.service.IProcessService; -import com.ruoyi.system.domain.SysOutGood; -import com.ruoyi.system.domain.Vo.OutsourceQuoteVO; import com.ruoyi.system.service.ISysRoleService; -import com.ruoyi.web.controller.demo.domain.UserOperateModel; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.runtime.ProcessInstance; @@ -33,9 +28,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import java.io.IOException; import java.util.*; /** diff --git a/ruoyi-admin/src/main/resources/mapper/ck/BomMapper.xml b/ruoyi-admin/src/main/resources/mapper/ck/BomMapper.xml deleted file mode 100644 index 1be2740d..00000000 --- a/ruoyi-admin/src/main/resources/mapper/ck/BomMapper.xml +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select Version_No, CP_CODE, CP_NAME, CP_TYPE, CP_Machine_NO, CP_DW, Wl_Code, Itemname, Itemstandard, Stock_dw, Use_Num, lostpre, zp_guige, zp_use_num, m_qty, memolist, nowversion, begindate, endtime, wldm, customno, sendflag, YDWDH, ZLDWDH, yl_weight, zongzhong_Weight, pno, Addtime, Fu_Width, YFL_ItemClass, Mould_No, stand_nowversion, Comfirm_Flag, Comfirm_man, Comfirm_date, write_man, GongCha, Factory_Mould_no, Main_Material, Limit_Flag, gongcha_more, gongcha_small, changtime, CP_NUM, worklineclass from bom - - - - - - - - - - - - - - - - - - - - insert into bom - - Version_No, - CP_CODE, - CP_NAME, - CP_TYPE, - CP_Machine_NO, - CP_DW, - Wl_Code, - Itemname, - Itemstandard, - Stock_dw, - Use_Num, - lostpre, - zp_guige, - zp_use_num, - m_qty, - memolist, - nowversion, - begindate, - endtime, - wldm, - customno, - sendflag, - YDWDH, - ZLDWDH, - yl_weight, - zongzhong_Weight, - pno, - Addtime, - Fu_Width, - YFL_ItemClass, - Mould_No, - stand_nowversion, - Comfirm_Flag, - Comfirm_man, - Comfirm_date, - write_man, - GongCha, - Factory_Mould_no, - Main_Material, - Limit_Flag, - gongcha_more, - gongcha_small, - changtime, - CP_NUM, - worklineclass, - - - #{versionNo}, - #{cpCode}, - #{cpName}, - #{cpType}, - #{cpMachineNo}, - #{cpDw}, - #{wlCode}, - #{itemname}, - #{itemstandard}, - #{stockDw}, - #{useNum}, - #{lostpre}, - #{zpGuige}, - #{zpUseNum}, - #{mQty}, - #{memolist}, - #{nowversion}, - #{begindate}, - #{endtime}, - #{wldm}, - #{customno}, - #{sendflag}, - #{YDWDH}, - #{ZLDWDH}, - #{ylWeight}, - #{zongzhongWeight}, - #{pno}, - #{Addtime}, - #{fuWidth}, - #{yflItemclass}, - #{mouldNo}, - #{standNowversion}, - #{comfirmFlag}, - #{comfirmMan}, - #{comfirmDate}, - #{writeMan}, - #{GongCha}, - #{factoryMouldNo}, - #{mainMaterial}, - #{limitFlag}, - #{gongchaMore}, - #{gongchaSmall}, - #{changtime}, - #{cpNum}, - #{worklineclass}, - - - - - update bom - - CP_CODE = #{cpCode}, - CP_NAME = #{cpName}, - CP_TYPE = #{cpType}, - CP_Machine_NO = #{cpMachineNo}, - CP_DW = #{cpDw}, - Wl_Code = #{wlCode}, - Itemname = #{Itemname}, - Itemstandard = #{Itemstandard}, - Stock_dw = #{stockDw}, - Use_Num = #{useNum}, - lostpre = #{lostpre}, - zp_guige = #{zpGuige}, - zp_use_num = #{zpUseNum}, - m_qty = #{mQty}, - memolist = #{memolist}, - nowversion = #{nowversion}, - begindate = #{begindate}, - endtime = #{endtime}, - wldm = #{wldm}, - customno = #{customno}, - sendflag = #{sendflag}, - YDWDH = #{YDWDH}, - ZLDWDH = #{ZLDWDH}, - yl_weight = #{ylWeight}, - zongzhong_Weight = #{zongzhongWeight}, - pno = #{pno}, - Addtime = #{Addtime}, - Fu_Width = #{fuWidth}, - YFL_ItemClass = #{yflItemclass}, - Mould_No = #{mouldNo}, - stand_nowversion = #{standNowversion}, - Comfirm_Flag = #{comfirmFlag}, - Comfirm_man = #{comfirmMan}, - Comfirm_date = #{comfirmDate}, - write_man = #{writeMan}, - GongCha = #{GongCha}, - Factory_Mould_no = #{factoryMouldNo}, - Main_Material = #{mainMaterial}, - Limit_Flag = #{limitFlag}, - gongcha_more = #{gongchaMore}, - gongcha_small = #{gongchaSmall}, - changtime = #{changtime}, - CP_NUM = #{cpNum}, - worklineclass = #{worklineclass}, - - - - - where Version_No = #{versionNo} - - - - delete from bom where Version_No = #{versionNo} - - - - delete from bom where Version_No in - - #{versionNo} - - - - - delete from bom - - and Version_No = #{versionNo} - and CP_CODE = #{cpCode} - and Wl_Code = #{wlCode} - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/ck/bom/add.html b/ruoyi-admin/src/main/resources/templates/ck/bom/add.html deleted file mode 100644 index 40ff2b93..00000000 --- a/ruoyi-admin/src/main/resources/templates/ck/bom/add.html +++ /dev/null @@ -1,905 +0,0 @@ - - - - - - - - -
-

新增BOM

-
-
- -
-
-
-
- 成品代码: - -
-
- 成品名称: - -
-
- -
-
- 版本: - -
-
- 型号: - -
-
-
-
- 机种号码: - -
-
-
-
- 客户料号: - -
-
-
- - -
- - -
- - - - - - -
- - - - - -
- -
- - - - - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/ck/bom/bom.html b/ruoyi-admin/src/main/resources/templates/ck/bom/bom.html deleted file mode 100644 index ee5d84af..00000000 --- a/ruoyi-admin/src/main/resources/templates/ck/bom/bom.html +++ /dev/null @@ -1,368 +0,0 @@ - - - - - - - -
-
-
-
-
- -
-
-
- - -
- -
-
-
-
- - - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/ck/bom/edit.html b/ruoyi-admin/src/main/resources/templates/ck/bom/edit.html deleted file mode 100644 index a2990127..00000000 --- a/ruoyi-admin/src/main/resources/templates/ck/bom/edit.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - - - - -
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
-
-
-
- -
- - - - - - \ No newline at end of file