diff --git a/common/src/main/java/com/foreverwin/mesnac/common/controller/FileController.java b/common/src/main/java/com/foreverwin/mesnac/common/controller/FileController.java index 3d1aae91..1b273a2f 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/controller/FileController.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/controller/FileController.java @@ -7,6 +7,7 @@ import com.foreverwin.modular.core.exception.BaseException; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.R; import org.apache.commons.net.ftp.FTPClient; +import org.apache.poi.ss.usermodel.Workbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -16,9 +17,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.OutputStream; +import java.io.*; /** * @@ -128,4 +127,5 @@ public class FileController { } return R.ok(null,"获取CAPP文件成功!"); } + } \ No newline at end of file diff --git a/common/src/main/java/com/foreverwin/mesnac/common/dto/SfcDispatchDto.java b/common/src/main/java/com/foreverwin/mesnac/common/dto/SfcDispatchDto.java index 2d86da63..4108cbdf 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/dto/SfcDispatchDto.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/dto/SfcDispatchDto.java @@ -15,6 +15,8 @@ import java.util.Date; */ public class SfcDispatchDto implements Serializable{ + + /** * 主键 */ @@ -144,6 +146,20 @@ public class SfcDispatchDto implements Serializable{ * 是否首工序 */ private String isFirstOperation; + + /** + * 是否修改总计划完成时间 + */ + @ExcelColumn("是否修改总计划完成时间") + private String isUpdateZJHComplete; + + public String getIsUpdateZJHComplete() { + return isUpdateZJHComplete; + } + + public void setIsUpdateZJHComplete(String isUpdateZJHComplete) { + this.isUpdateZJHComplete = isUpdateZJHComplete; + } /** * 物料编号&描述 */ diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/FileServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/FileServiceImpl.java index 849757f2..4f851c90 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/FileServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/FileServiceImpl.java @@ -19,9 +19,8 @@ import org.springframework.stereotype.Service; import java.io.File; import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.regex.Pattern; @Service public class FileServiceImpl implements FileService { @@ -46,24 +45,32 @@ public class FileServiceImpl implements FileService { String itemBo = sfcServiceById.getItemBo(); String path="/"+ StringUtil.trimHandle(itemBo)+"_"+sfcDispatchDrawing.getDrawingsRevision()+"/"; FTPClient connect = null; + List list=new ArrayList(); Map pathMap = new HashMap<>(); try { connect = cappFtpClient.login(); - connect.changeWorkingDirectory(path); + boolean flag=connect.changeWorkingDirectory(path); connect.enterLocalPassiveMode(); FTPFile[] files = connect.listFiles(); - if(files!=null){ + if(files!=null&&flag){ for (FTPFile ftpFile:files){ - if (ftpFile.getName().equals(path.substring(1,path.length()-1))&&ftpFile.isFile()){ + String tmp=ftpFile.getName().substring(ftpFile.getName().lastIndexOf("_")+1,ftpFile.getName().lastIndexOf("_")+2); + Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); + if (pattern.matcher(tmp).matches()){ + list.add(Integer.parseInt(tmp)); + } + if (ftpFile.getName().equals(path.substring(1,path.length()-1)+".pdf")&&ftpFile.isFile()){ pathMap.put(ftpFile.getName(),path+ftpFile.getName()); } } -// for (int i = 0; i < files.length; i++) { -// if(files[i].isFile()){ -// String filename=files[i].getName(); -// pathMap.put(filename,path+filename); -// } -// } + int max = (int) Collections.max(list); + for (FTPFile ftpFile:files){ + if (ftpFile.getName().substring(ftpFile.getName().lastIndexOf("_")+1,ftpFile.getName().lastIndexOf("_")+2).equals(String.valueOf(max))&&ftpFile.isFile()){ + pathMap.put(ftpFile.getName(),path+ftpFile.getName()); + } + } + }else { + throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系计划部门确认"); } connect.disconnect(); }catch (Exception e){ @@ -74,7 +81,9 @@ public class FileServiceImpl implements FileService { connect.disconnect(); } } - + if (pathMap==null){ + throw new BaseException("未找到当前工序的图纸版本号和工艺卡片相应信息,请联系计划部门确认"); + } return pathMap; } diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/SfcDispatch.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/SfcDispatch.java index 5d7ae3aa..a9217fbf 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/SfcDispatch.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/SfcDispatch.java @@ -181,11 +181,19 @@ public class SfcDispatch extends Model { */ @TableField("IS_DISPATCH") private String isDispatch; - /** + + + /** * 是否导入 */ @TableField("IS_IMPORT") private String isImport; + + /** + * 是否修改计划完成时间 + */ + @TableField("IS_UPDATE_ZJH_COMPLETE") + private String isUpdateZJHComplete; /** * 派工备注 */ @@ -237,6 +245,13 @@ public class SfcDispatch extends Model { @TableField("OTHER_5") private String other5; + public String getIsUpdateZJHComplete() { + return isUpdateZJHComplete; + } + + public void setIsUpdateZJHComplete(String isUpdateZJHComplete) { + this.isUpdateZJHComplete = isUpdateZJHComplete; + } public String getHandle() { return handle; diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java index 28de0ef8..ef2464fb 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java @@ -124,26 +124,29 @@ public class SfcDispatchServiceImpl extends ServiceImpl + @@ -78,7 +79,7 @@ - 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 + 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_UPDATE_ZJH_COMPLETE, 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 @@ -219,6 +220,7 @@ DRAWINGS_NO, DRAWINGS_REVISION, IS_LOCK, + IS_UPDATE_ZJH_COMPLETE, ROUTER_BO, STEP_ID, OPERATION, @@ -287,6 +289,7 @@ #{releasedCompleteDate}, #{actualStartDate}, #{actualCompleteDate}, + #{isUpdateZJHComplete}, #{isDispatch}, #{isImport}, #{remark}, @@ -342,6 +345,7 @@ #{releasedCompleteDate}, #{actualStartDate}, #{actualCompleteDate}, + #{isUpdateZJHComplete}, #{isDispatch}, #{isImport}, #{remark}, @@ -393,6 +397,7 @@ RELEASED_COMPLETE_DATE=#{et.releasedCompleteDate}, ACTUAL_START_DATE=#{et.actualStartDate}, ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate}, + IS_UPDATE_ZJH_COMPLETE=#{et.isUpdateZJHComplete}, IS_DISPATCH=#{et.isDispatch}, IS_IMPORT=#{et.isImport}, REMARK=#{et.remark}, @@ -444,6 +449,7 @@ RELEASED_COMPLETE_DATE=#{et.releasedCompleteDate}, ACTUAL_START_DATE=#{et.actualStartDate}, ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate}, + IS_UPDATE_ZJH_COMPLETE=#{et.isUpdateZJHComplete}, IS_DISPATCH=#{et.isDispatch}, IS_IMPORT=#{et.isImport}, REMARK=#{et.remark}, @@ -495,6 +501,7 @@ RELEASED_COMPLETE_DATE=#{et.releasedCompleteDate}, ACTUAL_START_DATE=#{et.actualStartDate}, ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate}, + IS_UPDATE_ZJH_COMPLETE=#{et.isUpdateZJHComplete}, IS_DISPATCH=#{et.isDispatch}, IS_IMPORT=#{et.isImport}, REMARK=#{et.remark}, @@ -545,6 +552,7 @@ AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate} AND ACTUAL_START_DATE=#{ew.entity.actualStartDate} AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate} + AND IS_UPDATE_ZJH_COMPLETE=#{ew.isUpdateZJHComplete}, AND IS_DISPATCH=#{ew.entity.isDispatch} AND IS_IMPORT=#{ew.entity.isImport} AND REMARK=#{ew.entity.remark} @@ -683,7 +691,7 @@ 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 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.EARLIEST_START_DATE, SD.LATEST_END_DATE, - CASE WHEN CC.VALUE = '9' THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE, MAX(BC.COMPONENT_GBO) COMPONENT_BO, + CASE WHEN CC.VALUE = '9' THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.IS_UPDATE_ZJH_COMPLETE, SD.BLANKING_SIZE, MAX(BC.COMPONENT_GBO) COMPONENT_BO, WR.WORK_CENTER RESOURCE_WORK_CENTER, MAX(CP.ITEM) COMPONENT, MAX(CT.DESCRIPTION) COMPONENT_DESCRIPTION, MAX(C3.VALUE) TEXTURE, MAX(C4.VALUE) MAT_SPEC ,SD.OTHER_2 FROM Z_SFC_DISPATCH SD INNER JOIN SFC SC ON SC.SITE = SD.SITE AND SC.SFC = SD.SFC @@ -781,7 +789,7 @@ SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION, SD.DISPATCH_STATUS, SD.DISPATCH_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.EARLIEST_START_DATE, SD.LATEST_END_DATE, - CC.VALUE, SD.TURN_OPERATION, SD.BLANKING_SIZE, WR.WORK_CENTER ,SD.OTHER_2 + CC.VALUE, SD.TURN_OPERATION,SD.IS_UPDATE_ZJH_COMPLETE, SD.BLANKING_SIZE, WR.WORK_CENTER ,SD.OTHER_2 ) WIP LEFT JOIN Z_SFC_DISPATCH V1 ON V1.SITE = WIP.SITE AND V1.SFC = WIP.SFC AND V1.ROUTER_BO = WIP.ROUTER_BO 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.ROUTER_BO = WIP.ROUTER_BO AND V2.DISPATCH_SEQ = WIP.AFTER_SEQ @@ -789,7 +797,7 @@ WHERE WIP.IS_COMPLETED = #{isCompleted} - ORDER BY WIP.SHOP_ORDER, WIP.SFC, TO_NUMBER(WIP.DISPATCH_SEQ) + ORDER BY WIP.SHOP_ORDER,WIP.SFC,WIP.STEP_ID,TO_NUMBER(WIP.DISPATCH_SEQ) diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ShopOrderController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ShopOrderController.java index 848dd89e..e58440ae 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ShopOrderController.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ShopOrderController.java @@ -9,10 +9,7 @@ import com.foreverwin.modular.core.util.FrontPage; import com.foreverwin.modular.core.util.R; import com.sap.me.status.StatusBOHandle; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * @@ -92,11 +89,9 @@ public class ShopOrderController { * 查出只有异常的工单 */ @GetMapping("/findAbnormalShopOrder") - public R findAbnormalShopOrder(String type,ShopOrder shopOrder){ - return R.ok(shopOrderService.findAbnormalShopOrder(type,shopOrder)); + public R findAbnormalShopOrder(ShopOrder shopOrder){ + return R.ok(shopOrderService.findAbnormalShopOrder(shopOrder)); } - - } diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/ShopOrder.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/ShopOrder.java index 6d315b42..7e582609 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/ShopOrder.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/ShopOrder.java @@ -137,19 +137,18 @@ public class ShopOrder extends Model { @TableField("TOLERANCE_DEFINED_IN") private String toleranceDefinedIn; - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - //异常类型,查询异常工单时传参 + @TableField(exist = false) private String type; + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } - public String getHandle() { + public String getHandle() { return handle; } diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ShopOrderService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ShopOrderService.java index adf598c6..a9e924f3 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ShopOrderService.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ShopOrderService.java @@ -36,7 +36,7 @@ public interface ShopOrderService extends IService { ShopOrderDto findByShopOrderBo(String handle); - List findAbnormalShopOrder(String type,ShopOrder shopOrder); + List findAbnormalShopOrder(ShopOrder shopOrder); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ShopOrderServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ShopOrderServiceImpl.java index 2b6cec81..13ce5eee 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ShopOrderServiceImpl.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ShopOrderServiceImpl.java @@ -65,10 +65,9 @@ public class ShopOrderServiceImpl extends ServiceImpl findAbnormalShopOrder(String type,ShopOrder shopOrder) { + public List findAbnormalShopOrder(ShopOrder shopOrder) { String site = CommonMethods.getSite(); shopOrder.setSite(site); - shopOrder.setType(type); return shopOrderMapper.findAbnormalShopOrder(shopOrder); } diff --git a/meapi/src/main/resources/mapper/SfcMapper.xml b/meapi/src/main/resources/mapper/SfcMapper.xml index 1dc6ab94..e355fe4e 100644 --- a/meapi/src/main/resources/mapper/SfcMapper.xml +++ b/meapi/src/main/resources/mapper/SfcMapper.xml @@ -704,6 +704,7 @@ AND T.SFC like '%${globalQuery}%' OR T.ITEM_BO LIKE '%${globalQuery}%' + OR T.SHOP_ORDER_BO LIKE '%${globalQuery}%' diff --git a/meapi/src/main/resources/mapper/ShopOrderMapper.xml b/meapi/src/main/resources/mapper/ShopOrderMapper.xml index 34ef3ef9..21225d87 100644 --- a/meapi/src/main/resources/mapper/ShopOrderMapper.xml +++ b/meapi/src/main/resources/mapper/ShopOrderMapper.xml @@ -1035,7 +1035,7 @@