From 87bb08a360b81dc33a781fc48b5246dd79eff1a5 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Tue, 12 Sep 2023 16:39:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=A8=A1=E5=9D=97(=E7=99=BD?= =?UTF-8?q?=E5=9D=AF=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProWhiteOrderController.java | 96 +++++++++++ .../op/plan/mapper/ProWhiteOrderMapper.java | 61 +++++++ .../plan/service/IProWhiteOrderService.java | 61 +++++++ .../impl/ProOrderWorkorderServiceImpl.java | 1 - .../impl/ProWhiteOrderServiceImpl.java | 95 +++++++++++ .../mapper/plan/ProWhiteOrderMapper.xml | 154 ++++++++++++++++++ 6 files changed, 467 insertions(+), 1 deletion(-) create mode 100644 op-modules/op-plan/src/main/java/com/op/plan/controller/ProWhiteOrderController.java create mode 100644 op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWhiteOrderMapper.java create mode 100644 op-modules/op-plan/src/main/java/com/op/plan/service/IProWhiteOrderService.java create mode 100644 op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java create mode 100644 op-modules/op-plan/src/main/resources/mapper/plan/ProWhiteOrderMapper.xml diff --git a/op-modules/op-plan/src/main/java/com/op/plan/controller/ProWhiteOrderController.java b/op-modules/op-plan/src/main/java/com/op/plan/controller/ProWhiteOrderController.java new file mode 100644 index 00000000..3eae5790 --- /dev/null +++ b/op-modules/op-plan/src/main/java/com/op/plan/controller/ProWhiteOrderController.java @@ -0,0 +1,96 @@ +package com.op.plan.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.op.plan.service.IProWhiteOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.plan.domain.ProOrder; +import com.op.plan.service.IProOrderService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; + +import static com.op.common.core.web.domain.AjaxResult.success; + +/** + * 白坯订单controller + */ +@RestController +@RequestMapping("/whiteOrder") +public class ProWhiteOrderController { + @Autowired + private IProWhiteOrderService proWhiteOrderService; + + /** + * 查询白坯订单管理列表 + */ + @RequiresPermissions("plan:whiteOrder:list") + @GetMapping("/list") + public AjaxResult list(ProOrder proOrder) { + List list = proWhiteOrderService.selectProOrderList(proOrder); + return success(list); + } + + /** + * 导出白坯订单管理列表 + */ + @RequiresPermissions("plan:whiteOrder:export") + @Log(title = "白坯订单管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ProOrder proOrder) { + List list = proWhiteOrderService.selectProOrderList(proOrder); + ExcelUtil util = new ExcelUtil(ProOrder.class); + util.exportExcel(response, list, "白坯订单管理数据"); + } + + /** + * 获取白坯订单管理详细信息 + */ + @RequiresPermissions("plan:whiteOrder:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(proWhiteOrderService.selectProOrderById(id)); + } + + /** + * 新增白坯订单管理 + */ + @RequiresPermissions("plan:whiteOrder:add") + @Log(title = "白坯订单管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ProOrder proOrder) { + return success(proWhiteOrderService.insertProOrder(proOrder)); + } + + /** + * 修改白坯订单管理 + */ + @RequiresPermissions("plan:whiteOrder:edit") + @Log(title = "白坯订单管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProOrder proOrder) { + return success(proWhiteOrderService.updateProOrder(proOrder)); + } + + /** + * 删除白坯订单管理 + */ + @RequiresPermissions("plan:whiteOrder:remove") + @Log(title = "白坯订单管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return success(proWhiteOrderService.deleteProOrderByIds(ids)); + } +} diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWhiteOrderMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWhiteOrderMapper.java new file mode 100644 index 00000000..1dc9339e --- /dev/null +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProWhiteOrderMapper.java @@ -0,0 +1,61 @@ +package com.op.plan.mapper; + +import com.op.plan.domain.ProOrder; + +import java.util.List; + +/** + * 白坯订单管理Mapper接口 + * + * @author Open Platform + * @date 2023-09-12 + */ +public interface ProWhiteOrderMapper { + /** + * 查询白坯订单管理 + * + * @param id 白坯订单管理主键 + * @return 白坯订单管理 + */ + public ProOrder selectProOrderById(String id); + + /** + * 查询白坯订单管理列表 + * + * @param proOrder 白坯订单管理 + * @return 白坯订单管理集合 + */ + public List selectProOrderList(ProOrder proOrder); + + /** + * 新增白坯订单管理 + * + * @param proOrder 白坯订单管理 + * @return 结果 + */ + public int insertProOrder(ProOrder proOrder); + + /** + * 修改白坯订单管理 + * + * @param proOrder 白坯订单管理 + * @return 结果 + */ + public int updateProOrder(ProOrder proOrder); + + /** + * 删除白坯订单管理 + * + * @param id 白坯订单管理主键 + * @return 结果 + */ + public int deleteProOrderById(String id); + + /** + * 批量删除白坯订单管理 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteProOrderByIds(String[] ids); +} diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/IProWhiteOrderService.java b/op-modules/op-plan/src/main/java/com/op/plan/service/IProWhiteOrderService.java new file mode 100644 index 00000000..34223c4c --- /dev/null +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/IProWhiteOrderService.java @@ -0,0 +1,61 @@ +package com.op.plan.service; + +import com.op.plan.domain.ProOrder; + +import java.util.List; + +/** + * 白坯订单管理Service接口 + * + * @author Open Platform + * @date 2023-09-12 + */ +public interface IProWhiteOrderService { + /** + * 查询白坯订单管理 + * + * @param id 白坯订单管理主键 + * @return 白坯订单管理 + */ + public ProOrder selectProOrderById(String id); + + /** + * 查询白坯订单管理列表 + * + * @param proOrder 白坯订单管理 + * @return 白坯订单管理集合 + */ + public List selectProOrderList(ProOrder proOrder); + + /** + * 新增白坯订单管理 + * + * @param proOrder 白坯订单管理 + * @return 结果 + */ + public int insertProOrder(ProOrder proOrder); + + /** + * 修改白坯订单管理 + * + * @param proOrder 白坯订单管理 + * @return 结果 + */ + public int updateProOrder(ProOrder proOrder); + + /** + * 批量删除白坯订单管理 + * + * @param ids 需要删除的白坯订单管理主键集合 + * @return 结果 + */ + public int deleteProOrderByIds(String[] ids); + + /** + * 删除白坯订单管理信息 + * + * @param id 白坯订单管理主键 + * @return 结果 + */ + public int deleteProOrderById(String id); +} diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java index a09f8e16..877f715f 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java @@ -584,7 +584,6 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { @Override @DS("#header.poolName") public AjaxResult checkWorkOrder(String id) { - // 判断工单状态1.活动不可以2.已报工不可以 ProOrderWorkorder proOrderWorkorder = proOrderWorkorderMapper.selectProOrderWorkorderByWorkorderId(id); if (!(proOrderWorkorder.getStatus().equals("w0") ||proOrderWorkorder.getStatus().equals("w1"))) { return error("工单已生产,不可变更!"); diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java new file mode 100644 index 00000000..c9f8ae56 --- /dev/null +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java @@ -0,0 +1,95 @@ +package com.op.plan.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.plan.domain.ProOrder; +import com.op.plan.mapper.ProOrderMapper; +import com.op.plan.mapper.ProWhiteOrderMapper; +import com.op.plan.service.IProWhiteOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 白坯订单管理Service业务层处理 + * + * @author Open Platform + * @date 2023-09-12 + */ +@Service +public class ProWhiteOrderServiceImpl implements IProWhiteOrderService { + + @Autowired + private ProWhiteOrderMapper proWhiteOrderMapper; + + /** + * 查询白坯订单管理 + * + * @param id 白坯订单管理主键 + * @return 白坯订单管理 + */ + @Override + public ProOrder selectProOrderById(String id) { + return proWhiteOrderMapper.selectProOrderById(id); + } + + /** + * 查询白坯订单管理列表 + * + * @param proOrder 白坯订单管理 + * @return 白坯订单管理 + */ + @Override + @DS("#header.poolName") + public List selectProOrderList(ProOrder proOrder) { + return proWhiteOrderMapper.selectProOrderList(proOrder); + } + + /** + * 新增白坯订单管理 + * + * @param proOrder 白坯订单管理 + * @return 结果 + */ + @Override + public int insertProOrder(ProOrder proOrder) { + proOrder.setCreateTime(DateUtils.getNowDate()); + return proWhiteOrderMapper.insertProOrder(proOrder); + } + + /** + * 修改白坯订单管理 + * + * @param proOrder 白坯订单管理 + * @return 结果 + */ + @Override + public int updateProOrder(ProOrder proOrder) { + proOrder.setUpdateTime(DateUtils.getNowDate()); + return proWhiteOrderMapper.updateProOrder(proOrder); + } + + /** + * 批量删除白坯订单管理 + * + * @param ids 需要删除的白坯订单管理主键 + * @return 结果 + */ + @Override + public int deleteProOrderByIds(String[] ids) { + return proWhiteOrderMapper.deleteProOrderByIds(ids); + } + + /** + * 删除白坯订单管理信息 + * + * @param id 白坯订单管理主键 + * @return 结果 + */ + @Override + public int deleteProOrderById(String id) { + return proWhiteOrderMapper.deleteProOrderById(id); + } + +} diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProWhiteOrderMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProWhiteOrderMapper.xml new file mode 100644 index 00000000..08492571 --- /dev/null +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProWhiteOrderMapper.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, factory_code, order_type, order_code, prod_code, prod_desc, quantity, quantity_split, unit, worker_order, plan_pro_date, plan_complete, atrr1, atrr2, atrr3, status, parent_order, create_by, create_time, update_by, update_time, prod_type from pro_order + + + + + + + + insert into pro_order + + id, + factory_code, + order_type, + order_code, + prod_code, + prod_desc, + quantity, + quantity_split, + unit, + worker_order, + plan_pro_date, + plan_complete, + atrr1, + atrr2, + atrr3, + status, + parent_order, + create_by, + create_time, + update_by, + update_time, + prod_type, + + + #{id}, + #{factoryCode}, + #{orderType}, + #{orderCode}, + #{prodCode}, + #{prodDesc}, + #{quantity}, + #{quantitySplit}, + #{unit}, + #{workerOrder}, + #{planProDate}, + #{planComplete}, + #{atrr1}, + #{atrr2}, + #{atrr3}, + #{status}, + #{parentOrder}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{prodType}, + + + + + update pro_order + + factory_code = #{factoryCode}, + order_type = #{orderType}, + order_code = #{orderCode}, + prod_code = #{prodCode}, + prod_desc = #{prodDesc}, + quantity = #{quantity}, + quantity_split = #{quantitySplit}, + unit = #{unit}, + worker_order = #{workerOrder}, + plan_pro_date = #{planProDate}, + plan_complete = #{planComplete}, + atrr1 = #{atrr1}, + atrr2 = #{atrr2}, + atrr3 = #{atrr3}, + status = #{status}, + parent_order = #{parentOrder}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + prod_type = #{prodType}, + + where id = #{id} + + + + delete from pro_order where id = #{id} + + + + delete from pro_order where id in + + #{id} + + + \ No newline at end of file