diff --git a/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/controller/BuyorderHeadController.java b/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/controller/BuyorderHeadController.java deleted file mode 100644 index e09e5cbc..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/controller/BuyorderHeadController.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.ruoyi.buyorderHead.controller; - -import com.alibaba.fastjson.JSONObject; -import com.ruoyi.buyorderHead.domain.BuyorderHead; -import com.ruoyi.buyorderHead.domain.ProcurementCheck; -import com.ruoyi.buyorderHead.service.IBuyorderHeadService; -import com.ruoyi.buyorderHead.service.ProcurementCheckService; -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.domain.entity.SysUser; -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 com.ruoyi.po.domain.BuyorderList; -import com.ruoyi.po.service.IBuyorderListService; -import com.ruoyi.remind.domain.Remind; -import com.ruoyi.remind.service.RemindService; -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 java.math.BigDecimal; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * 采购单列表Controller - * - * @author ruoyi - * @date 2021-10-25 - */ -@Controller -@RequestMapping("/buyorderHead/buyOrderList") -public class BuyorderHeadController extends BaseController { - private String prefix = "buyorderHead/buyOrderList"; - - @Autowired - private IBuyorderHeadService buyorderHeadService; - - @Autowired - private IBuyorderListService buyorderListService; - - @Autowired - private RemindService remindService; - - @Autowired - private ProcurementCheckService procurementCheckService; - - @RequiresPermissions("buyorderHead:buyOrderList:view") - @GetMapping() - public String buyOrderList() { - return prefix + "/buyOrderList"; - } - - //返回采购对账页面 - @GetMapping("/check") - public String check() { - return prefix + "/procurementCheck"; - } - - /** - * 查询采购单列表列表 - */ - @RequiresPermissions("buyorderHead:buyOrderList:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(BuyorderHead buyorderHead) { - startPage(); - List list = buyorderHeadService.selectBuyorderHeadList(buyorderHead); - return getDataTable(list); - } - - /** - * 导出采购单列表列表 - */ - @RequiresPermissions("buyorderHead:buyOrderList:export") - @Log(title = "采购单列表", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ResponseBody - public AjaxResult export(BuyorderHead buyorderHead) { - List list = buyorderHeadService.selectBuyorderHeadList(buyorderHead); - ExcelUtil util = new ExcelUtil(BuyorderHead.class); - return util.exportExcel(list, "采购单列表数据"); - } - - /** - * 新增采购单列表 - */ - @GetMapping("/add") - public String add() { - return prefix + "/add2"; - } - - /** - * 新增保存采购单列表 - */ - @RequiresPermissions("buyorderHead:buyOrderList:add") - @Log(title = "采购单列表", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public Result addSave(String jsonStr) throws Exception { - JSONObject jsonObject = JSONObject.parseObject(jsonStr); - BuyorderHead buyorderHead = jsonObject.toJavaObject(BuyorderHead.class); - System.out.println(buyorderHead.getpName()); - if ("-1".equals(buyorderHead.getpName())) { - return Result.getFailResult("请选择供应商!", null); - } - List buyOrderList = buyorderHead.getBuyOrderList(); - for (BuyorderList buyorderList : buyOrderList) { - if (buyorderList.getAmt().compareTo(BigDecimal.ZERO) != 1) { - return Result.getFailResult("数量或单价不能为空!", null); - } - } - return Result.getSuccessResult(buyorderHeadService.insertBuyorderHead(buyorderHead, buyOrderList)); - } - - /** - * 修改采购单列表 - */ - @GetMapping("/edit/{poId}") - public String edit(@PathVariable("poId") String poId, ModelMap mmap) { - System.out.println(poId); - BuyorderHead buyorderHead = buyorderHeadService.selectBuyorderHeadById(poId); - BuyorderList buyorderList1 = new BuyorderList(); - buyorderList1.setPoId(poId); - List buyorderLists = buyorderListService.selectBuyorderListList(buyorderList1); - //System.out.println("buyorderHead"+buyorderHead); - mmap.put("buyorderHead", buyorderHead); - mmap.put("buyorderList", buyorderLists); - return prefix + "/edit2"; - } - - /** - * 修改保存采购单列表 - */ - @RequiresPermissions("buyorderHead:buyOrderList:edit") - @Log(title = "采购单列表", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(String jsonStr) { - //System.out.println(jsonStr); - JSONObject jsonObject = JSONObject.parseObject(jsonStr); - BuyorderHead buyorderHead = jsonObject.toJavaObject(BuyorderHead.class); - //System.out.println("buyorderHead"+buyorderHead); - if (buyorderHead.getEndFlag() == null) { - buyorderHead.setEndFlag(0); - } - if (buyorderHead.getApproveFlag() == null) { - buyorderHead.setApproveFlag(0); - } - if (buyorderHead.getAuditingFlag() == null) { - buyorderHead.setAuditingFlag(0); - } - if (buyorderHead.getComfirmFlag() == null) { - buyorderHead.setComfirmFlag(0); - } - return toAjax(buyorderHeadService.updateBuyorderHead(buyorderHead)); - } - - /** - * 删除采购单列表 - */ - @RequiresPermissions("buyorderHead:buyOrderList:remove") - @Log(title = "采购单列表", businessType = BusinessType.DELETE) - @PostMapping("/remove") - @ResponseBody - public AjaxResult remove(String ids) { - return toAjax(buyorderHeadService.deleteBuyorderHeadByIds(ids)); - } - - @PostMapping("/count") - @ResponseBody - public Result findCountByDay() throws Exception { - return buyorderHeadService.findCountByDay(); - } - - @ResponseBody - @RequestMapping("/addRemind") - public Result addRemind(Remind remind) throws Exception { - if (remind.getReceiver() == null) { - return Result.getFailResult("请选择接收人!", null); - } - if (remind.getRemindContent() == null) { - return Result.getFailResult("请传入提示信息!", null); - } - // 获取当前的用户信息 - SysUser currentUser = ShiroUtils.getSysUser(); - // 获取当前的登录名称 - String userName = currentUser.getLoginName(); - remind.setRemind(userName); - LocalDate now = LocalDate.now(); - DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - String date = dateTimeFormatter.format(now); - remind.setRemindDate(date); - remind.setIsView("0"); - int add = remindService.add(remind); - return Result.getSuccessResult(remind); - } - - @ResponseBody - @RequestMapping("/changeView") - public Result changeRemindView(Remind remind) throws Exception { - remind.setIsView("1"); - int edit = remindService.edit(remind); - return Result.getSuccessResult(edit); - } - - @ResponseBody - @RequestMapping("/procurementCheck") - public TableDataInfo getProcurementCheckList(ProcurementCheck procurementCheck) throws Exception { - startPage(); - List procurementCheckList = procurementCheckService.findProcurementCheckList(procurementCheck); - System.out.println(procurementCheckList); - return getDataTable(procurementCheckList); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/domain/BuyorderHead.java b/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/domain/BuyorderHead.java deleted file mode 100644 index 9f5e1c6d..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/domain/BuyorderHead.java +++ /dev/null @@ -1,547 +0,0 @@ -package com.ruoyi.buyorderHead.domain; - -import com.alibaba.fastjson.annotation.JSONField; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; -import com.ruoyi.po.domain.BuyorderList; - -import java.util.Date; -import java.util.List; - -/** - * 采购单列表对象 buyorder_head - * - * @author ruoyi - * @date 2021-10-25 - */ -public class BuyorderHead extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 订购编号 */ - private String poId; - - /** 订购单号 */ - @Excel(name = "订购单号") - private String poNo; - - /** 供应商代码 */ - @Excel(name = "供应商代码") - private String pCode; - - /** 供应商名称 */ - @Excel(name = "供应商名称") - private String pName; - - /** 联系人 */ - @Excel(name = "联系人") - private String pLinkman; - - /** 联系电话 */ - @Excel(name = "联系电话") - private String pTel; - - /** 传真号码 */ - @Excel(name = "传真号码") - private String pFax; - - /** 交货地址 */ - @Excel(name = "交货地址") - private String sendAddress; - - /** 付款条件 */ - @Excel(name = "付款条件") - private String GetMoneyMemo; - - /** 交货条件 */ - @Excel(name = "交货条件") - private String Sendmemo; - - /** 交货方式 */ - @Excel(name = "交货方式") - private String Sendway; - - /** 开单日期 */ - @JSONField(format="yyyy-MM-dd") - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "开单日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date poDate; - - /** 订购种类 */ - @Excel(name = "订购种类") - private String poClass; - - /** 采购担当 */ - @Excel(name = "采购担当") - private String poMan; - - /** 备注内容 */ - @Excel(name = "备注内容") - private String bzMemo; - - /** 结案 */ - @Excel(name = "结案") - private Integer endFlag; - - /** */ - private Integer chinaInOrOut; - - /** 删除否 */ - private Integer isDelete; - - /** 税率 */ - @Excel(name = "税率") - private Long TaxPercent; - - /** */ - private String appId; - - /** 确定否 */ - @Excel(name = "确定否") - private Integer comfirmFlag; - - /** 确定人 */ - @Excel(name = "确定人") - private String comfirmMan; - - /** 确定日期 */ - private Date comfirmDate; - - /** 审核否 */ - @Excel(name = "审核否") - private Integer auditingFlag; - - /** 审核人 */ - @Excel(name = "审核人") - private String auditingMan; - - /** 审核日期 */ - private Date auditingDate; - - /** 核准否 */ - @Excel(name = "核准否") - private Integer approveFlag; - - /** 核准人 */ - @Excel(name = "核准人") - private String approveMan; - - /** 核准日期 */ - private Date approveDate; - - /** 购方名称 */ - @Excel(name = "购方名称") - private String poPName; - - /** */ - private String jaMan; - - /** */ - private String jaTime; - - /** */ - private String applyId; - - /** */ - private String SaleOrderNO; - - private List buyOrderList; - - public List getBuyOrderList() { - return buyOrderList; - } - - public void setBuyOrderList(List buyOrderList) { - this.buyOrderList = buyOrderList; - } - - public void setPoId(String poId) - { - this.poId = poId; - } - - public String getPoId() - { - return poId; - } - public void setPoNo(String poNo) - { - this.poNo = poNo; - } - - public String getPoNo() - { - return poNo; - } - public void setpCode(String pCode) - { - this.pCode = pCode; - } - - public String getpCode() - { - return pCode; - } - public void setpName(String pName) - { - this.pName = pName; - } - - public String getpName() - { - return pName; - } - public void setpLinkman(String pLinkman) - { - this.pLinkman = pLinkman; - } - - public String getpLinkman() - { - return pLinkman; - } - public void setpTel(String pTel) - { - this.pTel = pTel; - } - - public String getpTel() - { - return pTel; - } - public void setpFax(String pFax) - { - this.pFax = pFax; - } - - public String getpFax() - { - return pFax; - } - public void setSendAddress(String sendAddress) - { - this.sendAddress = sendAddress; - } - - public String getSendAddress() - { - return sendAddress; - } - public void setGetMoneyMemo(String GetMoneyMemo) - { - this.GetMoneyMemo = GetMoneyMemo; - } - - public String getGetMoneyMemo() - { - return GetMoneyMemo; - } - public void setSendmemo(String Sendmemo) - { - this.Sendmemo = Sendmemo; - } - - public String getSendmemo() - { - return Sendmemo; - } - public void setSendway(String Sendway) - { - this.Sendway = Sendway; - } - - public String getSendway() - { - return Sendway; - } - public void setPoDate(Date poDate) - { - this.poDate = poDate; - } - - public Date getPoDate() - { - return poDate; - } - public void setPoClass(String poClass) - { - this.poClass = poClass; - } - - public String getPoClass() - { - return poClass; - } - public void setPoMan(String poMan) - { - this.poMan = poMan; - } - - public String getPoMan() - { - return poMan; - } - public void setBzMemo(String bzMemo) - { - this.bzMemo = bzMemo; - } - - public String getBzMemo() - { - return bzMemo; - } - public void setEndFlag(Integer endFlag) - { - this.endFlag = endFlag; - } - - public Integer getEndFlag() - { - return endFlag; - } - public void setChinaInOrOut(Integer chinaInOrOut) - { - this.chinaInOrOut = chinaInOrOut; - } - - public Integer getChinaInOrOut() - { - return chinaInOrOut; - } - public void setIsDelete(Integer isDelete) - { - this.isDelete = isDelete; - } - - public Integer getIsDelete() - { - return isDelete; - } - public void setTaxPercent(Long TaxPercent) - { - this.TaxPercent = TaxPercent; - } - - public Long getTaxPercent() - { - return TaxPercent; - } - public void setAppId(String appId) - { - this.appId = appId; - } - - public String getAppId() - { - return appId; - } - public void setComfirmFlag(Integer comfirmFlag) - { - this.comfirmFlag = comfirmFlag; - } - - public Integer 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 setAuditingFlag(Integer auditingFlag) - { - this.auditingFlag = auditingFlag; - } - - public Integer getAuditingFlag() - { - return auditingFlag; - } - public void setAuditingMan(String auditingMan) - { - this.auditingMan = auditingMan; - } - - public String getAuditingMan() - { - return auditingMan; - } - public void setAuditingDate(Date auditingDate) - { - this.auditingDate = auditingDate; - } - - public Date getAuditingDate() - { - return auditingDate; - } - public void setApproveFlag(Integer approveFlag) - { - this.approveFlag = approveFlag; - } - - public Integer getApproveFlag() - { - return approveFlag; - } - public void setApproveMan(String approveMan) - { - this.approveMan = approveMan; - } - - public String getApproveMan() - { - return approveMan; - } - public void setApproveDate(Date approveDate) - { - this.approveDate = approveDate; - } - - public Date getApproveDate() - { - return approveDate; - } - public void setPoPName(String poPName) - { - this.poPName = poPName; - } - - public String getPoPName() - { - return poPName; - } - public void setJaMan(String jaMan) - { - this.jaMan = jaMan; - } - - public String getJaMan() - { - return jaMan; - } - public void setJaTime(String jaTime) - { - this.jaTime = jaTime; - } - - public String getJaTime() - { - return jaTime; - } - public void setApplyId(String applyId) - { - this.applyId = applyId; - } - - public String getApplyId() - { - return applyId; - } - public void setSaleOrderNO(String SaleOrderNO) - { - this.SaleOrderNO = SaleOrderNO; - } - - public String getSaleOrderNO() - { - return SaleOrderNO; - } - -// @Override -// public String toString() { -// return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) -// .append("poId", getPoId()) -// .append("poNo", getPoNo()) -// .append("pCode", getpCode()) -// .append("pName", getpName()) -// .append("pLinkman", getpLinkman()) -// .append("pTel", getpTel()) -// .append("pFax", getpFax()) -// .append("sendAddress", getSendAddress()) -// .append("GetMoneyMemo", getGetMoneyMemo()) -// .append("Sendmemo", getSendmemo()) -// .append("Sendway", getSendway()) -// .append("poDate", getPoDate()) -// .append("poClass", getPoClass()) -// .append("poMan", getPoMan()) -// .append("bzMemo", getBzMemo()) -// .append("endFlag", getEndFlag()) -// .append("chinaInOrOut", getChinaInOrOut()) -// .append("isDelete", getIsDelete()) -// .append("TaxPercent", getTaxPercent()) -// .append("appId", getAppId()) -// .append("comfirmFlag", getComfirmFlag()) -// .append("comfirmMan", getComfirmMan()) -// .append("comfirmDate", getComfirmDate()) -// .append("auditingFlag", getAuditingFlag()) -// .append("auditingMan", getAuditingMan()) -// .append("auditingDate", getAuditingDate()) -// .append("approveFlag", getApproveFlag()) -// .append("approveMan", getApproveMan()) -// .append("approveDate", getApproveDate()) -// .append("poPName", getPoPName()) -// .append("jaMan", getJaMan()) -// .append("jaTime", getJaTime()) -// .append("applyId", getApplyId()) -// .append("SaleOrderNO", getSaleOrderNO()) -// .toString(); -// } - - - @Override - public String toString() { - return "BuyorderHead{" + - "poId='" + poId + '\'' + - ", poNo='" + poNo + '\'' + - ", pCode='" + pCode + '\'' + - ", pName='" + pName + '\'' + - ", pLinkman='" + pLinkman + '\'' + - ", pTel='" + pTel + '\'' + - ", pFax='" + pFax + '\'' + - ", sendAddress='" + sendAddress + '\'' + - ", GetMoneyMemo='" + GetMoneyMemo + '\'' + - ", Sendmemo='" + Sendmemo + '\'' + - ", Sendway='" + Sendway + '\'' + - ", poDate=" + poDate + - ", poClass='" + poClass + '\'' + - ", poMan='" + poMan + '\'' + - ", bzMemo='" + bzMemo + '\'' + - ", endFlag=" + endFlag + - ", chinaInOrOut=" + chinaInOrOut + - ", isDelete=" + isDelete + - ", TaxPercent=" + TaxPercent + - ", appId='" + appId + '\'' + - ", comfirmFlag=" + comfirmFlag + - ", comfirmMan='" + comfirmMan + '\'' + - ", comfirmDate=" + comfirmDate + - ", auditingFlag=" + auditingFlag + - ", auditingMan='" + auditingMan + '\'' + - ", auditingDate=" + auditingDate + - ", approveFlag=" + approveFlag + - ", approveMan='" + approveMan + '\'' + - ", approveDate=" + approveDate + - ", poPName='" + poPName + '\'' + - ", jaMan='" + jaMan + '\'' + - ", jaTime='" + jaTime + '\'' + - ", applyId='" + applyId + '\'' + - ", SaleOrderNO='" + SaleOrderNO + '\'' + - ", buyOrderList=" + buyOrderList + - '}'; - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/mapper/BuyorderHeadMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/mapper/BuyorderHeadMapper.java deleted file mode 100644 index e88cca47..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/mapper/BuyorderHeadMapper.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ruoyi.buyorderHead.mapper; - -import com.ruoyi.buyorderHead.domain.BuyorderHead; - -import java.util.List; - -/** - * 采购单列表Mapper接口 - * - * @author ruoyi - * @date 2021-10-25 - */ -public interface BuyorderHeadMapper -{ - /** - * 查询采购单列表 - * - * @param poId 采购单列表ID - * @return 采购单列表 - */ - public BuyorderHead selectBuyorderHeadById(String poId); - - /** - * 查询采购单列表列表 - * - * @param buyorderHead 采购单列表 - * @return 采购单列表集合 - */ - public List selectBuyorderHeadList(BuyorderHead buyorderHead); - - /** - * 新增采购单列表 - * - * @param buyorderHead 采购单列表 - * @return 结果 - */ - public int insertBuyorderHead(BuyorderHead buyorderHead); - - /** - * 修改采购单列表 - * - * @param buyorderHead 采购单列表 - * @return 结果 - */ - public int updateBuyorderHead(BuyorderHead buyorderHead); - - /** - * 删除采购单列表 - * - * @param poId 采购单列表ID - * @return 结果 - */ - public int deleteBuyorderHeadById(String poId); - - /** - * 批量删除采购单列表 - * - * @param poIds 需要删除的数据ID - * @return 结果 - */ - public int deleteBuyorderHeadByIds(String[] poIds); - - public Integer selectCountByDay(); -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/service/IBuyorderHeadService.java b/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/service/IBuyorderHeadService.java deleted file mode 100644 index aa8d1328..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/service/IBuyorderHeadService.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.ruoyi.buyorderHead.service; - -import com.ruoyi.buyorderHead.domain.BuyorderHead; -import com.ruoyi.ck.utils.Result; -import com.ruoyi.po.domain.BuyorderList; - -import java.util.List; - -/** - * 采购单列表Service接口 - * - * @author ruoyi - * @date 2021-10-25 - */ -public interface IBuyorderHeadService -{ - /** - * 查询采购单列表 - * - * @param poId 采购单列表ID - * @return 采购单列表 - */ - public BuyorderHead selectBuyorderHeadById(String poId); - - /** - * 查询采购单列表列表 - * - * @param buyorderHead 采购单列表 - * @return 采购单列表集合 - */ - public List selectBuyorderHeadList(BuyorderHead buyorderHead); - - /** - * 新增采购单列表 - * - * @param buyorderHead 采购单列表 - * @return 结果 - */ - public int insertBuyorderHead(BuyorderHead buyorderHead, List buyorderLists)throws Exception; - - /** - * 修改采购单列表 - * - * @param buyorderHead 采购单列表 - * @return 结果 - */ - public int updateBuyorderHead(BuyorderHead buyorderHead); - - /** - * 批量删除采购单列表 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteBuyorderHeadByIds(String ids); - - /** - * 删除采购单列表信息 - * - * @param poId 采购单列表ID - * @return 结果 - */ - public int deleteBuyorderHeadById(String poId); - - public Result findCountByDay()throws Exception; - -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/service/impl/BuyorderHeadServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/service/impl/BuyorderHeadServiceImpl.java deleted file mode 100644 index 4b2c0219..00000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/buyorderHead/service/impl/BuyorderHeadServiceImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.ruoyi.buyorderHead.service.impl; - -import com.alibaba.druid.util.StringUtils; -import com.ruoyi.buyorderHead.domain.BuyorderHead; -import com.ruoyi.buyorderHead.mapper.BuyorderHeadMapper; -import com.ruoyi.buyorderHead.service.IBuyorderHeadService; -import com.ruoyi.ck.domain.Provider; -import com.ruoyi.ck.mapper.ProviderMapper; -import com.ruoyi.ck.utils.Result; -import com.ruoyi.common.core.text.Convert; -import com.ruoyi.po.domain.BuyorderList; -import com.ruoyi.po.mapper.BuyorderListMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.time.LocalDate; -import java.util.Date; -import java.util.List; - -/** - * 采购单列表Service业务层处理 - * - * @author ruoyi - * @date 2021-10-25 - */ -@Service -public class BuyorderHeadServiceImpl implements IBuyorderHeadService { - @Autowired - private BuyorderHeadMapper buyorderHeadMapper; - - @Autowired - private ProviderMapper providerMapper; - - @Autowired - private BuyorderListMapper buyorderListMapper; - - /** - * 查询采购单列表 - * - * @param poId 采购单列表ID - * @return 采购单列表 - */ - @Override - public BuyorderHead selectBuyorderHeadById(String poId) { - return buyorderHeadMapper.selectBuyorderHeadById(poId); - } - - /** - * 查询采购单列表列表 - * - * @param buyorderHead 采购单列表 - * @return 采购单列表 - */ - @Override - public List selectBuyorderHeadList(BuyorderHead buyorderHead) { - return buyorderHeadMapper.selectBuyorderHeadList(buyorderHead); - } - - /** - * 新增采购单列表 - * - * @param buyorderHead 采购单列表 - * @return 结果 - */ - @Override - public int insertBuyorderHead(BuyorderHead buyorderHead, List buyorderLists) throws Exception { - Provider provider = new Provider(); - provider.setpName(buyorderHead.getpName()); - List providers = providerMapper.selectByItem(provider); - buyorderHead.setpCode(providers.get(0).getpCode()); - buyorderHead.setPoId(buyorderHead.getPoNo()); - insertOrUpdateBuyOrderList(buyorderLists, buyorderHead.getPoId()); - return buyorderHeadMapper.insertBuyorderHead(buyorderHead); - } - - /** - * 修改采购单列表 - * - * @param buyorderHead 采购单列表 - * @return 结果 - */ - @Override - public int updateBuyorderHead(BuyorderHead buyorderHead) { - buyorderListMapper.deleteBuyorderListById(buyorderHead.getPoId()); - insertOrUpdateBuyOrderList(buyorderHead.getBuyOrderList(), buyorderHead.getPoId()); - return buyorderHeadMapper.updateBuyorderHead(buyorderHead); - } - - /** - * 删除采购单列表对象 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - @Override - public int deleteBuyorderHeadByIds(String ids) { - return buyorderHeadMapper.deleteBuyorderHeadByIds(Convert.toStrArray(ids)); - } - - /** - * 删除采购单列表信息 - * - * @param poId 采购单列表ID - * @return 结果 - */ - @Override - public int deleteBuyorderHeadById(String poId) { - return buyorderHeadMapper.deleteBuyorderHeadById(poId); - } - - @Override - public Result findCountByDay() throws Exception { - Integer count = buyorderHeadMapper.selectCountByDay() + 1; - LocalDate now = LocalDate.now(); - String substring = now.toString().replace("-", "").substring(2); - String data = "PO" + substring + count; - return Result.getSuccessResult(data); - } - - private void insertOrUpdateBuyOrderList(List buyOrderLists, String poId) { - for (BuyorderList eachBuyOrderList : buyOrderLists) { - eachBuyOrderList.setPoId(poId); - if (eachBuyOrderList.getSendDate() == null) { - eachBuyOrderList.setSendDate(new Date()); - } - if (StringUtils.isEmpty(eachBuyOrderList.getCrlName())) { - eachBuyOrderList.setCrlName("RMB"); - } - buyorderListMapper.insertBuyorderList(eachBuyOrderList); - } - } -} diff --git a/ruoyi-admin/src/main/resources/mapper/buyorderHead/BuyorderHeadMapper.xml b/ruoyi-admin/src/main/resources/mapper/buyorderHead/BuyorderHeadMapper.xml deleted file mode 100644 index af2e10d6..00000000 --- a/ruoyi-admin/src/main/resources/mapper/buyorderHead/BuyorderHeadMapper.xml +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select PO_ID, PO_NO, P_CODE, P_Name, P_LinkMan, P_TEL, P_FAX, Send_Address, GetMoneyMemo, Sendmemo, Sendway, PO_date, PO_Class, PO_man, BZ_memo, End_flag, China_in_or_out, Is_delete, TaxPercent, APP_ID, Comfirm_Flag, Comfirm_man, Comfirm_date, Auditing_Flag, Auditing_MAN, Auditing_DATE, Approve_Flag, Approve_MAN, Approve_DATE, PO_P_NAME, JA_MAN, JA_TIME, Apply_ID, SaleOrderNO from buyorder_head - - - - - - - - insert into buyorder_head - - PO_ID, - PO_NO, - P_CODE, - P_Name, - P_LinkMan, - P_TEL, - P_FAX, - Send_Address, - GetMoneyMemo, - Sendmemo, - Sendway, - PO_date, - PO_Class, - PO_man, - BZ_memo, - End_flag, - China_in_or_out, - Is_delete, - TaxPercent, - APP_ID, - Comfirm_Flag, - Comfirm_man, - Comfirm_date, - Auditing_Flag, - Auditing_MAN, - Auditing_DATE, - Approve_Flag, - Approve_MAN, - Approve_DATE, - PO_P_NAME, - JA_MAN, - JA_TIME, - Apply_ID, - SaleOrderNO, - - - #{poId}, - #{poNo}, - #{pCode}, - #{pName}, - #{pLinkman}, - #{pTel}, - #{pFax}, - #{sendAddress}, - #{GetMoneyMemo}, - #{Sendmemo}, - #{Sendway}, - #{poDate}, - #{poClass}, - #{poMan}, - #{bzMemo}, - #{endFlag}, - #{chinaInOrOut}, - #{isDelete}, - #{TaxPercent}, - #{appId}, - #{comfirmFlag}, - #{comfirmMan}, - #{comfirmDate}, - #{auditingFlag}, - #{auditingMan}, - #{auditingDate}, - #{approveFlag}, - #{approveMan}, - #{approveDate}, - #{poPName}, - #{jaMan}, - #{jaTime}, - #{applyId}, - #{SaleOrderNO}, - - - - - update buyorder_head - - PO_NO = #{poNo}, - P_CODE = #{pCode}, - P_Name = #{pName}, - P_LinkMan = #{pLinkman}, - P_TEL = #{pTel}, - P_FAX = #{pFax}, - Send_Address = #{sendAddress}, - GetMoneyMemo = #{GetMoneyMemo}, - Sendmemo = #{Sendmemo}, - Sendway = #{Sendway}, - PO_date = #{poDate}, - PO_Class = #{poClass}, - PO_man = #{poMan}, - BZ_memo = #{bzMemo}, - End_flag = #{endFlag}, - China_in_or_out = #{chinaInOrOut}, - Is_delete = #{isDelete}, - TaxPercent = #{TaxPercent}, - APP_ID = #{appId}, - Comfirm_Flag = #{comfirmFlag}, - Comfirm_man = #{comfirmMan}, - Comfirm_date = #{comfirmDate}, - Auditing_Flag = #{auditingFlag}, - Auditing_MAN = #{auditingMan}, - Auditing_DATE = #{auditingDate}, - Approve_Flag = #{approveFlag}, - Approve_MAN = #{approveMan}, - Approve_DATE = #{approveDate}, - PO_P_NAME = #{poPName}, - JA_MAN = #{jaMan}, - JA_TIME = #{jaTime}, - Apply_ID = #{applyId}, - SaleOrderNO = #{SaleOrderNO}, - - where PO_ID = #{poId} - - - - delete from buyorder_head where PO_ID = #{poId} - - - - delete from buyorder_head where PO_ID in - - #{poId} - - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/add2.html b/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/add2.html deleted file mode 100644 index 20809db9..00000000 --- a/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/add2.html +++ /dev/null @@ -1,733 +0,0 @@ - - - - - - - - - - -
-
-
- -
-
-
- - -
- -
-
-
- -
- -
-
- -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
- - -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- - -
- -
- - - - - - - - -
- - - -
-
- - - - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/buyOrderList.html b/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/buyOrderList.html deleted file mode 100644 index 61512854..00000000 --- a/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/buyOrderList.html +++ /dev/null @@ -1,866 +0,0 @@ - - - - - - - - -
-
-
-
-
-
    -
  • - - -
  • -
  • - - - - - -
  • -
  • - - -
  • -
  • - - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • -  搜索 -  重置 -
  • - -
-
-
-
- - -
-
-
-
-
- - - - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/edit2.html b/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/edit2.html deleted file mode 100644 index 7fa90263..00000000 --- a/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/edit2.html +++ /dev/null @@ -1,873 +0,0 @@ - - - - - - - - - - -
-
-
- -
-
- - - - -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
- - -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- - -
- -
-
- - - -
-
- - - - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/procurementCheck.html b/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/procurementCheck.html deleted file mode 100644 index cb3c8bc3..00000000 --- a/ruoyi-admin/src/main/resources/templates/buyorderHead/buyOrderList/procurementCheck.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - - - - -
-
-
-
-
-
    -
  • - - - - - -
  • -
  • - - - - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • -  搜索 -  重置 -
  • - -
-
-
-
- - -
-
-
-
-
- - - - - - \ No newline at end of file