派工增加查询字段

master
Leon 4 years ago
parent 1f090f3466
commit cabff3e6af

@ -185,7 +185,7 @@
AND ZT.MODIFIED_DATE_TIME >= TO_DATE(#{startFromDate}, 'YYYY-MM-DD')
</if>
<if test="startToDate != null and startToDate != ''" >
AND ZT.MODIFIED_DATE_TIME &lt;= TO_DATE(#{startToDate}|| '23:55:59', 'YYYY-MM-DD HH24:MI:SS')
AND ZT.MODIFIED_DATE_TIME &lt;= TO_DATE(#{startToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
</select>
</mapper>

@ -38,7 +38,7 @@ spring:
merge-sql: true
slow-sql-millis: 100
activemq:
enabled: false
enabled: true
brokerUrl: tcp://localhost:61616?wireFormat.maxInactivityDuration=0
password: admin
user: admin

@ -8,7 +8,7 @@ spring:
driver-class-name: com.sap.db.jdbc.Driver
jndi-name: jdbc/jts/wipPool
activemq:
enabled: false
enabled: true
brokerUrl: tcp://172.16.251.133:61616?wireFormat.maxInactivityDuration=0
password: admin
user: admin

@ -43,101 +43,20 @@ public class SfcDispatchController {
@Autowired
public SfcDispatchService sfcDispatchService;
/**
*
*
* @param workCenter
* @param dispatchStatus
* @param item
* @param workOrder
* @param shopOrder
* @param resrce
* @param resourceType
* @param operation
* @param sfc
* @param componentDescription
* @param turnOperation
* @param isDispatch
* @param startFromDate_S
* @param startToDate_S
* @param completeFromDate_S
* @param completeToDate_S
* @return
*/
@ResponseBody
@GetMapping("getSfcDispatch")
public R getSfcDispatch(String workCenter, String dispatchStatus, String item, String itemNumber, String workOrder, String shopOrder, String blankingSize,
String resrce, String resourceType, String operation, String operationDescription, String sfc, String component, String componentDescription, String turnOperation,
String isDispatch, String startFromDate_S, String startToDate_S, String completeFromDate_S, String completeToDate_S) {
List<SfcDispatchDto> list;
try {
SfcDispatchDto sfcDispatchDto = new SfcDispatchDto();
sfcDispatchDto.setSite(CommonMethods.getSite());
sfcDispatchDto.setUser(CommonMethods.getUser());
sfcDispatchDto.setWorkCenter(workCenter);
sfcDispatchDto.setDispatchStatus(dispatchStatus);
sfcDispatchDto.setItem(item);
sfcDispatchDto.setItemNumber(itemNumber);
sfcDispatchDto.setWorkOrder(workOrder);
sfcDispatchDto.setShopOrder(shopOrder);
sfcDispatchDto.setResrce(resrce);
sfcDispatchDto.setResourceType(resourceType);
sfcDispatchDto.setOperation(operation);
sfcDispatchDto.setSfc(sfc);
sfcDispatchDto.setBlankingSize(blankingSize);
sfcDispatchDto.setComponent(component);
sfcDispatchDto.setComponentDescription(componentDescription);
sfcDispatchDto.setTurnOperation(turnOperation);
sfcDispatchDto.setIsDispatch(isDispatch);
if (startFromDate_S != null) {
sfcDispatchDto.setStartFromDate(DateUtil.parse(startFromDate_S));
}
if (startToDate_S != null) {
sfcDispatchDto.setStartToDate(DateUtil.parse(startToDate_S));
}
if (completeFromDate_S != null) {
sfcDispatchDto.setCompleteFromDate(DateUtil.parse(completeFromDate_S));
}
if (completeToDate_S != null) {
sfcDispatchDto.setCompleteToDate(DateUtil.parse(completeToDate_S));
}
list = sfcDispatchService.findSfcDispatchList(sfcDispatchDto);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok(list);
}
/**
*
*
* @param sfcDispatchDto
* @param paramMap
* @return
*/
@ResponseBody
@PostMapping("findSfcDispatch")
public R findSfcDispatch(@RequestBody SfcDispatchDto sfcDispatchDto) {
@GetMapping("findSfcDispatch")
public R findSfcDispatch(@RequestParam(required = false) Map paramMap) {
List<SfcDispatchDto> list;
try {
sfcDispatchDto.setSite(CommonMethods.getSite());
sfcDispatchDto.setUser(CommonMethods.getUser());
if (sfcDispatchDto.getStartFromDate_S() != null) {
sfcDispatchDto.setStartFromDate(DateUtil.parse(sfcDispatchDto.getStartFromDate_S()));
}
if (sfcDispatchDto.getStartToDate_S() != null) {
sfcDispatchDto.setStartToDate(DateUtil.parse(sfcDispatchDto.getStartToDate_S()));
}
if (sfcDispatchDto.getCompleteFromDate_S() != null) {
sfcDispatchDto.setCompleteFromDate(DateUtil.parse(sfcDispatchDto.getCompleteFromDate_S()));
}
if (sfcDispatchDto.getCompleteToDate_S() != null) {
sfcDispatchDto.setCompleteToDate(DateUtil.parse(sfcDispatchDto.getCompleteToDate_S()));
}
list = sfcDispatchService.findSfcDispatchList(sfcDispatchDto);
paramMap.put("site", CommonMethods.getSite());
list = sfcDispatchService.findSfcDispatchList(paramMap);
} catch (Exception e) {
return R.failed(e.getMessage());
}
@ -297,24 +216,16 @@ public class SfcDispatchController {
return R.ok(result);
}
@PostMapping("/gantt-list")
public R ganttList(@RequestBody SfcDispatchDto sfcDispatchDto) {
public R ganttList(@RequestParam(required = false) Map paramMap) {
Map<String, Object> result = new HashMap<>();
try {
String site = CommonMethods.getSite();
if (StringUtil.isBlank(sfcDispatchDto.getStartFromDate_S())) {
throw BusinessException.build("派工开始时间不能为空!");
}
if (StringUtil.isBlank(sfcDispatchDto.getStartToDate_S())) {
throw BusinessException.build("派工开始时间不能为空!");
}
sfcDispatchDto.setSite(site);
sfcDispatchDto.setDispatchStatus(DispatchStatusEnum.RELEASE.getCode());
sfcDispatchDto.setStartFromDate(DateUtil.parseDate(sfcDispatchDto.getStartFromDate_S()));
sfcDispatchDto.setStartToDate(DateUtil.parseDate(sfcDispatchDto.getStartToDate_S()));
result = sfcDispatchService.ganttList(site, sfcDispatchDto);
paramMap.put("site", site);
paramMap.put("", DispatchStatusEnum.RELEASE.getCode());
result = sfcDispatchService.ganttList(site, paramMap);
} catch (Exception e) {
return R.failed(e.getMessage());
}

@ -8,6 +8,7 @@ import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -25,10 +26,10 @@ public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
/**
*
*
* @param sfcDispatchDto
* @param paramMap
* @return
*/
List<SfcDispatchDto> findSfcDispatchList(SfcDispatchDto sfcDispatchDto);
List<SfcDispatchDto> findSfcDispatchList(Map paramMap);
/**
*

@ -33,10 +33,10 @@ public interface SfcDispatchService extends IService<SfcDispatch> {
/**
*
*
* @param sfcDispatchDto
* @param paramMap
* @return
*/
List<SfcDispatchDto> findSfcDispatchList(SfcDispatchDto sfcDispatchDto);
List<SfcDispatchDto> findSfcDispatchList(Map paramMap);
/**
*
@ -105,10 +105,10 @@ public interface SfcDispatchService extends IService<SfcDispatch> {
*
*
* @param site
* @param sfcDispatchDto
* @param paramMap
* @return
*/
Map<String, Object> ganttList(String site, SfcDispatchDto sfcDispatchDto);
Map<String, Object> ganttList(String site, Map paramMap);
}

@ -88,8 +88,8 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
@Override
public List<SfcDispatchDto> findSfcDispatchList(SfcDispatchDto sfcDispatchDto) {
List<SfcDispatchDto> list = sfcDispatchMapper.findSfcDispatchList(sfcDispatchDto);
public List<SfcDispatchDto> findSfcDispatchList(Map paramMap) {
List<SfcDispatchDto> list = sfcDispatchMapper.findSfcDispatchList(paramMap);
if (list == null || list.size() <= 0) {
return list;
}
@ -282,11 +282,11 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
@Override
public Map<String, Object> ganttList(String site, SfcDispatchDto sfcDispatchDto) {
public Map<String, Object> ganttList(String site, Map paramMap) {
Map<String, Object> map = new HashMap<>();
//查询派工数据
List<SfcDispatchDto> scheduleList = this.findSfcDispatchList(sfcDispatchDto);
List<SfcDispatchDto> scheduleList = this.findSfcDispatchList(paramMap);
if (scheduleList == null || scheduleList.size() <= 0) {
return map;
}
@ -299,7 +299,9 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
});
Map<String, Map<String, List<WorkCenterWorkTimeDTO>>> processedMap = this.processWorkCenterWorkTimes(site, workCenterList, sfcDispatchDto.getStartFromDate(), sfcDispatchDto.getStartToDate());
Date startFromDate = (Date) paramMap.get("startFromDate");
Date StartToDate = (Date) paramMap.get("StartToDate");
Map<String, Map<String, List<WorkCenterWorkTimeDTO>>> processedMap = this.processWorkCenterWorkTimes(site, workCenterList, startFromDate, StartToDate);
map.put("workCenterWorkTimes", processedMap);
return map;

@ -750,14 +750,18 @@
AND SO.PLANNED_START_DATE &lt;= #{startToDate}
</if>
<if test="completeFromDate != null">
AND SO.PLANNED_COMP_DATE >= #{completeFromDate}
AND SO.PLANNED_COMP_DATE >= TO_DATE(#{completeFromDate}, 'YYYY-MM-DD')
</if>
<if test="completeToDate != null">
AND SO.PLANNED_COMP_DATE &lt;= #{completeToDate}
AND SO.PLANNED_COMP_DATE &lt;= TO_DATE(#{completeToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
) WIP
LEFT JOIN Z_SFC_DISPATCH V1 ON V1.SITE = WIP.SITE AND V1.SFC = WIP.SFC AND V1.DISPATCH_SEQ = WIP.BEFORE_SEQ
LEFT JOIN Z_SFC_DISPATCH V2 ON V2.SITE = WIP.SITE AND V2.SFC = WIP.SFC AND V2.DISPATCH_SEQ = WIP.AFTER_SEQ
WHERE 1 = 1
<if test="isCompleted != null and isCompleted != '' and isCompleted = 'true'">
AND V1.DISPATCH_STATUS = 'COMPLETE'
</if>
ORDER BY WIP.SHOP_ORDER, WIP.SFC, TO_NUMBER(WIP.DISPATCH_SEQ)
</select>

@ -39,14 +39,17 @@
<if test="workCenter != null and workCenter != ''">
AND B.WORK_CENTER = #{workCenter}
</if>
<choose>
<when test="category != null and category != ''">
AND B.CATEGORY = #{category}
</when>
<otherwise>
AND (B.CATEGORY = 'S' OR B.CATEGORY = 'P')
</otherwise>
</choose>
<choose>
<when test="category != null and category != ''">
AND B.CATEGORY = #{category}
</when>
<otherwise>
AND (B.CATEGORY = 'S' OR B.CATEGORY = 'P')
</otherwise>
</choose>
<if test="taskNo != null and taskNo != ''">
AND B.TASK_NO =#{taskNo}
</if>
<if test="status != null and status != ''">
AND B.STATUS = #{status}
</if>

Loading…
Cancel
Save