Merge remote-tracking branch 'origin/master'

master
philip 3 years ago
commit 9919e8b880

@ -83,6 +83,7 @@ public class PrinterController {
return R.ok("保存成功");
} else {
printerModel.setDescription(printer.getDescription());
printerModel.setEnabled(printer.getEnabled());
printerModel.setModifiedDateTime(nowDate);
printerService.updateById(printerModel);
return R.ok("修改成功");

@ -1,7 +1,9 @@
package com.foreverwin.mesnac.dataimport.handler;
import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mesnac.common.dto.UsrDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.service.UserService;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dataimport.handler.base.BaseHandler;
import com.foreverwin.mesnac.dataimport.reader.FileReader;
@ -13,7 +15,6 @@ import com.foreverwin.mesnac.dispatch.model.UserResource;
import com.foreverwin.mesnac.dispatch.service.UserResourceService;
import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper;
import com.foreverwin.mesnac.meapi.mapper.ResrceMapper;
import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.model.Resrce;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.I18nUtil;
@ -21,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
@ -43,6 +45,9 @@ public class UserResourceHandler extends BaseHandler {
@Autowired
private UserResourceMapper userResourceMapper;
@Autowired
private UserService userService;
@Override
public String importFile(String site, InputStream inputStream, String fileType, String mode) throws Exception {
int row = 0;
@ -144,7 +149,7 @@ public class UserResourceHandler extends BaseHandler {
};
}
String updateAndInsert(UserResource userResource,Long index){
String updateAndInsert(UserResource userResource, Long index){
//判断资源是否存在
Resrce resrce = resrceMapper.selectById(userResource.getResourceBo());
@ -153,10 +158,12 @@ public class UserResourceHandler extends BaseHandler {
}
//设置资源描述
userResource.setResrceDescription(resrce.getDescription());
userResource.setExistUser("false");
//设置员工描述
NwaUser nwaUser = nwaUserMapper.selectById(HandleEnum.USER.getHandle(userResource.getSite(), userResource.getUserId()));
if(nwaUser != null){
userResource.setUserDescription(nwaUser.getFullName());
List<UsrDto> userList = userService.findList(userResource.getUserId());
if(userList != null && userList.size() > 0){
userResource.setUserDescription(userList.get(0).getFullName());
userResource.setExistUser("true");
}else if("true".equals(userResource.getTemporaryUser())){
//不做任何操作
}else{

@ -106,6 +106,7 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
userResource.setUserId(userResourceDto.getUserId());
userResource.setTemporaryUser(userResourceDto.getTemporaryUser());
userResource.setUserDescription(userResourceDto.getUserDescription());
userResource.setExistUser("false");
//NwaUser userByUserName = nwaUserService.findUserByUserName(userResource.getUserId());
List<UsrDto> userByUserName = userService.findList(userResource.getUserId());
if("false".equals(userResource.getTemporaryUser()) &&
@ -114,6 +115,7 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
}else if(userByUserName != null && userByUserName.size() > 0){
//userByUserName.setFullName(userResource.getUserDescription());
userResource.setUserDescription(userByUserName.get(0).getFullName());
userResource.setExistUser("true");
//nwaUserService.saveOrUpdate(userByUserName);
}
userResource.setStatus(userResourceDto.getStatus());

@ -984,8 +984,8 @@
ZCI.SHOP_ORDER , ZCI.RESRCE,
IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION,ZCI.COMPONENT_BO ,
CP.ITEM COMPONENT, ITT.DESCRIPTION COMPONENT_DESCRIPTION, ZSD.BLANKING_SIZE,
MIN(ZSD.PLANNED_START_DATE) ,
/*MIN(SO.PLANNED_START_DATE) , ZCI.CALL_TYPE,*/
/*MIN(ZSD.PLANNED_START_DATE) ,
MIN(SO.PLANNED_START_DATE) , ZCI.CALL_TYPE,*/
SUM(ZCI.REQUIRED_QTY) REQUIRED_QTY
FROM Z_CALL_ITEM ZCI
INNER JOIN Z_SFC_DISPATCH ZSD ON ZSD.HANDLE = ZCI.SFC_DISPATCH_BO

@ -190,7 +190,7 @@ public class ResourceRepairTaskController {
String resourceNo = resourceRepairTask.getResourceNo();
String resourceTypeNo = resourceRepairTask.getResourceTypeNo();
if (workCenterNo != null){
resourceRepairTask.setWorkCenterBo(HandleEnum.RESOURCE_INSPECT_PLAN.getHandle(site,workCenterNo));
resourceRepairTask.setWorkCenterBo(HandleEnum.WORK_CENTER.getHandle(site,workCenterNo));
}
if (resourceNo != null){
resourceRepairTask.setResourceBo(HandleEnum.RESOURCE.getHandle(site,resourceNo));

@ -145,6 +145,7 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
@Override
public ResourceRepairTask selOrStartRepairTask(ResourceRepairTask resourceRepairTask) {
String user = CommonMethods.getUser();
// 根据HANDLE查询维修任务
String handle = resourceRepairTask.getHandle();
String stopMachine = resourceRepairTask.getStopMachine();
@ -166,7 +167,9 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
if (stopMachine != null && status.equals("501")){
repairTask.setStatus("501");
repairTask.setActualStartDate(LocalDateTime.now());
repairTask.setRepairUsers(CommonMethods.getUser());
repairTask.setRepairUsers(user);
NwaUser userByUserName = nwaUserService.findUserByUserName(user);
repairTask.setRepairUserName(userByUserName.getFullName());
resourceRepairTaskService.updateById(repairTask);
// 修改设备状态---若stopMachie=Y则状态改为非预定停机
if (stopMachine.equals("Y")){

@ -894,7 +894,7 @@
INNER JOIN WIP.RESRCE R ON RRT.SITE = R.SITE AND R.RESRCE = RRT.RESOURCE_NO
LEFT JOIN WIP.WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = R.HANDLE
LEFT JOIN WIP.WORK_CENTER_MEMBER WCMA ON WCMA.WORK_CENTER_OR_RESOURCE_GBO = WCM.WORK_CENTER_BO
LEFT JOIN WIP.WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCMA.WORK_CENTER_BO
LEFT JOIN WIP.WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCMA.WORK_CENTER_BO AND WCT.LOCALE = 'zh'
INNER JOIN WIP.RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = R.HANDLE
WHERE RRT.SITE = #{site}
<if test="resourceNo != null and resourceNo != ''">
@ -910,7 +910,7 @@
AND RRT.STATUS = #{status}
</if>
<if test="workCenterBo != null and workCenterBo != ''">
AND WCM.WORK_CENTER_BO = #{workCenterBo}
AND WCMA.WORK_CENTER_BO = #{workCenterBo}
</if>
<if test="resourceTypeBo != null and resourceTypeBo != ''">
AND RTR.RESOURCE_TYPE_BO = #{resourceTypeBo}

@ -819,7 +819,6 @@ public class InterfaceServiceImpl implements InterfaceService {
LocalDateTime now = LocalDateTime.now();
List<PrintLog> printLogList = new ArrayList<>();
//循环处理 物料批次
for (int i = 0; i < itemBatchDtoList.size(); i++) {
ItemBatchDto itemBatchDto = itemBatchDtoList.get(i);
@ -867,42 +866,40 @@ public class InterfaceServiceImpl implements InterfaceService {
itemBatch.setCreateUser(Constants.SITE_ADMIN);
itemBatch.setCreatedDateTime(now);
itemBatchService.save(itemBatch);
//打印模板参数
List<LabelPrintDto> labelPrintDtoList = new ArrayList<>();
LabelPrintDto labelPrintDto = new LabelPrintDto();
labelPrintDto.setSite(site);
labelPrintDto.setPrintTemplate(Constants.PRINT_TYPE_INV);
labelPrintDto.setItem(item);
labelPrintDto.setItemDescription(itemModel.getDescription());
labelPrintDto.setSupplier(supplier);
//labelPrintDto.setBatch(inventory);
labelPrintDto.setBatch(batch);
labelPrintDto.setLabel(inventory);
labelPrintDtoList.add(labelPrintDto);
//记录打印数据
PrintLog printLog = new PrintLog();
printLog.setHandle(UUID.randomUUID().toString());
printLog.setSite(site);
printLog.setCategory(Constants.PRINT_TYPE_INV);
printLog.setPrintName("");
printLog.setPrintTemplate(Constants.PRINT_TYPE_INV);
printLog.setPrintParam(JSON.toJSONString(labelPrintDtoList));
printLog.setInventory(inventory);
printLog.setItemBo(itemModel.getHandle());
printLog.setIsPrint("false");
printLog.setPrintNum(0);
printLog.setCreateUser("SITE_ADMIN");
printLog.setCreatedDateTime(LocalDateTime.now());
printLogService.save(printLog);
}
//打印模板参数
List<LabelPrintDto> labelPrintDtoList = new ArrayList<>();
LabelPrintDto labelPrintDto = new LabelPrintDto();
labelPrintDto.setSite(site);
labelPrintDto.setPrintTemplate(Constants.PRINT_TYPE_INV);
labelPrintDto.setItem(item);
labelPrintDto.setItemDescription(itemModel.getDescription());
labelPrintDto.setSupplier(supplier);
//labelPrintDto.setBatch(inventory);
labelPrintDto.setBatch(batch);
labelPrintDto.setLabel(inventory);
labelPrintDtoList.add(labelPrintDto);
//记录打印数据
PrintLog printLog = new PrintLog();
printLog.setHandle(UUID.randomUUID().toString());
printLog.setSite(site);
printLog.setCategory(Constants.PRINT_TYPE_INV);
printLog.setPrintName("");
printLog.setPrintTemplate(Constants.PRINT_TYPE_INV);
printLog.setPrintParam(JSON.toJSONString(labelPrintDtoList));
printLog.setInventory(inventory);
printLog.setItemBo(itemModel.getHandle());
printLog.setIsPrint("false");
printLog.setPrintNum(0);
printLog.setCreateUser("SITE_ADMIN");
printLog.setCreatedDateTime(LocalDateTime.now());
printLogList.add(printLog);
}
if (printLogList != null && printLogList.size() > 0) {
printLogService.saveBatch(printLogList);
}
}
/**

@ -483,5 +483,6 @@
AND REQUEST_DATE_TIME &lt;= #{integration.endDateTime}
</if>
</where>
ORDER BY REQUEST_DATE_TIME DESC
</select>
</mapper>

Loading…
Cancel
Save