Merge remote-tracking branch 'origin/master'

master
zpl 4 years ago
commit 94f84ac3bc

@ -8,7 +8,7 @@ package com.foreverwin.mesnac.common.constant;
*/ */
public interface Constants { public interface Constants {
String OP_6106GX = "WX_6106GX"; String OP_WX_6106GX = "WX_6106GX";
String STATUS_NEW = "NEW"; String STATUS_NEW = "NEW";
String STATE_CONFIRM ="CONF"; String STATE_CONFIRM ="CONF";
@ -185,4 +185,12 @@ public interface Constants {
*/ */
String UNTREATED = "UN"; //未处理 String UNTREATED = "UN"; //未处理
String PROCESSED = "PR"; //已处理 String PROCESSED = "PR"; //已处理
//用户组
String USER_GROUP_ADMINISTRATOR = "ADMINISTRATOR";
//车间调度
String USER_GROUP_CJDD = "CJDD";
//总计划
String USER_GROUP_ZJH = "ZJH";
} }

@ -85,11 +85,13 @@ public class SfcDispatchDto implements Serializable{
*/ */
@ExcelColumn("资源编号") @ExcelColumn("资源编号")
private String resrce; private String resrce;
private String resourceDescription;
/** /**
* *
*/ */
@ExcelColumn("操作者") @ExcelColumn("操作者")
private String employee; private String employee;
private String employeeDescription;
/** /**
* *
*/ */
@ -103,23 +105,25 @@ public class SfcDispatchDto implements Serializable{
*/ */
private Double prodHours; private Double prodHours;
/** /**
* *
*/ */
@ExcelColumn("计划开始时间") @ExcelColumn("计划开始时间")
private LocalDateTime plannedStartDate; private LocalDateTime plannedStartDate;
/** /**
* *
*/ */
@ExcelColumn("计划完成时间") @ExcelColumn("计划完成时间")
private LocalDateTime plannedCompDate; private LocalDateTime plannedCompDate;
/** /**
* *
*/ */
private LocalDateTime actualStartDate; @ExcelColumn("车间最早开始时间")
private LocalDateTime earliestStartDate;
/** /**
* *
*/ */
private LocalDateTime actualCompleteDate; @ExcelColumn("车间最晚结束时间")
private LocalDateTime latestEndDate;
/** /**
* *
*/ */
@ -176,14 +180,14 @@ public class SfcDispatchDto implements Serializable{
private BigDecimal completedQty; private BigDecimal completedQty;
private String resourceWorkCenter; private String resourceWorkCenter;
private String user;
private String role;
private String status; private String status;
private String locale; private String locale;
private String routerBo; private String routerBo;
private String statusName; private String statusName;
private LocalDateTime soReleasedDate; private LocalDateTime soReleasedDate;
private LocalDateTime sfcReleasedDate; private LocalDateTime sfcReleasedDate;
private LocalDateTime latestEndDate;
private LocalDateTime earliestStartDate;
private LocalDateTime releasedCompleteDate; private LocalDateTime releasedCompleteDate;
private LocalDateTime dispatchCompleteDate; private LocalDateTime dispatchCompleteDate;
@ -353,6 +357,14 @@ public class SfcDispatchDto implements Serializable{
this.resrce = resrce; this.resrce = resrce;
} }
public String getResourceDescription() {
return resourceDescription;
}
public void setResourceDescription(String resourceDescription) {
this.resourceDescription = resourceDescription;
}
public String getEmployee() { public String getEmployee() {
return employee; return employee;
} }
@ -361,6 +373,14 @@ public class SfcDispatchDto implements Serializable{
this.employee = employee; this.employee = employee;
} }
public String getEmployeeDescription() {
return employeeDescription;
}
public void setEmployeeDescription(String employeeDescription) {
this.employeeDescription = employeeDescription;
}
public String getTurnOperation() { public String getTurnOperation() {
return turnOperation; return turnOperation;
} }
@ -401,28 +421,29 @@ public class SfcDispatchDto implements Serializable{
this.plannedCompDate = plannedCompDate; this.plannedCompDate = plannedCompDate;
} }
public LocalDateTime getActualStartDate() {
return actualStartDate; public String getIsDispatch() {
return isDispatch;
} }
public void setActualStartDate(LocalDateTime actualStartDate) { public void setIsDispatch(String isDispatch) {
this.actualStartDate = actualStartDate; this.isDispatch = isDispatch;
} }
public LocalDateTime getActualCompleteDate() { public String getUser() {
return actualCompleteDate; return user;
} }
public void setActualCompleteDate(LocalDateTime actualCompleteDate) { public void setUser(String user) {
this.actualCompleteDate = actualCompleteDate; this.user = user;
} }
public String getIsDispatch() { public String getRole() {
return isDispatch; return role;
} }
public void setIsDispatch(String isDispatch) { public void setRole(String role) {
this.isDispatch = isDispatch; this.role = role;
} }
public String getStatus() { public String getStatus() {

@ -1,12 +1,13 @@
package com.foreverwin.mesnac.common.util; package com.foreverwin.mesnac.common.util;
import org.apache.activemq.ActiveMQConnectionFactory; import com.foreverwin.modular.core.exception.BaseException;
import org.json.JSONObject; import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.jms.*; import java.util.concurrent.TimeUnit;
/** /**
* @Description TODO * @Description TODO
@ -16,48 +17,27 @@ import javax.jms.*;
@Component @Component
@ConditionalOnProperty(prefix = "activeMq", value = {"enabled"}, matchIfMissing = true) @ConditionalOnProperty(prefix = "activeMq", value = {"enabled"}, matchIfMissing = true)
public class ActiveMQUtil { public class ActiveMQUtil {
@Value("${activeMq.sendWeChatMessage}")
private String weChatUrl;
@Value("${activeMq.queue}")
private String queue;
public void wechatSendMessage(String user, String text) {
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(weChatUrl);
Connection connection = null;
Session session = null;
MessageProducer producer = null;
try{
connection = factory.createConnection();
connection.start();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination destination = session.createQueue(this.queue);
producer = session.createProducer(destination);
@Autowired
private JmsMessagingTemplate defaultJmsTemplate;
public void wechatSendMessage(String user, String text) {
String queue = "send.weChat.notice";
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
//jsonObject.put("TO_USER", user);
jsonObject.put("TO_USER", "@all");
jsonObject.put("CONTENT",text);
String sendMessage = jsonObject.toString();
TextMessage textMessage = session.createTextMessage(sendMessage);
producer.send(textMessage);
}catch (Exception e){
// throw new BaseException("发送消息失败"+e.getMessage());
}finally {
try{ try{
if (producer != null) { jsonObject.put("TO_USER", user);
producer.close(); jsonObject.put("CONTENT",text);
} defaultJmsTemplate.getJmsTemplate().setReceiveTimeout(TimeUnit.SECONDS.toMillis(3));
if (session != null) { String message = defaultJmsTemplate.convertSendAndReceive(queue, jsonObject.toString(), String.class);
session.close(); if (StringUtil.isBlank(message)) {
} //记日志
if (connection != null) {
connection.close();
}
}catch (Exception e){
e.printStackTrace();
} }
}catch (Exception ignored){
throw new BaseException("消息发送失败");
} }
} }
} }

@ -0,0 +1,42 @@
#Spring
spring:
datasource:
dynamic:
primary: wip
datasource:
wip:
driver-class-name: com.sap.db.jdbc.Driver
jndi-name: jdbc/jts/wipPool
activemq:
enabled: false
brokerUrl: tcp://121.36.58.109:61616?wireFormat.maxInactivityDuration=0
password: admin
user: admin
pool:
enabled: true
max-connections: 10
#WebService
ws:
erp:
server: 172.16.251.223
port: 8000
user: mesd001
pwd: a123456
valid: N
ftp:
host:
port: 21
username:
password:
#打印服务器配置
print:
server: http://10.10.170.32:8022/print/mesnacprint
exportDocument:
filePath: /usr/word/
outputPath: /usr/word/outputWord/
template: SFC_SCRAP_TEMPLATE.ftl

@ -68,12 +68,13 @@ public class SfcDispatchController {
@ResponseBody @ResponseBody
@GetMapping("getSfcDispatch") @GetMapping("getSfcDispatch")
public R getSfcDispatch(String workCenter, String dispatchStatus, String item, String itemNumber, String workOrder, String shopOrder, public R getSfcDispatch(String workCenter, String dispatchStatus, String item, String itemNumber, String workOrder, String shopOrder,
String resrce, String resourceType, String operation, String sfc, String component, String componentDescription, String turnOperation, 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) { String isDispatch, String startFromDate_S, String startToDate_S, String completeFromDate_S, String completeToDate_S) {
List<SfcDispatchDto> list; List<SfcDispatchDto> list;
try { try {
SfcDispatchDto sfcDispatchDto = new SfcDispatchDto(); SfcDispatchDto sfcDispatchDto = new SfcDispatchDto();
sfcDispatchDto.setSite(CommonMethods.getSite()); sfcDispatchDto.setSite(CommonMethods.getSite());
sfcDispatchDto.setUser(CommonMethods.getUser());
sfcDispatchDto.setWorkCenter(workCenter); sfcDispatchDto.setWorkCenter(workCenter);
sfcDispatchDto.setDispatchStatus(dispatchStatus); sfcDispatchDto.setDispatchStatus(dispatchStatus);
sfcDispatchDto.setItem(item); sfcDispatchDto.setItem(item);
@ -121,6 +122,7 @@ public class SfcDispatchController {
List<SfcDispatchDto> list; List<SfcDispatchDto> list;
try { try {
sfcDispatchDto.setSite(CommonMethods.getSite()); sfcDispatchDto.setSite(CommonMethods.getSite());
sfcDispatchDto.setUser(CommonMethods.getUser());
if (sfcDispatchDto.getStartFromDate_S() != null) { if (sfcDispatchDto.getStartFromDate_S() != null) {
sfcDispatchDto.setStartFromDate(DateUtil.parse(sfcDispatchDto.getStartFromDate_S())); sfcDispatchDto.setStartFromDate(DateUtil.parse(sfcDispatchDto.getStartFromDate_S()));
} }
@ -143,33 +145,6 @@ public class SfcDispatchController {
} }
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<SfcDispatch> frontPage, SfcDispatch sfcDispatch){
IPage result;
QueryWrapper<SfcDispatch> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfcDispatch);
sfcDispatch.setSite(CommonMethods.getSite());
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.or().like(SfcDispatch::getShopOrder, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getSfc, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getDispatchNo, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getDispatchStatus, frontPage.getGlobalQuery())
);
}
result = sfcDispatchService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
@ResponseBody @ResponseBody
@PostMapping("/saveDispatch") @PostMapping("/saveDispatch")
public R saveDispatch(@RequestBody List<SfcDispatchDto> sfcDispatchList) { public R saveDispatch(@RequestBody List<SfcDispatchDto> sfcDispatchList) {

@ -158,10 +158,10 @@ public class UserResourceController {
@ResponseBody @ResponseBody
@GetMapping("/findEmployeeList") @GetMapping("/findEmployeeList")
public R findEmployeeList() { public R findEmployeeList(String resourceType) {
try { try {
String site = CommonMethods.getSite(); String site = CommonMethods.getSite();
return R.ok(userResourceService.findEmployeeList(site)); return R.ok(userResourceService.findEmployeeList(site, resourceType));
} catch (Exception e) { } catch (Exception e) {
return R.failed(e.getMessage()); return R.failed(e.getMessage());
} }

@ -1,10 +1,8 @@
package com.foreverwin.mesnac.dispatch.mapper; package com.foreverwin.mesnac.dispatch.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto; import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch; import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;

@ -20,7 +20,7 @@ import java.util.List;
@Repository @Repository
public interface UserResourceMapper extends BaseMapper<UserResource> { public interface UserResourceMapper extends BaseMapper<UserResource> {
List<NwaUser> findEmployeeList(@Param("site") String site); List<NwaUser> findEmployeeList(@Param("site") String site, @Param("resourceType") String resourceType);
List<UserResource> findEnableList(@Param("site") String site, @Param("resource") String resource, @Param("user") String user); List<UserResource> findEnableList(@Param("site") String site, @Param("resource") String resource, @Param("user") String user);

@ -115,6 +115,8 @@ public class SfcDispatch extends Model<SfcDispatch> {
*/ */
@TableField("EMPLOYEE") @TableField("EMPLOYEE")
private String employee; private String employee;
@TableField("EMPLOYEE_DESCRIPTION")
private String employeeDescription;
/** /**
* *
*/ */
@ -381,6 +383,14 @@ public class SfcDispatch extends Model<SfcDispatch> {
this.employee = employee; this.employee = employee;
} }
public String getEmployeeDescription() {
return employeeDescription;
}
public void setEmployeeDescription(String employeeDescription) {
this.employeeDescription = employeeDescription;
}
public String getTurnOperation() { public String getTurnOperation() {
return turnOperation; return turnOperation;
} }

@ -70,10 +70,9 @@ public interface ShopOrderReleaseService {
* *
* @param site * @param site
* @param user * @param user
* @param workCenter
* @param shopOrderModel * @param shopOrderModel
* @param sfcModel * @param sfcModel
* @param routerList * @param routerList
*/ */
void sfcDispatch(String site, String user, String workCenter, ShopOrder shopOrderModel, Sfc sfcModel, List<RouterDTO> routerList); void sfcDispatch(String site, String user, ShopOrder shopOrderModel, Sfc sfcModel, List<RouterDTO> routerList);
} }

@ -20,7 +20,7 @@ import java.util.List;
*/ */
public interface UserResourceService extends IService<UserResource> { public interface UserResourceService extends IService<UserResource> {
List<NwaUser> findEmployeeList(String site); List<NwaUser> findEmployeeList(String site, String resourceType);
List<UserResource> findEnableList(String site, String resource, String user); List<UserResource> findEnableList(String site, String resource, String user);

@ -74,7 +74,8 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//工序叫料数据 //工序叫料数据
for (SfcDispatchDto sfcDispatchDto : sfcDispatchList) { //Leon.L 2021/8/16 业务取消工序叫料
/**for (SfcDispatchDto sfcDispatchDto : sfcDispatchList) {
String prepositionStepId = sfcDispatchDto.getPrepositionStepId(); String prepositionStepId = sfcDispatchDto.getPrepositionStepId();
if (StringUtil.isBlank(prepositionStepId)) { if (StringUtil.isBlank(prepositionStepId)) {
continue; continue;
@ -101,7 +102,7 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
callItem.setModifyUser(user); callItem.setModifyUser(user);
callItem.setModifiedDateTime(nowDate); callItem.setModifiedDateTime(nowDate);
list.add(callItem); list.add(callItem);
} }**/
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -377,11 +378,11 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
String blankingSize = callItem.getBlankingSize(); String blankingSize = callItem.getBlankingSize();
//工序叫料不需要计算数量 //工序叫料不需要计算数量
if (Constants.CALL_TYPE_OPERATION.equals(callItem.getCallType())) { /**if (Constants.CALL_TYPE_OPERATION.equals(callItem.getCallType())) {
callItem.setSizeReqQty(BigDecimal.ONE); callItem.setSizeReqQty(BigDecimal.ONE);
compQtyMap.put(component, BigDecimal.ONE); compQtyMap.put(component, BigDecimal.ONE);
continue; continue;
} }**/
if (StringUtil.isBlank(blankingSize)) { if (StringUtil.isBlank(blankingSize)) {
callItem.setSizeReqQty(callItem.getRequiredQty()); callItem.setSizeReqQty(callItem.getRequiredQty());
@ -389,8 +390,10 @@ public class CallItemServiceImpl extends ServiceImpl<CallItemMapper, CallItem> i
continue; continue;
} }
if ("GB".equals(itemGroup)) { if (StringUtil.notBlank(itemGroup) && "GB".equals(itemGroup)) {
if (!blankingSize.contains("*")) { if (!blankingSize.contains("*") || blankingSize.split("\\*").length < 2) {
callItem.setSizeReqQty(callItem.getRequiredQty());
compQtyMap.put(component, callItem.getRequiredQty());
continue; continue;
} }

@ -25,6 +25,7 @@ import com.foreverwin.mesnac.meapi.dto.WorkCenterLinkDTO;
import com.foreverwin.mesnac.meapi.model.Router; import com.foreverwin.mesnac.meapi.model.Router;
import com.foreverwin.mesnac.meapi.model.Sfc; import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.meapi.model.ShopOrder; import com.foreverwin.mesnac.meapi.model.ShopOrder;
import com.foreverwin.mesnac.meapi.model.UserGroup;
import com.foreverwin.mesnac.meapi.service.*; import com.foreverwin.mesnac.meapi.service.*;
import com.foreverwin.mesnac.meapi.util.StringUtils; import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.exception.BaseException; import com.foreverwin.modular.core.exception.BaseException;
@ -36,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import sun.awt.geom.AreaOp;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
@ -67,6 +69,8 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
@Autowired @Autowired
private ShopOrderService shopOrderService; private ShopOrderService shopOrderService;
@Autowired @Autowired
private UserGroupService userGroupService;
@Autowired
private SfcDispatchMapper sfcDispatchMapper; private SfcDispatchMapper sfcDispatchMapper;
@Autowired @Autowired
private UserResourceService userResourceService; private UserResourceService userResourceService;
@ -86,7 +90,38 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
@Override @Override
public List<SfcDispatchDto> findSfcDispatchList(SfcDispatchDto sfcDispatchDto) { public List<SfcDispatchDto> findSfcDispatchList(SfcDispatchDto sfcDispatchDto) {
return sfcDispatchMapper.findSfcDispatchList(sfcDispatchDto); List<SfcDispatchDto> list = sfcDispatchMapper.findSfcDispatchList(sfcDispatchDto);
if (list == null || list.size() <= 0) {
return list;
}
//查询用户对应用户组
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
String userBo = HandleEnum.USER.getHandle(site, user);
List<UserGroup> userGroupList = userGroupService.getUserGroupListByUserBo(userBo);
String role = "ADMINISTRATOR";
if (userGroupList != null && userGroupList.size() > 0) {
for (UserGroup userGroupModel: userGroupList) {
String userGroup = userGroupModel.getUserGroup();
if (Constants.USER_GROUP_ADMINISTRATOR.equals(userGroup)) {
role = Constants.USER_GROUP_ADMINISTRATOR;
break;
} else if (Constants.USER_GROUP_CJDD.equals(userGroup)) {
role = Constants.USER_GROUP_CJDD;
break;
} else if (Constants.USER_GROUP_ZJH.equals(userGroup)) {
role = Constants.USER_GROUP_ZJH;
break;
}
}
}
//赋值用户组
for (SfcDispatchDto sfcDispatch: list) {
sfcDispatch.setRole(role);
}
return list;
} }
@Override @Override
@ -360,6 +395,10 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
message.append("派工单[" + dispatchNo + "]的派工状态不是新建,不允许保存"); message.append("派工单[" + dispatchNo + "]的派工状态不是新建,不允许保存");
continue; continue;
} }
//时间
sfcDispatchDto.setEarliestStartDate(sfcDispatchDto.getPlannedStartDate());
sfcDispatchDto.setLatestEndDate(sfcDispatchDto.getPlannedCompDate());
} }
//派工导入 //派工导入
@ -444,7 +483,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
continue; continue;
} }
//派工人员为多个 //派工人员为多个(只要一个匹配)
String [] employeeArray = new String[1]; String [] employeeArray = new String[1];
if (!employees.contains(",")) { if (!employees.contains(",")) {
employeeArray[0] = employees; employeeArray[0] = employees;
@ -452,7 +491,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
employeeArray = employees.split(","); employeeArray = employees.split(",");
} }
Boolean isMatch = false;
for (int m = 0; m < employeeArray.length; m++) { for (int m = 0; m < employeeArray.length; m++) {
String employee = employeeArray[m]; String employee = employeeArray[m];
List<UserResource> singleUserResourceList = usMap.get(employee); List<UserResource> singleUserResourceList = usMap.get(employee);
@ -464,7 +503,6 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
} }
Boolean isMatch = false;
for (int i = 0; i < singleUserResourceList.size(); i++) { for (int i = 0; i < singleUserResourceList.size(); i++) {
UserResource userResource = singleUserResourceList.get(i); UserResource userResource = singleUserResourceList.get(i);
if (resource.equals(userResource.getResrce())) { if (resource.equals(userResource.getResrce())) {
@ -472,21 +510,28 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
break; break;
} }
} }
if (isMatch) {break;}
}
if (!isMatch) { if (!isMatch) {
flag = false; flag = false;
message.append(seq++ % 3 == 0 ? "\n" : "| |"); message.append(seq++ % 3 == 0 ? "\n" : "| |");
message.append("派工单[" + dispatchNo + "]分配的操作员[" + employee + "]与资源[" + resource + "]不匹配"); message.append("派工单[" + dispatchNo + "]分配的操作员与资源[" + resource + "]不匹配");
continue; continue;
} }
} }
}
sfcDispatch.setResrce(resource); sfcDispatch.setResrce(resource);
sfcDispatch.setEmployee(employees); sfcDispatch.setEmployee(employees);
sfcDispatch.setEmployeeDescription(sfcDispatchDto.getEmployeeDescription());
sfcDispatch.setRemark(sfcDispatchDto.getRemark()); sfcDispatch.setRemark(sfcDispatchDto.getRemark());
sfcDispatch.setBlankingSize(sfcDispatchDto.getBlankingSize()); sfcDispatch.setBlankingSize(sfcDispatchDto.getBlankingSize());
sfcDispatch.setPlannedStartDate(sfcDispatchDto.getPlannedStartDate()); sfcDispatch.setPlannedStartDate(sfcDispatchDto.getPlannedStartDate());
sfcDispatch.setPlannedCompDate(sfcDispatchDto.getPlannedCompDate()); sfcDispatch.setPlannedCompDate(sfcDispatchDto.getPlannedCompDate());
sfcDispatch.setEarliestStartDate(sfcDispatchDto.getEarliestStartDate());
sfcDispatch.setLatestEndDate(sfcDispatchDto.getLatestEndDate());
//是否分配资源 //是否分配资源
if (StringUtil.notBlank(resource)) { if (StringUtil.notBlank(resource)) {
@ -532,7 +577,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
} }
shopOrderReleaseService.sfcDispatch(site, user, workCenter, shopOrderModel, sfcModel, routerList); shopOrderReleaseService.sfcDispatch(site, user, shopOrderModel, sfcModel, routerList);
} }
@Override @Override

@ -126,23 +126,6 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
throw new BaseException("工艺路线[" +StringUtils.trimHandle(routerBo)+ "]主数据不完整,请确认"); throw new BaseException("工艺路线[" +StringUtils.trimHandle(routerBo)+ "]主数据不完整,请确认");
} }
//获取车间
String workCenter = null;
String workCenterBo = null;
for (RouterDTO routerDTO: routerList) {
String operation = routerDTO.getOperation();
if (!Constants.OP_6106GX.equals(operation) && operation.contains("_")) {
workCenter = operation.split("_")[0];
workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter);
WorkCenter workCenterModel = workCenterService.getById(workCenterBo);
if (workCenterModel == null) {
throw BusinessException.build("生产车间【" +workCenter+ "】不存在");
}
break;
}
}
//工单下达 //工单下达
ReleaseShopOrderResponse response = null; ReleaseShopOrderResponse response = null;
try { try {
@ -169,16 +152,17 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
Sfc sfcModel = new Sfc(); Sfc sfcModel = new Sfc();
sfcModel.setSfc(releasedSfc.getSfc()); sfcModel.setSfc(releasedSfc.getSfc());
sfcModel.setQty(releasedSfc.getQuantity().doubleValue()); sfcModel.setQty(releasedSfc.getQuantity().doubleValue());
sfcDispatch(site, user, workCenter, shopOrderModel, sfcModel, routerList); sfcDispatch(site, user, shopOrderModel, sfcModel, routerList);
}//end for sfcList }//end for sfcList
//修改工单的计划工作中心 //修改工单的计划工作中心
if (StringUtils.notBlank(workCenter)) { //工单对应多个车间,所以工单不写计划工作中心
/**if (StringUtils.notBlank(workCenter)) {
ShopOrder updateShopOrder = new ShopOrder(); ShopOrder updateShopOrder = new ShopOrder();
updateShopOrder.setHandle(shopOrderBo); updateShopOrder.setHandle(shopOrderBo);
updateShopOrder.setPlannedWorkCenterBo(workCenterBo); updateShopOrder.setPlannedWorkCenterBo(workCenterBo);
shopOrderService.updateById(updateShopOrder); shopOrderService.updateById(updateShopOrder);
} }*/
} //end for shopOrderList } //end for shopOrderList
} }
@ -186,7 +170,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
/**派工--按工序**/ /**派工--按工序**/
@Override @Override
public void sfcDispatch(String site, String user, String workCenter, ShopOrder shopOrderModel, Sfc sfcModel, List<RouterDTO> routerList) { public void sfcDispatch(String site, String user, ShopOrder shopOrderModel, Sfc sfcModel, List<RouterDTO> routerList) {
LocalDateTime nowDate = LocalDateTime.now(); LocalDateTime nowDate = LocalDateTime.now();
String router = routerList.get(0).getRouter(); String router = routerList.get(0).getRouter();
@ -244,6 +228,19 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
//计算完成时间 //计算完成时间
//plannedCompleteDate = plannedStartDate.plusMinutes(prodHours.longValue()); //plannedCompleteDate = plannedStartDate.plusMinutes(prodHours.longValue());
//查询工序所属车间
String workCenter = null;
if (operation.contains("_")) {
workCenter = operation.split("_")[0];
} else {
workCenter = operation;
}
String workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter);
WorkCenter workCenterModel = workCenterService.getById(workCenterBo);
if (workCenterModel == null) {
throw BusinessException.build("生产车间【" +workCenter+ "】不存在");
}
//派工数据 //派工数据
String dispatchNo = sfc + "-" + stepId; String dispatchNo = sfc + "-" + stepId;
SfcDispatch sfcDispatchModel = new SfcDispatch(); SfcDispatch sfcDispatchModel = new SfcDispatch();

@ -41,16 +41,13 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
@Autowired @Autowired
private ResrceService resrceService; private ResrceService resrceService;
@Autowired
private NwaUserService nwaUserService;
@Autowired @Autowired
private UserService userService; private UserService userService;
@Override @Override
public List<NwaUser> findEmployeeList(String site) { public List<NwaUser> findEmployeeList(String site, String resourceType) {
return userResourceMapper.findEmployeeList(site); return userResourceMapper.findEmployeeList(site, resourceType);
} }
@Override @Override

@ -892,7 +892,7 @@
LEFT JOIN ITEM_GROUP IG ON IG.HANDLE = IGM.ITEM_GROUP_BO LEFT JOIN ITEM_GROUP IG ON IG.HANDLE = IGM.ITEM_GROUP_BO
INNER JOIN SHOP_ORDER SO ON SO.SITE = L.SITE AND SO.SHOP_ORDER = L.SHOP_ORDER INNER JOIN SHOP_ORDER SO ON SO.SITE = L.SITE AND SO.SHOP_ORDER = L.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER' LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER'
WHERE L.SITE = #{site} AND L.STATUS = '802' WHERE L.SITE = #{site} AND L.STATUS = '802' AND L.CALL_TYPE = 'MATERIAL'
<if test="workCenter != null and workCenter != ''"> <if test="workCenter != null and workCenter != ''">
AND W.WORK_CENTER = #{workCenter} AND W.WORK_CENTER = #{workCenter}
</if> </if>
@ -923,8 +923,8 @@
) ZS ON ZS.SITE = L.SITE AND ZS.SFC = L.SFC ) ZS ON ZS.SITE = L.SITE AND ZS.SFC = L.SFC
INNER JOIN Z_SFC_DISPATCH ZD ON ZD.SITE = ZS.SITE AND ZD.SFC = ZS.SFC AND ZD.DISPATCH_SEQ = ZS.DISPATCH_SEQ INNER JOIN Z_SFC_DISPATCH ZD ON ZD.SITE = ZS.SITE AND ZD.SFC = ZS.SFC AND ZD.DISPATCH_SEQ = ZS.DISPATCH_SEQ
WHERE W.QTY_ON_HAND > 0 WHERE W.QTY_ON_HAND > 0
) SIP ) SIP ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO
ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO AND VIP.REQUIRED_QTY > 0 WHERE VIP.REQUIRED_QTY > 0
ORDER BY VIP.WORK_ORDER, VIP.ITEM ORDER BY VIP.WORK_ORDER, VIP.ITEM
</select> </select>
@ -940,7 +940,7 @@
LEFT JOIN ITEM_GROUP IG ON IG.HANDLE = IGM.ITEM_GROUP_BO LEFT JOIN ITEM_GROUP IG ON IG.HANDLE = IGM.ITEM_GROUP_BO
INNER JOIN SHOP_ORDER SO ON SO.SITE = L.SITE AND SO.SHOP_ORDER = L.SHOP_ORDER INNER JOIN SHOP_ORDER SO ON SO.SITE = L.SITE AND SO.SHOP_ORDER = L.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER' LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER'
WHERE L.SITE = #{site} AND L.STATUS = '802' WHERE L.SITE = #{site} AND L.STATUS = '802' AND L.CALL_TYPE = 'MATERIAL'
<if test="workCenter != null and workCenter != ''"> <if test="workCenter != null and workCenter != ''">
AND W.WORK_CENTER = #{workCenter} AND W.WORK_CENTER = #{workCenter}
</if> </if>
@ -971,8 +971,8 @@
) ZS ON ZS.SITE = L.SITE AND ZS.SFC = L.SFC ) ZS ON ZS.SITE = L.SITE AND ZS.SFC = L.SFC
INNER JOIN Z_SFC_DISPATCH ZD ON ZD.SITE = ZS.SITE AND ZD.SFC = ZS.SFC AND ZD.DISPATCH_SEQ = ZS.DISPATCH_SEQ INNER JOIN Z_SFC_DISPATCH ZD ON ZD.SITE = ZS.SITE AND ZD.SFC = ZS.SFC AND ZD.DISPATCH_SEQ = ZS.DISPATCH_SEQ
WHERE W.QTY_ON_HAND > 0 WHERE W.QTY_ON_HAND > 0
) SIP ) SIP ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO
ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO AND VIP.REQUIRED_QTY > 0 WHERE VIP.REQUIRED_QTY > 0
ORDER BY VIP.WORK_ORDER, VIP.ITEM ORDER BY VIP.WORK_ORDER, VIP.ITEM
</select> </select>

@ -22,6 +22,7 @@
<result column="WORK_CENTER" property="workCenter" /> <result column="WORK_CENTER" property="workCenter" />
<result column="RESRCE" property="resrce" /> <result column="RESRCE" property="resrce" />
<result column="EMPLOYEE" property="employee" /> <result column="EMPLOYEE" property="employee" />
<result column="EMPLOYEE_DESCRIPTION" property="employeeDescription" />
<result column="TURN_OPERATION" property="turnOperation" /> <result column="TURN_OPERATION" property="turnOperation" />
<result column="DISPATCH_QTY" property="dispatchQty" /> <result column="DISPATCH_QTY" property="dispatchQty" />
<result column="PROD_HOURS" property="prodHours" /> <result column="PROD_HOURS" property="prodHours" />
@ -52,6 +53,8 @@
</resultMap> </resultMap>
<resultMap id="FullResultMap" type="com.foreverwin.mesnac.common.dto.SfcDispatchDto"> <resultMap id="FullResultMap" type="com.foreverwin.mesnac.common.dto.SfcDispatchDto">
<result column="USER" property="user" />
<result column="ROLE" property="role" />
<result column="IS_COMPLETED" property="isCompleted" /> <result column="IS_COMPLETED" property="isCompleted" />
<result column="ITEM_BO" property="itemBo" /> <result column="ITEM_BO" property="itemBo" />
<result column="ITEM" property="item" /> <result column="ITEM" property="item" />
@ -63,6 +66,7 @@
<result column="ITEM_DESCRIPTION" property="itemDescription" /> <result column="ITEM_DESCRIPTION" property="itemDescription" />
<result column="COMPONENT" property="component" /> <result column="COMPONENT" property="component" />
<result column="COMPLETED_QTY" property="completedQty" /> <result column="COMPLETED_QTY" property="completedQty" />
<result column="RESOURCE_DESCRIPTION" property="resourceDescription" />
<result column="COMPONENT_DESCRIPTION" property="componentDescription" /> <result column="COMPONENT_DESCRIPTION" property="componentDescription" />
<result column="OPERATION_DESCRIPTION" property="operationDescription" /> <result column="OPERATION_DESCRIPTION" property="operationDescription" />
<result column="RESOURCE_WORK_CENTER" property="resourceWorkCenter" /> <result column="RESOURCE_WORK_CENTER" property="resourceWorkCenter" />
@ -71,7 +75,7 @@
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
HANDLE, SITE, SHOP_ORDER, SFC, BLANKING_SIZE, DISPATCH_SEQ, DISPATCH_NO, DISPATCH_STATUS, DRAWINGS_NO, DRAWINGS_REVISION, IS_LOCK, ROUTER_BO, STEP_ID, OPERATION, RESOURCE_TYPE, WORK_CENTER, RESRCE, EMPLOYEE, TURN_OPERATION, DISPATCH_QTY, PROD_HOURS, PLANNED_START_DATE, PLANNED_COMP_DATE, EARLIEST_START_DATE, LATEST_END_DATE, SO_RELEASED_DATE, SFC_RELEASED_DATE, RELEASED_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, IS_DISPATCH, IS_IMPORT, REMARK, PREPOSITION_STEP_ID, PREPOSITION_OPERATION, IS_FIRST_OPERATION, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, OTHER_1, OTHER_2, OTHER_3, OTHER_4, OTHER_5 HANDLE, SITE, SHOP_ORDER, SFC, BLANKING_SIZE, DISPATCH_SEQ, DISPATCH_NO, DISPATCH_STATUS, DRAWINGS_NO, DRAWINGS_REVISION, IS_LOCK, ROUTER_BO, STEP_ID, OPERATION, RESOURCE_TYPE, WORK_CENTER, RESRCE, EMPLOYEE, EMPLOYEE_DESCRIPTION, TURN_OPERATION, DISPATCH_QTY, PROD_HOURS, PLANNED_START_DATE, PLANNED_COMP_DATE, EARLIEST_START_DATE, LATEST_END_DATE, SO_RELEASED_DATE, SFC_RELEASED_DATE, RELEASED_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, IS_DISPATCH, IS_IMPORT, REMARK, PREPOSITION_STEP_ID, PREPOSITION_OPERATION, IS_FIRST_OPERATION, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, OTHER_1, OTHER_2, OTHER_3, OTHER_4, OTHER_5
</sql> </sql>
<!-- BaseMapper标准查询/修改/删除 --> <!-- BaseMapper标准查询/修改/删除 -->
@ -79,143 +83,6 @@
SELECT <include refid="Base_Column_List"></include> FROM Z_SFC_DISPATCH WHERE HANDLE=#{handle} SELECT <include refid="Base_Column_List"></include> FROM Z_SFC_DISPATCH WHERE HANDLE=#{handle}
</select> </select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SFC_DISPATCH
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SFC_DISPATCH WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SFC_DISPATCH
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null"> AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null"> AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null"> AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null"> AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null"> AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null"> AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null"> AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null"> AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null"> AND EARLIEST_START_DATE=#{ew.entity.earliestStartDate}</if>
<if test="ew.entity.latestEndDate!=null"> AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null"> AND PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}</if>
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_SFC_DISPATCH
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null"> AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null"> AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null"> AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null"> AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null"> AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null"> AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null"> AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null"> AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null"> AND EARLIEST_START_DATE=#{ew.entity.earliestStartDate}</if>
<if test="ew.entity.latestEndDate!=null"> AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null"> AND PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}</if>
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap"> <select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH
<where> <where>
@ -272,132 +139,6 @@
</if> </if>
</select> </select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null"> AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null"> AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null"> AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null"> AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null"> AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null"> AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null"> AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null"> AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null"> AND EARLIEST_START_DATE=#{ew.entity.earliestStartDate}</if>
<if test="ew.entity.latestEndDate!=null"> AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null"> AND PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}</if>
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null"> AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null"> AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null"> AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null"> AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null"> AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null"> AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null"> AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null"> AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null"> AND EARLIEST_START_DATE=#{ew.entity.earliestStartDate}</if>
<if test="ew.entity.latestEndDate!=null"> AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null"> AND PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}</if>
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap"> <select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH
<where> <where>
@ -461,69 +202,6 @@
</if> </if>
</select> </select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.blankingSize!=null"> AND BLANKING_SIZE=#{ew.entity.blankingSize}</if>
<if test="ew.entity.dispatchSeq!=null"> AND DISPATCH_SEQ=#{ew.entity.dispatchSeq}</if>
<if test="ew.entity.dispatchNo!=null"> AND DISPATCH_NO=#{ew.entity.dispatchNo}</if>
<if test="ew.entity.dispatchStatus!=null"> AND DISPATCH_STATUS=#{ew.entity.dispatchStatus}</if>
<if test="ew.entity.drawingsNo!=null"> AND DRAWINGS_NO=#{ew.entity.drawingsNo}</if>
<if test="ew.entity.drawingsRevision!=null"> AND DRAWINGS_REVISION=#{ew.entity.drawingsRevision}</if>
<if test="ew.entity.isLock!=null"> AND IS_LOCK=#{ew.entity.isLock}</if>
<if test="ew.entity.routerBo!=null"> AND ROUTER_BO=#{ew.entity.routerBo}</if>
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
<if test="ew.entity.resourceType!=null"> AND RESOURCE_TYPE=#{ew.entity.resourceType}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
<if test="ew.entity.plannedCompDate!=null"> AND PLANNED_COMP_DATE=#{ew.entity.plannedCompDate}</if>
<if test="ew.entity.earliestStartDate!=null"> AND EARLIEST_START_DATE=#{ew.entity.earliestStartDate}</if>
<if test="ew.entity.latestEndDate!=null"> AND LATEST_END_DATE=#{ew.entity.latestEndDate}</if>
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.prepositionStepId!=null"> AND PREPOSITION_STEP_ID=#{ew.entity.prepositionStepId}</if>
<if test="ew.entity.prepositionOperation!=null"> AND PREPOSITION_OPERATION=#{ew.entity.prepositionOperation}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.other1!=null"> AND OTHER_1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER_2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER_3=#{ew.entity.other3}</if>
<if test="ew.entity.other4!=null"> AND OTHER_4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.dispatch.model.SfcDispatch"> <insert id="insert" parameterType="com.foreverwin.mesnac.dispatch.model.SfcDispatch">
INSERT INTO Z_SFC_DISPATCH INSERT INTO Z_SFC_DISPATCH
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -545,6 +223,7 @@
<if test="workCenter!=null">WORK_CENTER,</if> <if test="workCenter!=null">WORK_CENTER,</if>
<if test="resrce!=null">RESRCE,</if> <if test="resrce!=null">RESRCE,</if>
<if test="employee!=null">EMPLOYEE,</if> <if test="employee!=null">EMPLOYEE,</if>
<if test="employeeDescription!=null">EMPLOYEE_DESCRIPTION,</if>
<if test="turnOperation!=null">TURN_OPERATION,</if> <if test="turnOperation!=null">TURN_OPERATION,</if>
<if test="dispatchQty!=null">DISPATCH_QTY,</if> <if test="dispatchQty!=null">DISPATCH_QTY,</if>
<if test="prodHours!=null">PROD_HOURS,</if> <if test="prodHours!=null">PROD_HOURS,</if>
@ -592,6 +271,7 @@
<if test="workCenter!=null">#{workCenter},</if> <if test="workCenter!=null">#{workCenter},</if>
<if test="resrce!=null">#{resrce},</if> <if test="resrce!=null">#{resrce},</if>
<if test="employee!=null">#{employee},</if> <if test="employee!=null">#{employee},</if>
<if test="employeeDescription!=null">#{employeeDescription},</if>
<if test="turnOperation!=null">#{turnOperation},</if> <if test="turnOperation!=null">#{turnOperation},</if>
<if test="dispatchQty!=null">#{dispatchQty},</if> <if test="dispatchQty!=null">#{dispatchQty},</if>
<if test="prodHours!=null">#{prodHours},</if> <if test="prodHours!=null">#{prodHours},</if>
@ -646,6 +326,7 @@
#{workCenter}, #{workCenter},
#{resrce}, #{resrce},
#{employee}, #{employee},
#{employeeDescription},
#{turnOperation}, #{turnOperation},
#{dispatchQty}, #{dispatchQty},
#{prodHours}, #{prodHours},
@ -696,6 +377,7 @@
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if> <if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if> <if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.employee!=null">EMPLOYEE=#{et.employee},</if> <if test="et.employee!=null">EMPLOYEE=#{et.employee},</if>
<if test="et.employeeDescription!=null">EMPLOYEE_DESCRIPTION=#{et.employeeDescription},</if>
<if test="et.turnOperation!=null">TURN_OPERATION=#{et.turnOperation},</if> <if test="et.turnOperation!=null">TURN_OPERATION=#{et.turnOperation},</if>
<if test="et.dispatchQty!=null">DISPATCH_QTY=#{et.dispatchQty},</if> <if test="et.dispatchQty!=null">DISPATCH_QTY=#{et.dispatchQty},</if>
<if test="et.prodHours!=null">PROD_HOURS=#{et.prodHours},</if> <if test="et.prodHours!=null">PROD_HOURS=#{et.prodHours},</if>
@ -746,6 +428,7 @@
WORK_CENTER=#{et.workCenter}, WORK_CENTER=#{et.workCenter},
RESRCE=#{et.resrce}, RESRCE=#{et.resrce},
EMPLOYEE=#{et.employee}, EMPLOYEE=#{et.employee},
EMPLOYEE_DESCRIPTION=#{et.employeeDescription},
TURN_OPERATION=#{et.turnOperation}, TURN_OPERATION=#{et.turnOperation},
DISPATCH_QTY=#{et.dispatchQty}, DISPATCH_QTY=#{et.dispatchQty},
PROD_HOURS=#{et.prodHours}, PROD_HOURS=#{et.prodHours},
@ -796,6 +479,7 @@
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if> <if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if> <if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.employee!=null">EMPLOYEE=#{et.employee},</if> <if test="et.employee!=null">EMPLOYEE=#{et.employee},</if>
<if test="et.employeeDescription!=null">EMPLOYEE_DESCRIPTION=#{et.employeeDescription},</if>
<if test="et.turnOperation!=null">TURN_OPERATION=#{et.turnOperation},</if> <if test="et.turnOperation!=null">TURN_OPERATION=#{et.turnOperation},</if>
<if test="et.dispatchQty!=null">DISPATCH_QTY=#{et.dispatchQty},</if> <if test="et.dispatchQty!=null">DISPATCH_QTY=#{et.dispatchQty},</if>
<if test="et.prodHours!=null">PROD_HOURS=#{et.prodHours},</if> <if test="et.prodHours!=null">PROD_HOURS=#{et.prodHours},</if>
@ -845,6 +529,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if> <if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if> <if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if> <if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="et.entity.employeeDescription!=null">EMPLOYEE_DESCRIPTION=#{et.entity.employeeDescription},</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if> <if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if> <if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if> <if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
@ -925,6 +610,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if> <if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if> <if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if> <if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="et.entity.employeeDescription!=null">EMPLOYEE_DESCRIPTION=#{et.entity.employeeDescription},</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if> <if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if> <if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if> <if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
@ -982,21 +668,20 @@
</select> </select>
<select id="findSfcDispatchList" resultMap="FullResultMap"> <select id="findSfcDispatchList" resultMap="FullResultMap">
SELECT WIP.*, CASE WHEN WIP.DISPATCH_SEQ = 1 THEN WIP.PLANNED_START_DATE ELSE V1.PLANNED_COMP_DATE END EARLIEST_START_DATE, SELECT WIP.*, V1.STEP_ID PREPOSITION_STEP_ID, V1.OPERATION PREPOSITION_OPERATION,
CASE WHEN V2.HANDLE IS NOT NULL THEN V2.PLANNED_START_DATE ELSE WIP.PLANNED_COMP_DATE END LATEST_END_DATE, CASE WHEN WIP.DISPATCH_SEQ = 1 OR V1.DISPATCH_STATUS = 'COMPLETE' THEN N'是' ELSE N'否' END IS_COMPLETED,
V1.STEP_ID PREPOSITION_STEP_ID, V1.OPERATION PREPOSITION_OPERATION,
CASE WHEN WIP.DISPATCH_SEQ = 1 OR V1.OTHER_1 = 'true' THEN N'是' ELSE N'否' END IS_COMPLETED,
CASE WHEN WIP.DISPATCH_STATUS = 'NEW' THEN N'新建' WHEN WIP.DISPATCH_STATUS = 'CANCEL' THEN N'取消' CASE WHEN WIP.DISPATCH_STATUS = 'NEW' THEN N'新建' WHEN WIP.DISPATCH_STATUS = 'CANCEL' THEN N'取消'
WHEN WIP.DISPATCH_STATUS = 'PAUSE' THEN N'暂停' WHEN WIP.DISPATCH_STATUS = 'RELEASE' THEN N'发布' WHEN WIP.DISPATCH_STATUS = 'PAUSE' THEN N'暂停' WHEN WIP.DISPATCH_STATUS = 'RELEASE' THEN N'发布'
END AS STATUS_NAME END AS STATUS_NAME, 'ADMINISTRATOR' AS ROLE
FROM ( FROM (
SELECT DISTINCT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE ITEM_NUMBER, C1.VALUE WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS, SELECT DISTINCT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE ITEM_NUMBER, C1.VALUE WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION OPERATION_DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE USER_NAME, SD.DISPATCH_QTY, SD.PROD_HOURS, SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION OPERATION_DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE USER_NAME, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION RESOURCE_DESCRIPTION,
CASE WHEN OTHER_1 = 'true' THEN SD.DISPATCH_QTY ELSE 0 END COMPLETED_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, CASE WHEN SD.DISPATCH_STATUS = 'COMPLETE' THEN SD.DISPATCH_QTY ELSE 0 END COMPLETED_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.DISPATCH_SEQ-1 BEFORE_SEQ, SD.DISPATCH_SEQ+1 AFTER_SEQ, SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.DISPATCH_SEQ-1 BEFORE_SEQ, SD.DISPATCH_SEQ+1 AFTER_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE,
CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE, CASE WHEN IM.LOT_SIZE = 1 THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE,
CASE WHEN IM.LOT_SIZE = 1 THEN N'是' ELSE N'否' END IS_MAJOR, WR.WORK_CENTER RESOURCE_WORK_CENTER WR.WORK_CENTER RESOURCE_WORK_CENTER
FROM Z_SFC_DISPATCH SD FROM Z_SFC_DISPATCH SD
INNER JOIN RESRCE RS ON SD.SITE = RS.SITE AND SD.RESRCE = RS.RESRCE
INNER JOIN SHOP_ORDER SO ON SO.SITE = SD.SITE AND SO.SHOP_ORDER = SD.SHOP_ORDER INNER JOIN SHOP_ORDER SO ON SO.SITE = SD.SITE AND SO.SHOP_ORDER = SD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE AND C1."ATTRIBUTE" = 'WORK_ORDER' LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE AND C1."ATTRIBUTE" = 'WORK_ORDER'
LEFT JOIN CUSTOM_FIELDS C2 ON C2.HANDLE = SO.HANDLE AND C2."ATTRIBUTE" = 'ITEM_NUMBER' LEFT JOIN CUSTOM_FIELDS C2 ON C2.HANDLE = SO.HANDLE AND C2."ATTRIBUTE" = 'ITEM_NUMBER'
@ -1037,6 +722,9 @@
<if test="operation != null and operation != ''"> <if test="operation != null and operation != ''">
AND SD.OPERATION = #{operation} AND SD.OPERATION = #{operation}
</if> </if>
<if test="operationDescription != null and operationDescription != ''">
AND OT.DESCRIPTION = #{operationDescription}
</if>
<if test="sfc != null and sfc != ''"> <if test="sfc != null and sfc != ''">
AND SD.SFC = #{sfc} AND SD.SFC = #{sfc}
</if> </if>

@ -467,8 +467,10 @@
<select id="findEmployeeList" resultType="com.foreverwin.mesnac.meapi.model.NwaUser"> <select id="findEmployeeList" resultType="com.foreverwin.mesnac.meapi.model.NwaUser">
SELECT DISTINCT A.SITE, A.USER_ID USER_NAME, B.FIRST_NAME, B.LAST_NAME, NVL(B.FULL_NAME, A.USER_DESCRIPTION) FULL_NAME SELECT DISTINCT A.SITE, A.USER_ID USER_NAME, B.FIRST_NAME, B.LAST_NAME, NVL(B.FULL_NAME, A.USER_DESCRIPTION) FULL_NAME
FROM Z_USER_RESOURCE A FROM Z_USER_RESOURCE A
INNER JOIN RESOURCE_TYPE_RESOURCE WM ON WM.RESOURCE_BO = A.RESOURCE_BO
INNER JOIN RESOURCE_TYPE RT ON RT.HANDLE = WM.RESOURCE_TYPE_BO
LEFT JOIN Z_NWA_USER B ON A.SITE = B.SITE AND A.USER_ID = B.USER_NAME LEFT JOIN Z_NWA_USER B ON A.SITE = B.SITE AND A.USER_ID = B.USER_NAME
WHERE A.SITE = #{site} WHERE A.SITE = #{site} AND RT.RESOURCE_TYPE = #{resourceType}
</select> </select>
<select id="findAll" resultMap="UserResourceDto"> <select id="findAll" resultMap="UserResourceDto">

@ -530,7 +530,7 @@ public class InterfaceServiceImpl implements InterfaceService {
for (int i = 0; i < routerStepDtoList.size(); i++) { for (int i = 0; i < routerStepDtoList.size(); i++) {
RouterStepDto routerStepDto = routerStepDtoList.get(i); RouterStepDto routerStepDto = routerStepDtoList.get(i);
String stepId = routerStepDto.getSTEP_ID(); String stepId = routerStepDto.getSTEP_ID();
String erpWorkCenter = routerStepDto.getOPERATION().trim(); String erpWorkCenter = routerStepDto.getOPERATION();
if (StringUtil.isBlank(entryRouterStep)) { if (StringUtil.isBlank(entryRouterStep)) {
entryRouterStep = stepId; entryRouterStep = stepId;
@ -545,8 +545,8 @@ public class InterfaceServiceImpl implements InterfaceService {
String operation = null; String operation = null;
String operationBo = null; String operationBo = null;
if (StringUtil.isBlank(erpWorkCenter)) { if (StringUtil.isBlank(erpWorkCenter) || "null".equals(erpWorkCenter)) {
operation = Constants.OP_6106GX; operation = Constants.OP_WX_6106GX;
Operation operationModel = operationService.getCurrentRevisionRef(site, operation); Operation operationModel = operationService.getCurrentRevisionRef(site, operation);
if (operationModel == null) { if (operationModel == null) {
throw BusinessException.build("工序编号【" +operation+ "】不存在"); throw BusinessException.build("工序编号【" +operation+ "】不存在");

@ -26,6 +26,7 @@ public interface UserGroupMapper extends BaseMapper<UserGroup> {
UserGroup getCustomFieldByGroup(@Param("site")String site, UserGroup getCustomFieldByGroup(@Param("site")String site,
@Param("userGroup")String userGroup); @Param("userGroup")String userGroup);
List<UserGroup> selectUserGroupListByUserBo(@Param("userBo") String userBo);
Integer getUserGroupByUser(@Param("userBO")String userBO,@Param("userGroupBO")String userGroupBO); Integer getUserGroupByUser(@Param("userBO")String userBO,@Param("userGroupBO")String userGroupBO);
Integer findUserGroupByUser(@Param("site")String site,@Param("user")String user,@Param("list")List<String> list); Integer findUserGroupByUser(@Param("site")String site,@Param("user")String user,@Param("list")List<String> list);

@ -26,5 +26,7 @@ public interface UserGroupService extends IService<UserGroup> {
List<UserGroup> selectList(UserGroup userGroup); List<UserGroup> selectList(UserGroup userGroup);
List<UserGroup> getUserGroupListByUserBo(String userBo);
Integer getUserGroupByUser(String userBO,String userGroupBO); Integer getUserGroupByUser(String userBO,String userGroupBO);
} }

@ -43,6 +43,10 @@ public class UserGroupServiceImpl extends ServiceImpl<UserGroupMapper, UserGroup
return super.list(queryWrapper); return super.list(queryWrapper);
} }
@Override
public List<UserGroup> getUserGroupListByUserBo(String userBo) {
return userGroupMapper.selectUserGroupListByUserBo(userBo);
}
@Override @Override
public Integer getUserGroupByUser(String userBO, String userGroupBO) { public Integer getUserGroupByUser(String userBO, String userGroupBO) {
return userGroupMapper.getUserGroupByUser(userBO,userGroupBO); return userGroupMapper.getUserGroupByUser(userBO,userGroupBO);

@ -359,6 +359,13 @@
WHERE UG.USER_GROUP = #{userGroup} AND UG.SITE = #{site} WHERE UG.USER_GROUP = #{userGroup} AND UG.SITE = #{site}
</select> </select>
<select id="selectUserGroupListByUserBo" resultMap="BaseResultMap">
SELECT UG.HANDLE, UG.SITE, UG.USER_GROUP, UG.DESCRIPTION, UG.WORKSTATION_BO, UG.CREATED_DATE_TIME, UG.MODIFIED_DATE_TIME
FROM USER_GROUP UG
INNER JOIN USER_GROUP_MEMBER UM ON UM.USER_GROUP_BO = UG.HANDLE
WHERE UM.USER_OR_GROUP_GBO = #{userBo}
</select>
<select id="getUserGroupByUser" resultType="Integer"> <select id="getUserGroupByUser" resultType="Integer">
SELECT COUNT(HANDLE) FROM USER_GROUP_MEMBER ugm SELECT COUNT(HANDLE) FROM USER_GROUP_MEMBER ugm
WHERE ugm.USER_OR_GROUP_GBO=#{userBO} AND USER_GROUP_BO=#{userGroupBO} WHERE ugm.USER_OR_GROUP_GBO=#{userBO} AND USER_GROUP_BO=#{userGroupBO}

Loading…
Cancel
Save