chenlu
2024-03-07 2ad08ea181d8ec1e2b4b90bd1ddd40a2ba595b59
提交更新
6个文件已修改
94 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -395,10 +395,13 @@
            }
            const type = await VXETable.modal.confirm('您确定要删除该数据?')
            if (type === 'confirm') {
              //保存排产数据
              request.post("/productionScheduling/deleteScheduling").then((res) => {
              let schedulingData = ref({
                scheduling: selectRecords,
              })
              request.post("/productionScheduling/deleteScheduling",schedulingData.value).then((res) => {
                if (res.code == 200) {
                  ElMessage.success("保存成功")
                  ElMessage.success("删除成功")
                  location.reload();
                } else {
                  ElMessage.warning(res.msg)
@@ -407,10 +410,34 @@
              })
            }
          }
          return;
        }
        case 'review': {
          const $table = xGrid.value
          const selectRecords = $table.getCheckboxRecords()
          if ($table) {
            if (selectRecords.length == 0) {
              ElMessage.warning("请勾选排产数据")
              return;
            }
            let schedulingData = ref({
              scheduling: selectRecords,
              userName: username//审核人
            })
            request.post("/productionScheduling/examineScheduling",schedulingData.value).then((res) => {
              if (res.code == 200) {
                ElMessage.success("审核成功")
                location.reload();
              } else {
                ElMessage.warning(res.msg)
        }
            })
      }
          return;
        }
      }
    }
  },
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java
@@ -64,14 +64,25 @@
        }
    }
    //添加排产数据
    //删除排产数据
    @PostMapping("/deleteScheduling")
    public Result DeleteScheduling( @RequestBody Map<String,Object>  object){
    public Result DeleteScheduling( @RequestBody Map<String,Object>  object) throws Exception{
        if(productionSchedulingService.AddSchedulingSv(object)){
        if(productionSchedulingService.DeleteSchedulingSv(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"保存失败");
            throw new ServiceException(Constants.Code_500,"删除失败");
        }
    }
    @PostMapping("/examineScheduling")
    public Result ExamineScheduling( @RequestBody Map<String,Object>  object){
        if(productionSchedulingService.ExamineSchedulingSv(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"审核失败");
        }
    }
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java
@@ -1,5 +1,6 @@
package com.example.erp.mapper.pp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.erp.entity.pp.ProductionScheduling;
import org.apache.ibatis.annotations.Mapper;
@@ -9,7 +10,7 @@
import java.util.Map;
@Mapper
public interface ProductionSchedulingMapper {
public interface ProductionSchedulingMapper extends BaseMapper<ProductionScheduling> {
    List<Map<String,String>> SelectOkSchedulingMp(String selectTime1, String selectTime2,String orderId,String processes, ProductionScheduling productionScheduling);
@@ -23,4 +24,6 @@
    Integer selectMaxId();
    Boolean insertSelective(String schedulingId, String orderId, String orderNumber, String processes, Integer schedulingQuantity, LocalDate scheduledStartTime, LocalDate planEndTime, String notes);
    Boolean ExamineSchedulingMp(String schedulingId, String userName);
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.erp.entity.pp.ProductionScheduling;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.mapper.pp.ProductionSchedulingMapper;
@@ -92,4 +93,30 @@
        }
    }
    public boolean DeleteSchedulingSv(Map<String, Object> object) throws Exception {
        JSONObject objJson = new JSONObject(object);
        List<ProductionScheduling> Scheduling = JSONArray.parseArray(JSONObject.toJSONString(objJson.get("scheduling")), ProductionScheduling.class);
        productionSchedulingMapper.delete(new LambdaQueryWrapper<ProductionScheduling>().eq(ProductionScheduling::getSchedulingId, Scheduling.get(0).getId()));
        return true;
    }
    public boolean ExamineSchedulingSv(Map<String, Object> object) {
        String userName = "";
        if (object.get("userName") != null) {
            userName = object.get("userName").toString();
        }
        List<ProductionScheduling> schedulinglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("scheduling")), ProductionScheduling.class);
        if (!schedulinglist.isEmpty()) {
            for (ProductionScheduling productionScheduling : schedulinglist) {
                productionSchedulingMapper.ExamineSchedulingMp(productionScheduling.getSchedulingId(),userName);
                // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId());
            }
            return true;
        }
        else {
            return false;
        }
    }
}
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml
@@ -151,4 +151,9 @@
               now()
              )
    </insert>
    <update id="ExamineSchedulingMp">
        update production_scheduling set review_status=1,reviewer=#{userName} where
        scheduling_id=#{schedulingId}
    </update>
</mapper>
north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml
@@ -151,4 +151,9 @@
               now()
              )
    </insert>
    <update id="ExamineSchedulingMp">
        update production_scheduling set review_status=1,reviewer=#{userName} where
        scheduling_id=#{schedulingId}
    </update>
</mapper>