| | |
| | | } |
| | | 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) |
| | |
| | | }) |
| | | } |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //添加排产数据 |
| | | //删除排产数据 |
| | | @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,"审核失败"); |
| | | |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | now() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="ExamineSchedulingMp"> |
| | | update production_scheduling set review_status=1,reviewer=#{userName} where |
| | | scheduling_id=#{schedulingId} |
| | | </update> |
| | | </mapper> |
| | |
| | | now() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="ExamineSchedulingMp"> |
| | | update production_scheduling set review_status=1,reviewer=#{userName} where |
| | | scheduling_id=#{schedulingId} |
| | | </update> |
| | | </mapper> |