图纸查看逻辑,铭扬修改内容。

master
yangwl 3 years ago
parent 735c7fb6a9
commit fb8643c978

@ -743,11 +743,15 @@
WHEN zab.NC_QTY IS NOT NULL THEN ROUND((zsd.DISPATCH_QTY - TO_NUMBER(zab.NC_QTY))*ZSD.PROD_HOURS ,4)
ELSE ROUND(zsd.DISPATCH_QTY*ZSD.PROD_HOURS ,4) END TOTAL_PROD_HOURS ,
zsd.EMPLOYEE_DESCRIPTION,
zsd.ACTUAL_START_DATE,
zsd.ACTUAL_COMPLETE_DATE,
zsd.REMARK
CASE WHEN ZUR.TEMPORARY_USER = 'true' THEN '临时'
WHEN ZUR.TEMPORARY_USER = 'false' THEN '正式' END EMPLOYEE_ATTR,
zsd.ACTUAL_START_DATE,
zsd.ACTUAL_COMPLETE_DATE,
zsd.REMARK
FROM Z_SFC_DISPATCH zsd
INNER JOIN SHOP_ORDER so ON so.SHOP_ORDER = zsd.SHOP_ORDER AND so.SITE = zsd.SITE
LEFT JOIN Z_USER_RESOURCE ZUR ON zsd.RESRCE = ZUR.RESRCE
AND zsd.EMPLOYEE_DESCRIPTION like CONCAT(ZUR.USER_DESCRIPTION, '%')
INNER JOIN SHOP_ORDER so ON so.SHOP_ORDER = zsd.SHOP_ORDER AND so.SITE = zsd.SITE
LEFT JOIN CUSTOM_FIELDS cf ON cf.HANDLE = so.HANDLE AND cf."ATTRIBUTE" = 'ITEM_NUMBER'
LEFT JOIN CUSTOM_FIELDS cf2 ON cf2.HANDLE = so.HANDLE AND cf2."ATTRIBUTE" = 'WORK_ORDER'
INNER JOIN ITEM i ON i.HANDLE = so.ITEM_BO

@ -83,6 +83,7 @@
<artifactId>meapi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
@ -109,5 +110,6 @@
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
</dependency>
</dependencies>
</project>

@ -4,6 +4,7 @@ import com.foreverwin.mesnac.common.ftp.CappFtpClient;
import com.foreverwin.mesnac.common.service.FileService;
import com.foreverwin.mesnac.meapi.util.StringUtils;
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.slf4j.Logger;
@ -11,10 +12,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -46,12 +44,13 @@ public class FileController {
*/
@ResponseBody
@RequestMapping(method = RequestMethod.GET, value = "/getPdfPath")
public R getPdfPath(String sfc) {
public R getPdfPath(@RequestParam("sfc") String sfc, @RequestParam("operation") String operation,@RequestParam("step") String step) {
try {
if(StringUtils.isBlank(sfc)){
throw new BaseException("产品条码不能为空!");
throw new BaseException("派工单号不能为空!");
}
return R.ok(fileService.getFilePaths(sfc));
String site = CommonMethods.getSite();
return R.ok(fileService.getFilePaths(site,sfc,operation,step));
}catch (Exception e){
return R.failed("获取图纸路径失败:"+e.getMessage());
}

@ -7,6 +7,6 @@ import java.util.Map;
*/
public interface FileService {
Map<String,String> getFilePaths(String sfc) throws Exception;
Map<String,String> getFilePaths(String site,String sfc,String operation,String step) throws Exception;
Map<String,String> getFilePathsByItemBo(String itemBo) throws Exception;
}

@ -1,11 +1,14 @@
package com.foreverwin.mesnac.common.service.impl;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.ftp.CappFtpClient;
import com.foreverwin.mesnac.common.service.FileService;
import com.foreverwin.mesnac.common.util.ExceptionUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.model.Sfc;
import com.foreverwin.mesnac.meapi.model.SfcDispatchDrawing;
import com.foreverwin.mesnac.meapi.service.SfcDispatchDrawingService;
import com.foreverwin.mesnac.meapi.service.SfcService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.util.CommonMethods;
@ -14,8 +17,10 @@ import org.apache.commons.net.ftp.FTPFile;
import org.springframework.beans.factory.annotation.Autowired;
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;
@Service
@ -23,16 +28,23 @@ public class FileServiceImpl implements FileService {
@Autowired
private SfcService sfcService;
@Autowired
private SfcDispatchDrawingService sfcDispatchDrawingService;
@Autowired
private CappFtpClient cappFtpClient;
@Override
public Map<String, String> getFilePaths(String sfc) throws IOException {
public Map<String, String> getFilePaths(String site,String sfc,String operation,String step) throws IOException {
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(CommonMethods.getSite(), sfc));
if (sfcServiceById==null){
throw new BaseException("未找到产品条码"+sfc);
}
SfcDispatchDrawing sfcDispatchDrawing = sfcDispatchDrawingService.findSfcDispatch(site,sfc,operation,step);
if (sfcDispatchDrawing==null||sfcDispatchDrawing.getDrawingsRevision()==null){
throw new BaseException("未找到图纸相应信息");
}
String itemBo = sfcServiceById.getItemBo();
String path="/"+ StringUtil.trimHandle(itemBo)+"_"+StringUtil.trimRevision(itemBo)+"/";
String path="/"+ StringUtil.trimHandle(itemBo)+"_"+sfcDispatchDrawing.getDrawingsRevision()+"/";
FTPClient connect = null;
Map<String,String> pathMap = new HashMap<>();
try {
@ -41,12 +53,17 @@ public class FileServiceImpl implements FileService {
connect.enterLocalPassiveMode();
FTPFile[] files = connect.listFiles();
if(files!=null){
for (int i = 0; i < files.length; i++) {
if(files[i].isFile()){
String filename=files[i].getName();
pathMap.put(filename,path+filename);
for (FTPFile ftpFile:files){
if (ftpFile.getName().equals(path.substring(1,path.length()-1))&&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);
// }
// }
}
connect.disconnect();
}catch (Exception e){
@ -88,7 +105,6 @@ public class FileServiceImpl implements FileService {
connect.disconnect();
}
}
return pathMap;
}

@ -6,7 +6,7 @@ spring:
primary: wip #设置默认的数据源或者数据源组,默认值即为master
datasource:
wip:
url: jdbc:oracle:thin:@113.98.201.217:1521/ORD
url: jdbc:oracle:thin:@172.16.251.133:1521/ORQ
username: wip
password: wip
driver-class-name: oracle.jdbc.OracleDriver

@ -36,7 +36,7 @@ spring:
date-format: yyyy-MM-dd HH:mm:ss
profiles:
# active: prd
# active: qas
# active: qas
active: local
# active: dev
# 文件上传

@ -253,10 +253,10 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
}
//校验派工单领料状态为无需叫料或未叫料
List<CallItem> callItemList = callItemService.getEffectedCallItemByDispatchBo(sfcDispatchBo);
if (callItemList != null && callItemList.size() > 0) {
throw BusinessException.build("工单[" + shopOrder + "]的派工单[" + dispatchNo + "]已有发料,不能取消!");
}
// List<CallItem> callItemList = callItemService.getEffectedCallItemByDispatchBo(sfcDispatchBo);
// if (callItemList != null && callItemList.size() > 0) {
// throw BusinessException.build("工单[" + shopOrder + "]的派工单[" + dispatchNo + "]已有发料,不能取消!");
// }
sfcDispatch = new SfcDispatch();

@ -92,8 +92,8 @@ public class ShopOrderController {
*
*/
@GetMapping("/findAbnormalShopOrder")
public R findAbnormalShopOrder(ShopOrder shopOrder){
return R.ok(shopOrderService.findAbnormalShopOrder(shopOrder));
public R findAbnormalShopOrder(String type,ShopOrder shopOrder){
return R.ok(shopOrderService.findAbnormalShopOrder(type,shopOrder));
}

@ -137,6 +137,17 @@ public class ShopOrder extends Model<ShopOrder> {
@TableField("TOLERANCE_DEFINED_IN")
private String toleranceDefinedIn;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
//异常类型,查询异常工单时传参
private String type;
public String getHandle() {
return handle;

@ -0,0 +1,31 @@
package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.meapi.model.SfcDispatchDrawing;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-06-02
*/
public interface SfcDispatchDrawingService extends IService<SfcDispatchDrawing> {
/**
*
*
* @param site
* @param sfc
* @param operation
* @param stepId
* @return
*/
SfcDispatchDrawing findSfcDispatch(String site, String sfc, String operation, String stepId);
}

@ -36,7 +36,7 @@ public interface ShopOrderService extends IService<ShopOrder> {
ShopOrderDto findByShopOrderBo(String handle);
List<ShopOrder> findAbnormalShopOrder(ShopOrder shopOrder);
List<ShopOrder> findAbnormalShopOrder(String type,ShopOrder shopOrder);
}

@ -65,9 +65,10 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
}
@Override
public List<ShopOrder> findAbnormalShopOrder(ShopOrder shopOrder) {
public List<ShopOrder> findAbnormalShopOrder(String type,ShopOrder shopOrder) {
String site = CommonMethods.getSite();
shopOrder.setSite(site);
shopOrder.setType(type);
return shopOrderMapper.findAbnormalShopOrder(shopOrder);
}

@ -1041,6 +1041,9 @@
INNER JOIN ITEM i ON i.HANDLE = so.PLANNED_ITEM_BO
<where>
so.SITE = #{site}
<if test="type!=null and type!=''">
AND zab.TYPE = #{type}
</if>
</where>
</select>
</mapper>

@ -165,10 +165,12 @@ public class PodTemplateServiceImpl implements PodTemplateService {
if (resultMap == null) {
throw new BaseException("根据当前资源未找到条码[" + sfc + "]的基本信息!");
}
if(resultMap.get("EMPLOYEE_DESCRIPTION")==null||resultMap.get("EMPLOYEE_DESCRIPTION").equals("")){
throw new BaseException("产品条码[" + sfc + "]的操作人员为空!请联系调度人员维护!");
}
//List<Map<String, Object>> substepList = sfcCrossMapper.querySfcStep(site, sfc, operationBySfcBo.getOperation());
List<Map<String, Object>> substepList = new ArrayList<>();
resultMap.put("SFC_STEP_LIST", substepList);
//是否需要自检和互检
String isCreateH = "N";
String isCreateZ = "N";
@ -284,7 +286,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}
BigDecimal workHour=BigDecimal.ZERO;
BigDecimal qty = new BigDecimal(sfcServiceById.getQty().toString());
if (!operation.equals("WX_6106GX")) {
if (!operation.equals("WX_6106GX")&&!operation.equals("HJ_6106JYGX")&&!operation.equals("HJ_6106JRGX")) {
//是否有自检检验项目
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_Z);
if (inspectionItemDetails.size() > 0 && inspectionItemDetails.get(0) != null) {

@ -94,7 +94,7 @@
CASE WHEN ST.STATUS='403' AND SS.QTY_IN_QUEUE > 0 THEN N'402' ELSE ST.STATUS END STATUS,
OP.OPERATION, OT.DESCRIPTION OPERATION_DESC,OP.OPERATION||'/'||RS.STEP_ID OPERATION_STEP,
RO_CF2.VALUE TOOL ,SOD.HANDLE SFC_DISPATCH_DETAIL_BO,SOD.WORK_CENTER,SOD.PROD_HOURS,
S.SFC,S.QTY SFC_QTY,RS.STEP_ID, SOD.DISPATCH_NO ,
S.SFC,S.QTY SFC_QTY,RS.STEP_ID, SOD.DISPATCH_NO ,SOD.EMPLOYEE_DESCRIPTION,
TO_CHAR( SOD.PLANNED_START_DATE + INTERVAL '8' HOUR,'yyyy-mm-dd hh24:mi:ss')START_DATE,
TO_CHAR(SOD.PLANNED_COMP_DATE + INTERVAL '8' HOUR ,'yyyy-mm-dd hh24:mi:ss')COMP_DATE,
TO_CHAR((SOD.PLANNED_COMP_DATE - SOD.PLANNED_START_DATE )*24,'fm9999999990.00')||'H' ADD_DATE,
@ -117,7 +117,7 @@
INNER JOIN ITEM I ON I.HANDLE = S.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = I.HANDLE AND IT.LOCALE =#{locale}
INNER JOIN (
SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMP_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO,SD.WORK_CENTER,SD.PROD_HOURS
SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMP_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO,SD.WORK_CENTER,SD.PROD_HOURS,SD.EMPLOYEE_DESCRIPTION
FROM Z_PROD_READY_TASK RB
INNER JOIN Z_SFC_DISPATCH SD ON SD.HANDLE = RB.SFC_DISPATCH_BO
WHERE RB.SITE =#{site} AND RB.STATUS = 'FINISH' AND RB."RESULT"='OK'

Loading…
Cancel
Save