Эх сурвалжийг харах

fix:完成生产订单所有功能

qingwudarao 5 сар өмнө
parent
commit
4e1cbf4e97

+ 0 - 2
ruoyi-modules/ruoyi-productionManagementOfBulkOrders/src/main/java/org/dromara/productionManagement/controller/FactoryController.java

@@ -1,6 +1,5 @@
 package org.dromara.productionManagement.controller;
 
-import cn.dev33.satoken.annotation.SaIgnore;
 import lombok.RequiredArgsConstructor;
 import org.dromara.common.core.domain.R;
 import org.dromara.common.mybatis.core.page.PageQuery;
@@ -16,7 +15,6 @@ import java.util.List;
 /**
  * 工厂管理接口
  */
-@SaIgnore
 @RestController
 @RequiredArgsConstructor
 @RequestMapping("/productionManagement/factory")

+ 75 - 6
ruoyi-modules/ruoyi-productionManagementOfBulkOrders/src/main/java/org/dromara/productionManagement/controller/ProductionPlanController.java

@@ -1,23 +1,20 @@
 package org.dromara.productionManagement.controller;
 
-import cn.dev33.satoken.annotation.SaIgnore;
 import lombok.RequiredArgsConstructor;
+import org.dromara.common.core.domain.R;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.web.core.BaseController;
 import org.dromara.productionManagement.domain.vo.ProductionPlanVo;
 import org.dromara.productionManagement.service.ProductionPlanService;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.Map;
 
 /**
  * 生产计划管理接口
  */
-@SaIgnore
 @RestController
 @RequiredArgsConstructor
 @RequestMapping("/productionManagement/productionPlan")
@@ -25,9 +22,81 @@ public class ProductionPlanController extends BaseController {
 
     private final ProductionPlanService productionPlanService;
 
+    /**
+     * 分页查询生产计划
+     * @param params 请求参数
+     * @return 分页结果
+     */
     @GetMapping("/PageList")
     public TableDataInfo<ProductionPlanVo> selectPageProductionPlan(@RequestBody Map<String,Object> params){
         PageQuery pageQuery = new PageQuery((Integer) params.get("pageSize"), (Integer) params.get("pageNum"));
         return productionPlanService.selectVoPage(params, pageQuery);
     }
+
+    /**
+     * 更新数码印花厂id
+     * @param id 订单id
+     * @param outFactory 数码印花厂id
+     * @return 结果
+     */
+    @PutMapping("/outFactory")
+    public R<Void> updateOutFactory(@RequestParam Long id, @RequestParam int outFactory){
+        return toAjax(productionPlanService.updateOutFactory(id, outFactory));
+    }
+
+    /**
+     * 更新烧花厂id
+     * @param id 订单id
+     * @param SHFactory 烧花厂id
+     * @return 结果
+     */
+    @PutMapping("/SHFactory")
+    public R<Void> updateSHFactory(@RequestParam Long id, @RequestParam int SHFactory){
+        return toAjax(productionPlanService.updateSHFactory(id, SHFactory));
+    }
+
+    /**
+     * 更新订单状态
+     * @param id 订单id
+     * @param craftStatus 订单状态码
+     * @return 结果
+     */
+    @PutMapping("/craftStatus")
+    public R<Void> updateCraftStatus(@RequestParam Long id, @RequestParam int craftStatus){
+        return toAjax(productionPlanService.updateCraftStatus(id, craftStatus));
+    }
+
+    /**
+     * 更新打印状态
+     * @param id 订单id
+     * @param printStatus 打印状态码
+     * @return 结果
+     */
+    @PutMapping("/printStatus")
+    public R<Void> updatePrintStatus(@RequestParam Long id, @RequestParam int printStatus){
+        return toAjax(productionPlanService.updatePrintStatus(id, printStatus));
+    }
+
+    /**
+     * 更新发货时间
+     * @param id 订单id
+     * @param deliveryTime 发货时间
+     * @return 结果
+     */
+    @PutMapping("/deliveryTime")
+    public R<Void> updateDeliveryTime(@RequestParam Long id, @RequestParam Date deliveryTime){
+        return toAjax(productionPlanService.updateDeliveryTime(id, deliveryTime));
+    }
+
+    /**
+     * 更新确认收货时间
+     * @param id 订单id
+     * @param confirmDeliveryTime 确认收货时间
+     * @return 结果
+     */
+    @PutMapping("/confirmDeliveryTime")
+    public R<Void> updateConfirmDeliveryTime(@RequestParam Long id, @RequestParam Date confirmDeliveryTime){
+        return toAjax(productionPlanService.updateConfirmDeliveryTime(id, confirmDeliveryTime));
+    }
+
 }

+ 55 - 0
ruoyi-modules/ruoyi-productionManagementOfBulkOrders/src/main/java/org/dromara/productionManagement/service/ProductionPlanService.java

@@ -4,6 +4,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.productionManagement.domain.vo.ProductionPlanVo;
 
+import java.util.Date;
 import java.util.Map;
 
 /**
@@ -11,5 +12,59 @@ import java.util.Map;
  */
 public interface ProductionPlanService {
 
+    /**
+     * 分页查询生产计划
+     * @param params 查询条件
+     * @param pageQuery 分页条件
+     * @return 分页结果
+     */
     TableDataInfo<ProductionPlanVo> selectVoPage(Map<String,Object> params, PageQuery pageQuery);
+
+    /**
+     * 更新数码印花厂id
+     * @param id 订单id
+     * @param outFactory 数码印花厂id
+     * @return 结果
+     */
+    int updateOutFactory(Long id, int outFactory);
+
+    /**
+     * 更新烧花厂id
+     * @param id 订单id
+     * @param SHFactory 烧花厂id
+     * @return 结果
+     */
+    int updateSHFactory(Long id, int SHFactory);
+
+    /**
+     * 更新订单状态
+     * @param id 订单id
+     * @param craftStatus 订单状态码
+     * @return 结果
+     */
+    int updateCraftStatus(Long id, int craftStatus);
+
+    /**
+     * 更新打印状态
+     * @param id 订单id
+     * @param printStatus 打印状态码
+     * @return 结果
+     */
+    int updatePrintStatus(Long id, int printStatus);
+
+    /**
+     * 更新发货时间
+     * @param id 订单id
+     * @param deliveryTime 发货时间
+     * @return 结果
+     */
+    int updateDeliveryTime(Long id, Date deliveryTime);
+
+    /**
+     * 更新确认收货时间
+     * @param id 订单id
+     * @param confirmDeliveryTime 确认收货时间
+     * @return 结果
+     */
+    int updateConfirmDeliveryTime(Long id, Date confirmDeliveryTime);
 }

+ 88 - 1
ruoyi-modules/ruoyi-productionManagementOfBulkOrders/src/main/java/org/dromara/productionManagement/service/impl/ProductionPlanServiceImpl.java

@@ -1,6 +1,7 @@
 package org.dromara.productionManagement.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.RequiredArgsConstructor;
 import org.dromara.common.core.utils.StringUtils;
@@ -12,6 +13,7 @@ import org.dromara.productionManagement.mapper.ProductionPlanMapper;
 import org.dromara.productionManagement.service.ProductionPlanService;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.Map;
 
 /**
@@ -23,6 +25,12 @@ public class ProductionPlanServiceImpl implements ProductionPlanService {
 
     private final ProductionPlanMapper productionPlanMapper;
 
+    /**
+     * 分页查询生产计划
+     * @param params 查询条件
+     * @param pageQuery 分页条件
+     * @return 分页结果
+     */
     @Override
     public TableDataInfo<ProductionPlanVo> selectVoPage(Map<String,Object> params, PageQuery pageQuery) {
         QueryWrapper<ProductionPlan> qw = new QueryWrapper<>();
@@ -43,7 +51,8 @@ public class ProductionPlanServiceImpl implements ProductionPlanService {
         qw.eq(null != params.get("isBuHuo"), "p.is_buhuo", params.get("isBuHuo"));
         qw.eq(null != params.get("isUrgent"), "p.is_urgent", params.get("isUrgent"));
         qw.eq(StringUtils.isNotBlank((CharSequence) params.get("isSys")), "p.is_sys", params.get("isSys"));
-        qw.eq(null != params.get("craftAttrBo"), "gi.goods_type_extend_3_attr", params.get("craftAttrBo"));//构建完整的工艺扩展信息对象的JSON数据
+        //需构建完整的工艺扩展信息对象的JSON数据
+        qw.eq(null != params.get("craftAttrBo"), "gi.goods_type_extend_3_attr", params.get("craftAttrBo"));
         qw.eq(StringUtils.isNotBlank((CharSequence) params.get("brandGroup")),"gi.brand_group", params.get("brandGroup"));
         qw.eq(null != params.get("outFactoryId"),"p.out_factory_id", params.get("outFactoryId"));
         qw.eq(null != params.get("shFactoryId"),"p.sh_factory_id", params.get("shFactoryId"));
@@ -51,4 +60,82 @@ public class ProductionPlanServiceImpl implements ProductionPlanService {
         Page<ProductionPlanVo> page = productionPlanMapper.selectProductionPlanVo(pageQuery.build(), qw);
         return TableDataInfo.build(page);
     }
+
+    /**
+     * 更新数码印花厂id
+     * @param id 订单id
+     * @param outFactory 数码印花厂id
+     * @return 结果
+     */
+    @Override
+    public int updateOutFactory(Long id, int outFactory) {
+        UpdateWrapper<ProductionPlan> uw = new UpdateWrapper<>();
+        uw.eq("id", id).set("out_factory_id", outFactory);
+        return productionPlanMapper.update(uw);
+    }
+
+    /**
+     * 更新烧花厂id
+     * @param id 订单id
+     * @param SHFactory 烧花厂id
+     * @return 结果
+     */
+    @Override
+    public int updateSHFactory(Long id, int SHFactory) {
+        UpdateWrapper<ProductionPlan> uw = new UpdateWrapper<>();
+        uw.eq("id", id).set("sh_factory_id", SHFactory);
+        return productionPlanMapper.update(uw);
+    }
+
+    /**
+     * 更新订单状态
+     * @param id 订单id
+     * @param craftStatus 状态码
+     * @return 结果
+     */
+    @Override
+    public int updateCraftStatus(Long id, int craftStatus) {
+        UpdateWrapper<ProductionPlan> uw = new UpdateWrapper<>();
+        uw.eq("id", id).set("craft_status", craftStatus);
+        return productionPlanMapper.update(uw);
+    }
+
+    /**
+     * 更新打印状态
+     * @param id 订单id
+     * @param printStatus 打印状态码
+     * @return 结果
+     */
+    @Override
+    public int updatePrintStatus(Long id, int printStatus) {
+        UpdateWrapper<ProductionPlan> uw = new UpdateWrapper<>();
+        uw.eq("id", id).set("print_status", printStatus);
+        return productionPlanMapper.update(uw);
+    }
+
+    /**
+     * 更新发货时间
+     * @param id 订单id
+     * @param deliveryTime 发货时间
+     * @return 结果
+     */
+    @Override
+    public int updateDeliveryTime(Long id, Date deliveryTime) {
+        UpdateWrapper<ProductionPlan> uw = new UpdateWrapper<>();
+        uw.eq("id", id).set("shipping_time", deliveryTime);
+        return productionPlanMapper.update(uw);
+    }
+
+    /**
+     * 更新确认收货时间
+     * @param id 订单id
+     * @param confirmDeliveryTime 确认收货时间
+     * @return 结果
+     */
+    @Override
+    public int updateConfirmDeliveryTime(Long id, Date confirmDeliveryTime) {
+        UpdateWrapper<ProductionPlan> uw = new UpdateWrapper<>();
+        uw.eq("id", id).set("confirm_delivery_time", confirmDeliveryTime);
+        return productionPlanMapper.update(uw);
+    }
 }