8 changed files with 178 additions and 5 deletions
-
59src/main/java/com/gaotao/modules/schedule/controller/SchedulingController.java
-
9src/main/java/com/gaotao/modules/schedule/mapper/ScheduleMapper.java
-
25src/main/java/com/gaotao/modules/schedule/mapper/SchedulingMapper.java
-
21src/main/java/com/gaotao/modules/schedule/service/SchedulingService.java
-
11src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java
-
32src/main/java/com/gaotao/modules/schedule/service/impl/SchedulingServiceImpl.java
-
9src/main/resources/mapper/schedule/ScheduleMapper.xml
-
17src/main/resources/mapper/schedule/SchedulingMapper.xml
@ -0,0 +1,59 @@ |
|||||
|
package com.gaotao.modules.schedule.controller; |
||||
|
|
||||
|
import com.gaotao.common.utils.R; |
||||
|
import com.gaotao.modules.schedule.data.SearchScheduleData; |
||||
|
import com.gaotao.modules.schedule.data.ShiftInfoData; |
||||
|
import com.gaotao.modules.schedule.service.SchedulingService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author LR |
||||
|
* @Description 排产的操作 |
||||
|
* @DateTime 2022/2/28 11:15 |
||||
|
* @Param |
||||
|
* @return |
||||
|
**/ |
||||
|
@RestController |
||||
|
@RequestMapping(value = "/scheduling") |
||||
|
public class SchedulingController { |
||||
|
|
||||
|
@Autowired |
||||
|
private SchedulingService schedulingService; |
||||
|
|
||||
|
/** |
||||
|
* @Author LR |
||||
|
* @Description 获取当前的机台对应的加工中心 |
||||
|
* @DateTime 2022/2/28 14:39 |
||||
|
* @Param [inData] |
||||
|
* @return com.gaotao.common.utils.R |
||||
|
**/ |
||||
|
@PostMapping(value = "getCurrentWorkCenterNoByResourceId") |
||||
|
public R getCurrentWorkCenterNoByResourceId(@RequestBody SearchScheduleData inData){ |
||||
|
String workCenterNo = schedulingService.getCurrentWorkCenterNoByResourceId(inData); |
||||
|
return R.ok() |
||||
|
.put("code", 200) |
||||
|
.put("msg", "操作成功!") |
||||
|
.put("workCenterNo", workCenterNo); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.gaotao.modules.schedule.mapper; |
||||
|
|
||||
|
import com.gaotao.modules.schedule.data.SearchScheduleData; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
/** |
||||
|
* @Author LR |
||||
|
* @Description 接口mapper |
||||
|
* @DateTime 2022/2/28 14:42 |
||||
|
* @Param |
||||
|
* @return |
||||
|
**/ |
||||
|
@Mapper |
||||
|
@Repository |
||||
|
public interface SchedulingMapper { |
||||
|
/** |
||||
|
* @Author LR |
||||
|
* @Description 获取当前的机台对应的加工中心 |
||||
|
* @DateTime 2022/2/28 14:48 |
||||
|
* @Param [inData] |
||||
|
* @return java.lang.String |
||||
|
**/ |
||||
|
String getCurrentWorkCenterNoByResourceId(SearchScheduleData inData); |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.gaotao.modules.schedule.service; |
||||
|
|
||||
|
import com.gaotao.modules.schedule.data.SearchScheduleData; |
||||
|
|
||||
|
/** |
||||
|
* @Author LR |
||||
|
* @Description 排产使用的service |
||||
|
* @DateTime 2022/2/28 14:40 |
||||
|
* @Param |
||||
|
* @return |
||||
|
**/ |
||||
|
public interface SchedulingService { |
||||
|
/** |
||||
|
* @Author LR |
||||
|
* @Description 获取当前的机台对应的加工中心 |
||||
|
* @DateTime 2022/2/28 14:44 |
||||
|
* @Param [inData] |
||||
|
* @return java.lang.String |
||||
|
**/ |
||||
|
String getCurrentWorkCenterNoByResourceId(SearchScheduleData inData); |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
package com.gaotao.modules.schedule.service.impl; |
||||
|
|
||||
|
import com.gaotao.common.exception.RRException; |
||||
|
import com.gaotao.modules.schedule.data.SearchScheduleData; |
||||
|
import com.gaotao.modules.schedule.mapper.SchedulingMapper; |
||||
|
import com.gaotao.modules.schedule.service.SchedulingService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @Author LR |
||||
|
* @Description 排产接口的实现类 |
||||
|
* @DateTime 2022/2/28 14:41 |
||||
|
* @Param |
||||
|
* @return |
||||
|
**/ |
||||
|
@Service |
||||
|
public class SchedulingServiceImpl implements SchedulingService { |
||||
|
|
||||
|
@Autowired |
||||
|
private SchedulingMapper schedulingMapper; |
||||
|
|
||||
|
@Override |
||||
|
public String getCurrentWorkCenterNoByResourceId(SearchScheduleData inData) { |
||||
|
String workCenterNo = schedulingMapper.getCurrentWorkCenterNoByResourceId(inData); |
||||
|
//判断是否存在 |
||||
|
if(null == workCenterNo || "".equalsIgnoreCase(workCenterNo)){ |
||||
|
throw new RRException("机台编码有误!"); |
||||
|
} |
||||
|
return workCenterNo; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,17 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.gaotao.modules.schedule.mapper.SchedulingMapper"> |
||||
|
|
||||
|
<!--查询加工中心的信息通过机台--> |
||||
|
<select id="getCurrentWorkCenterNoByResourceId" parameterType="SearchScheduleData" resultType="java.lang.String"> |
||||
|
SELECT WorkCenterNo workCenterNo FROM WorkCenterResource wcr |
||||
|
<where> |
||||
|
wcr.Site = #{site} |
||||
|
<if test="resourceId != null and resourceId != ''"> |
||||
|
AND wcr.ResourceID = #{resourceId} |
||||
|
</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue