| | |
| | | return Result.success(manufactureOrderService.sePros(schedulingId)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ ¹æ®çäº§è®¢åæ¥çç产计å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "manOrdId", value = "ç产订åid", dataTypeClass = Integer.class, required = true), |
| | |
| | | return Result.success(manufactureSchedulingService.selectProduceTable(manOrdId, productName, startTime, endTime)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ¥çæäº§è¯¦æ
-->失ç¦ä¿®æ¹æ¶é´") |
| | | @ApiOperation(value = "æ¥çæäº§è¯¦æ
-->åæ¢ä¿®æ¹æ¶é´ä¸å¨æ") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "å·¥åºId", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "schedulingId", value = "æäº§Id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "startTime", value = "å¼å§æ¶é´", dataTypeClass = String.class, required = true, dataType = "date") |
| | | @ApiImplicitParam(name = "startTime", value = "å¼å§æ¶é´", dataTypeClass = String.class, required = true, dataType = "date"), |
| | | @ApiImplicitParam(name = "period", value = "卿", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/update_time") |
| | | public Result<?> updateTime(Integer technologyId, Integer schedulingId, String startTime) { |
| | | Integer isUpdateSuccess = manufactureOrderProcessService.updateTime(technologyId, schedulingId, startTime); |
| | | if (isUpdateSuccess >= 1) { |
| | | return Result.success("æ´æ°æåï¼"); |
| | | } |
| | | return Result.fail("æ´æ°å¤±è´¥ï¼"); |
| | | public Result<?> updateTime(Integer technologyId, Integer schedulingId, String startTime, Integer period) { |
| | | manufactureOrderProcessService.updateTime(technologyId, schedulingId, startTime, period); |
| | | return Result.success("æ´æ°æåï¼"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.yuanchu.mom.service.ManufactureSchedulingService; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * ç产订å表(ManufactureOrder)表æ§å¶å± |
| | | * |
| | | * @author XiaoRuby |
| | | * @since 2023-09-3 14:16:24 |
| | | */ |
| | | @Api(tags = "ç产管ç-->ç产æ¥å·¥") |
| | | @RestController |
| | | @RequestMapping("/productionReport") |
| | | public class ProductionReportController { |
| | | @Autowired |
| | | private ManufactureSchedulingService manufactureSchedulingService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ç产订åå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "customerName", value = "客æ·åç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "orderNumber", value = "订åç¼å·", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "productName", value = "产ååç§°", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllManord") |
| | | public Result<?> selectAllManord(Integer pageSize, Integer countSize, String customerName, String orderNumber, String productName, Integer type) { |
| | | |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç¹å»æ°å¢-->æ¥è¯¢æææäº§è®¡å") |
| | | @PostMapping("add_show_scheduling") |
| | | public Result<?> reportSelectScheduling() { |
| | | manufactureSchedulingService.reportSelectScheduling(); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥å·¥å¢å ") |
| | | @PostMapping("add") |
| | | public Result<?> productionReportAdd() { |
| | | |
| | | return Result.success(); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.yuanchu.mom.mybatis_config.MyBaseMapper; |
| | | import com.yuanchu.mom.pojo.ManufactureOrderProcess; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ManufactureOrderProcessMapper extends MyBaseMapper<ManufactureOrderProcess> { |
| | | |
| | | Integer updateTime(List<ManufactureOrderProcess> list); |
| | | |
| | | Date selectSchedulingStartTime(Integer schedulingId); |
| | | } |
| | |
| | | List<Map<String, Object>> selectProduceTable(Integer manOrdId, String productName, String startTime, String endTime); |
| | | |
| | | Map<String, Object> sePros(Integer schedulingId); |
| | | |
| | | List<Map<String, Object>> reportSelectScheduling(); |
| | | } |
| | |
| | | |
| | | import com.yuanchu.mom.pojo.ManufactureOrderProcess; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @param startTime å¼å§æ¶é´ |
| | | * @return |
| | | */ |
| | | Integer updateTime(Integer technologyId, Integer schedulingId, String startTime); |
| | | @Transactional(rollbackFor = Exception.class) |
| | | void updateTime(Integer technologyId, Integer schedulingId, String startTime, Integer period); |
| | | } |
| | |
| | | List<Map<String, Object>> selectProduceTable(Integer manOrdId, String productName, String startTime, String endTime); |
| | | |
| | | Map<String, Object> sePros(Integer schedulingId); |
| | | |
| | | List<Map<String, Object>> reportSelectScheduling(); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.mom.pojo.ManufactureOrderProcess; |
| | | import com.yuanchu.mom.mapper.ManufactureOrderProcessMapper; |
| | | import com.yuanchu.mom.pojo.ManufactureScheduling; |
| | | import com.yuanchu.mom.service.ManufactureOrderProcessService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.service.ManufactureSchedulingService; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private ManufactureOrderProcessMapper manufactureOrderProcessMapper; |
| | | |
| | | @Autowired |
| | | private ManufactureSchedulingService manufactureSchedulingService; |
| | | |
| | | @Override |
| | | public void batchInsert(List<ManufactureOrderProcess> manufactureOrderProcessesDate) { |
| | | manufactureOrderProcessMapper.insertBatchSomeColumn(manufactureOrderProcessesDate); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateTime(Integer technologyId, Integer schedulingId, String startTime) { |
| | | // // Hutool å·¥å
·ç±»è®¡ç®é´éå°æ¶ |
| | | public void updateTime(Integer technologyId, Integer schedulingId, String startTime, Integer period) { |
| | | // å
æ´æ°å¨æ |
| | | LambdaUpdateWrapper<ManufactureOrderProcess> updateWrapper = Wrappers.<ManufactureOrderProcess>lambdaUpdate() |
| | | .eq(ManufactureOrderProcess::getId, technologyId) |
| | | .set(ManufactureOrderProcess::getPeriod, period); |
| | | manufactureOrderProcessMapper.update(new ManufactureOrderProcess(), updateWrapper); |
| | | |
| | | |
| | | // å¦æå¨ææ´æ°å®æï¼æ ¹æ®æäº§Idæ¥è¯¢ææçå·¥åºId䏿¯éå·¥åºå¨æï¼ç»è¿å¤çç¶åæ¹éæ´æ°å¼å§æ¶é´ä¸ç»ææ¶é´ |
| | | // Hutool å·¥å
·ç±»è®¡ç®é´éå°æ¶ |
| | | Date startTime1 = DateUtil.parse(startTime); |
| | | // æ ¹æ®æäº§Idæ¥è¯¢ææå¯¹åºçå·¥åºæ°æ® |
| | | LambdaQueryWrapper<ManufactureOrderProcess> queryWrapper = Wrappers.<ManufactureOrderProcess>lambdaQuery() |
| | | .eq(ManufactureOrderProcess::getManufactureSchedulingId, schedulingId) |
| | | .select(ManufactureOrderProcess::getId, ManufactureOrderProcess::getPeriod); |
| | | List<ManufactureOrderProcess> list = manufactureOrderProcessMapper.selectList(queryWrapper); |
| | | |
| | | // |
| | | // å¼å§å¤çæ¥æ |
| | | for (int i = 0; i < list.size(); i++) { |
| | | if (Objects.equals(list.get(i).getId(), technologyId)){ |
| | | list.get(i).setStartTime(startTime1); |
| | |
| | | break; |
| | | } |
| | | } |
| | | MyUtil.PrintLog(list.toString()); |
| | | return null; |
| | | // return manufactureOrderProcessMapper.updateTime(list); |
| | | manufactureOrderProcessMapper.updateTime(list); |
| | | |
| | | |
| | | // 妿æ¹éæ´æ°æ¶é´æåï¼å¼å§æ´æ°æäº§è¡¨ä¸çå¼å§æ¶é´ä¸ç»ææ¶é´ |
| | | // è·åå·¥èºç计åå¼å§æ¶é´ |
| | | Date startDate = manufactureOrderProcessMapper.selectSchedulingStartTime(schedulingId); |
| | | // è·åå·¥èºçææå®ææ¶é´ |
| | | Date endDate = list.get(list.size() - 1).getEndTime(); |
| | | LambdaUpdateWrapper<ManufactureScheduling> updateWrapper1 = Wrappers.<ManufactureScheduling>lambdaUpdate() |
| | | .eq(ManufactureScheduling::getId, schedulingId) |
| | | .set(ManufactureScheduling::getStartTime, startDate) |
| | | .set(ManufactureScheduling::getEndTime, endDate); |
| | | manufactureSchedulingService.update(new ManufactureScheduling(), updateWrapper1); |
| | | } |
| | | } |
| | |
| | | import com.yuanchu.mom.pojo.ManufactureScheduling; |
| | | import com.yuanchu.mom.service.ManufactureOrderService; |
| | | import com.yuanchu.mom.service.ManufactureSchedulingService; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | public Map<String, Object> sePros(Integer schedulingId) { |
| | | //åºæ¬ä¿¡æ¯ |
| | | Map<String, Object> manufactureOrder = manufactureSchedulingService.sePros(schedulingId); |
| | | MyUtil.PrintLog(manufactureOrder.toString()); |
| | | //计åç¼å¶ |
| | | List<Map<String, Object>> mapList = manualTechnologyMapper.selectListTowTree(schedulingId); |
| | | manufactureOrder.put("message",mapList); |
| | |
| | | public Map<String, Object> sePros(Integer schedulingId) { |
| | | return manufactureSchedulingMapper.sePros(schedulingId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> reportSelectScheduling() { |
| | | return manufactureSchedulingMapper.reportSelectScheduling(); |
| | | } |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.ManufactureOrderProcessMapper"> |
| | | |
| | | <update id="updateTime" parameterType="integer"> |
| | | UPDATE manufacture_order_process p |
| | | <trim prefix="set" suffixOverrides=","> |
| | | <trim prefix="start_time =case" suffix="end,"> |
| | | <foreach collection="list" item="list" index="index"> |
| | | WHEN p.id=#{list.id} THEN #{list.startTime} |
| | | </foreach> |
| | | </trim> |
| | | <trim prefix="end_time =case" suffix="end,"> |
| | | <foreach collection="list" item="list" index="index"> |
| | | WHEN p.id=#{list.id} THEN #{list.endTime} |
| | | </foreach> |
| | | </trim> |
| | | </trim> |
| | | WHERE p.id in |
| | | <foreach collection="list" item="list" index="index" separator="," open="(" close=")"> |
| | | <if test="list.startTime != null and list.endTime != null"> |
| | | #{list.id, jdbcType=BIGINT} |
| | | </if> |
| | | </foreach> |
| | | </update> |
| | | |
| | | <select id="selectSchedulingStartTime" resultType="date"> |
| | | SELECT DATE_FORMAT(p.`start_time`, '%Y-%m-%d') |
| | | FROM manufacture_order_process p |
| | | WHERE p.`manufacture_scheduling_id` = #{schedulingId} |
| | | LIMIT 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | WHERE s.`manufacture_order_id` = o.`id` |
| | | AND s.`id` = #{schedulingId} |
| | | </select> |
| | | |
| | | <select id="reportSelectScheduling" resultType="map"> |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.110.209:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://192.168.191.113:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | username: user |
| | | password: 123456 |
| | | druid: |
| | |
| | | # redisæ°æ®åºç´¢å¼(é»è®¤ä¸º0)ï¼æä»¬ä½¿ç¨ç´¢å¼ä¸º3çæ°æ®åºï¼é¿å
åå
¶ä»æ°æ®åºå²çª |
| | | database: 0 |
| | | # redisæå¡å¨å°åï¼é»è®¤ä¸ºlocalhostï¼ |
| | | host: 192.168.110.209 |
| | | host: 192.168.191.113 |
| | | # redis端å£ï¼é»è®¤ä¸º6379ï¼ |
| | | port: 6379 |
| | | # redis访é®å¯ç ï¼é»è®¤ä¸ºç©ºï¼ |