Commit 6302c7c2 by 江和松

Merge remote-tracking branch 'origin/dev' into dev

parents c57953ee 78424701
...@@ -14,6 +14,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext; ...@@ -14,6 +14,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.eu.dm.util.PlatFileUploader; import com.baosight.iplat4j.eu.dm.util.PlatFileUploader;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.net.URLEncoder;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -133,7 +134,8 @@ public class Iplat4jUtils { ...@@ -133,7 +134,8 @@ public class Iplat4jUtils {
} }
String chgName = dbDm02Map.get("chgName").toString(); String chgName = dbDm02Map.get("chgName").toString();
String realPath = dbDm02Map.get("realPath").toString(); String realPath = dbDm02Map.get("realPath").toString();
return S3Constant.RESOURCE + "/" + OSConstant.FILE_DOWNLOAD + "/" + realPath + chgName; return S3Constant.RESOURCE + "/" + OSConstant.FILE_DOWNLOAD + "/" + realPath
+ URLEncoder.encode(chgName, "UTF-8");
} }
} }
...@@ -145,8 +147,8 @@ public class Iplat4jUtils { ...@@ -145,8 +147,8 @@ public class Iplat4jUtils {
* @return * @return
*/ */
public static String compressFile(List<String> docIds, String zipName) throws Exception { public static String compressFile(List<String> docIds, String zipName) throws Exception {
String zipFolderPath = OSConstant.ZIP_DIR + OSConstant.SEPARATOR + DateUtils.shortDate() String mainFolderPath = OSConstant.ZIP_DIR + OSConstant.SEPARATOR + DateUtils.shortDate();
+ OSConstant.SEPARATOR + zipName; String zipFolderPath = mainFolderPath + OSConstant.SEPARATOR + zipName;
FileUtils.createDirs(zipFolderPath); FileUtils.createDirs(zipFolderPath);
String zipFilePath = zipFolderPath + ".zip"; String zipFilePath = zipFolderPath + ".zip";
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) { if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
...@@ -171,8 +173,10 @@ public class Iplat4jUtils { ...@@ -171,8 +173,10 @@ public class Iplat4jUtils {
// 压缩完删除本地文件 // 压缩完删除本地文件
FileUtils.deleteFiles(zipFolderPath); FileUtils.deleteFiles(zipFolderPath);
// 替换成HTTP地址 // 替换成HTTP地址
return S3Constant.RESOURCE + "/" + OSConstant.FILE_DOWNLOAD + zipFilePath.replace(OSConstant.DOC_ROOT_DIR, "") return S3Constant.RESOURCE + "/" + OSConstant.FILE_DOWNLOAD
.replace(OSConstant.SEPARATOR, "/"); + mainFolderPath.replace(OSConstant.DOC_ROOT_DIR, "")
.replace(OSConstant.SEPARATOR, "/") + "/"
+ URLEncoder.encode(zipName, "UTF-8") + ".zip";
} }
} }
...@@ -8,6 +8,7 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -8,6 +8,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW002; import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.pz.domain.HGPZ002; import com.baosight.hggp.hg.pz.domain.HGPZ002;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
...@@ -205,7 +206,7 @@ public class ServiceHGPZ002 extends ServiceBase { ...@@ -205,7 +206,7 @@ public class ServiceHGPZ002 extends ServiceBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<String> custCodes = resultRows.stream().map(row -> row.get(HGPZ002.FIELD_CUST_CODE).toString()).collect(Collectors.toList()); List<String> custCodes = resultRows.stream().map(row -> row.get(HGPZ002.FIELD_CUST_CODE).toString()).collect(Collectors.toList());
List<HGCW002> hgcw002List = queryCustCode(custCodes); List<HGSC001> hgsc001List = queryCustCode(custCodes);
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGPZ002 hgpz002 = new HGPZ002(); HGPZ002 hgpz002 = new HGPZ002();
hgpz002.fromMap(resultRow); hgpz002.fromMap(resultRow);
...@@ -214,26 +215,28 @@ public class ServiceHGPZ002 extends ServiceBase { ...@@ -214,26 +215,28 @@ public class ServiceHGPZ002 extends ServiceBase {
if (count > 0) { if (count > 0) {
//throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz002.getAccountName())); //throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz002.getAccountName()));
} }
List<HGCW002> hgcw002s =hgcw002List.stream().filter(hgcw002 -> hgcw002.getPartyA().equals(hgpz002.getCustCode())).collect(Collectors.toList()); List<HGSC001> hgcw002s =hgsc001List.stream().filter(hgsc001 ->
AssertUtils.isNotEmpty(hgcw002s, String.format("客户[%s]已关联业务,请先解除业务", hgpz002.getCustName())); hgsc001.getSubcontractCode().equals(hgpz002.getCustCode())||
hgsc001.getGenralContractCode().equals(hgpz002.getCustCode())
).collect(Collectors.toList());
AssertUtils.isNotEmpty(hgcw002s, String.format("客户[%s]已关联业务,无法删除", hgpz002.getCustName()));
DaoUtils.update(HGPZ002.DELETE, hgpz002); DaoUtils.update(HGPZ002.DELETE, hgpz002);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败"); LogUtils.setDetailMsg(inInfo, e, "删除失败");
} }
return inInfo; return inInfo;
} }
public List<HGCW002> queryCustCode(List<String> custCodes){ public List<HGSC001> queryCustCode(List<String> custCodes){
List<HGCW002> hgcw002List = DaoBase.getInstance().query(HGCW002.QUERY, List<HGSC001> hgsc001List = DaoBase.getInstance().query(HGSC001.QUERY,
new HashMap<String,Object>(){{ new HashMap<String,Object>(){{
put("partyA", custCodes); put("custCodes", custCodes);
put("partyB", custCodes);
}}); }});
return hgcw002List; return hgsc001List;
} }
} }
...@@ -7,7 +7,7 @@ package com.baosight.hggp.hg.sc.enums; ...@@ -7,7 +7,7 @@ package com.baosight.hggp.hg.sc.enums;
public enum ProjectSourceEnum { public enum ProjectSourceEnum {
ENGINEERING("engineering", "工程设计图"), ENGINEERING("engineering", "工程设计图"),
FOREIGN("foreign", "外来涉密图"), FOREIGN("foreign", "生产制造图"),
SPARE("spare", "备件制造图"), SPARE("spare", "备件制造图"),
OTHER("other", "其他"), OTHER("other", "其他"),
; ;
......
...@@ -44,7 +44,7 @@ public class ServiceHGSC010A extends ServiceEPBase { ...@@ -44,7 +44,7 @@ public class ServiceHGSC010A extends ServiceEPBase {
Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID), Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID),
new HashMap<String, Object>(){{ new HashMap<String, Object>(){{
put(HGPZ005.FIELD_STATUS,1); put(HGPZ005.FIELD_STATUS,1);
put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, Arrays.asList(InventTypeDetailEnum.COMPONENT.getCode(),InventTypeDetailEnum.RAW.getCode())); /*put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, Arrays.asList(InventTypeDetailEnum.COMPONENT.getCode(),InventTypeDetailEnum.RAW.getCode()));*/
}}, false); }}, false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010A().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010A().eiMetadata);
......
...@@ -49,7 +49,7 @@ public class ServiceHGSC010B extends ServiceEPBase { ...@@ -49,7 +49,7 @@ public class ServiceHGSC010B extends ServiceEPBase {
Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID), Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID),
new HashMap<String, Object>(){{ new HashMap<String, Object>(){{
put(HGPZ005.FIELD_STATUS,1); put(HGPZ005.FIELD_STATUS,1);
put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, Arrays.asList(InventTypeDetailEnum.COMPONENT.getCode(),InventTypeDetailEnum.RAW.getCode())); //put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, Arrays.asList(InventTypeDetailEnum.COMPONENT.getCode(),InventTypeDetailEnum.RAW.getCode()));
}}, false); }}, false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010B().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010B().eiMetadata);
......
...@@ -40,7 +40,7 @@ public class ServiceHGSC010C extends ServiceEPBase { ...@@ -40,7 +40,7 @@ public class ServiceHGSC010C extends ServiceEPBase {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour()); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
inInfo = super.query(inInfo, HGYX001C.QUERY, new HGYX001C()); inInfo = super.query(inInfo, HGYX001C.QUERY, new HGYX001C());
Map<String, Object> queryMap = new HashMap<>(); Map<String, Object> queryMap = new HashMap<>();
queryMap.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour()); //queryMap.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
CommonMethod.initBlock(inInfo, CommonMethod.initBlock(inInfo,
Arrays.asList( Arrays.asList(
DdynamicEnum.INVENT_TYPE_BLOCK_ID, DdynamicEnum.INVENT_TYPE_BLOCK_ID,
......
...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoBase; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -38,6 +39,9 @@ public class ServiceHGSC012 extends ServiceEPBase { ...@@ -38,6 +39,9 @@ public class ServiceHGSC012 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
if (queryMap.containsKey("contractDate")){
queryMap.put("contractDate", DateUtils.formatShort(queryMap.get("contractDate")));
}
List<Map> list = DaoBase.getInstance().query("HGSC012.query", queryMap); List<Map> list = DaoBase.getInstance().query("HGSC012.query", queryMap);
inInfo.set(EiConstant.resultBlock, list); inInfo.set(EiConstant.resultBlock, list);
}catch (Exception e){ }catch (Exception e){
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/24
* @description 生产管理
*/
public class ServiceHGSC013 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID, DdynamicEnum.PROJ_RECORD_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
if (queryMap.containsKey("contractDate")){
queryMap.put("contractDate", DateUtils.formatShort(queryMap.get("contractDate")));
}
List<Map> list = DaoBase.getInstance().query("HGSC013.query", queryMap);
inInfo.set(EiConstant.resultBlock, list);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
...@@ -122,6 +122,10 @@ ...@@ -122,6 +122,10 @@
<isNotEmpty prepend=" AND " property="branchUnit"> <isNotEmpty prepend=" AND " property="branchUnit">
branch_unit = #branchUnit# branch_unit = #branchUnit#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="custCodes">
(subcontract_code in <iterate close=")" open="(" conjunction="," property="custCodes">#custCodes[]#</iterate>
or genral_contract_code in <iterate close=")" open="(" conjunction="," property="custCodes">#custCodes[]#</iterate>)
</isNotEmpty>
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC013">
<select id="query" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
h.company_code as "companyCode", <!-- 公司编码(预留) -->
h.company_name as "companyName", <!-- 公司名称(预留) -->
h.proj_code as "projCode", <!-- 项目编码(预留) -->
h.proj_name as "projName", <!-- 项目名称(预留) -->
ha.product_code as "productCode", <!-- 产品编号 -->
ha.product_name as "productName", <!-- 产品名称 -->
ha.spec as "spec", <!-- 规格 -->
ha.length as "length", <!-- 长 -->
ha.width as "width", <!-- 宽 -->
ha.thick as "thick", <!-- 厚 -->
ha.quantity as "quantity", <!-- 数量 -->
ha.single_weight as "singleWeight", <!-- 单重 -->
ha.total_weight as "totalWeight", <!-- 总重 -->
ha.DEPOSIT_DATE as "depositDate", <!-- 入库日期 -->
ha.INV_QTY as "invQty", <!-- 数量 -->
ha.INV_UNIT_WEIGHT as "invUnitWeight", <!-- 单重 -->
ha.INV_WEIGHT as "invWeight", <!-- 重量 -->
hb.product_code as "clproductCode" , <!-- 产品编号 -->
hb.product_name as "clproductName", <!-- 产品名称 -->
hb.spec as "clspec", <!-- 规格 -->
hb.length as "cllength", <!-- 长 -->
hb.width as "clwidth", <!-- 宽 -->
hb.thick as "clthick", <!-- 厚 -->
hb.quantity as "clquantity", <!-- 数量 -->
hb.total_weight as "cltotalWeight", <!-- 总重 -->
hb.RECEIPT_DATE as "receiptDate", <!-- 领料日期 -->
hb.INV_QTY as "llinvQty", <!-- 数量 -->
hb.INV_WEIGHT as "llinvWeight" <!-- 重量 -->
from hggp.hgsc004 h
join (
select
h.id , -- 主键 -->
h.company_code , -- 公司编码(预留) -->
h.company_name , -- 公司名称(预留) -->
h.proj_code , -- 项目编码(预留) -->
h.proj_name , -- 项目名称(预留) -->
h.parent_prod_code , -- 父节点-产品编码 -->
h.parent_prod_name , -- 父节点-产品名称 -->
h.material_id , -- 物料清单id -->
h.product_id , -- 产品id -->
h.product_type , -- 产品类别 -->
h.product_code , -- 产品编号 -->
h.product_name , -- 产品名称 -->
h.invent_type , -- 档案类型 -->
h.spec , -- 规格 -->
h.length , -- 长 -->
h.width , -- 宽 -->
h.thick , -- 厚 -->
h.quantity , -- 数量 -->
h.single_weight , -- 单重 -->
h.total_weight , -- 总重 -->
h.approval_status , -- 审批状态 0:待审;1:审核中;2:已审 -->
h.leaf , -- 是否有叶子节点 -->
h.sort , -- 排序字段 -->
h.lv , -- 层级 -->
k.DEPOSIT_DATE , -- 入库日期 -->
k.INV_QTY , -- 数量 -->
k.INV_UNIT_WEIGHT , -- 单重 -->
k.INV_WEIGHT -- 重量 -->
from hggp.hgsc004a h
left join hggp.hgkc003 k on h.company_code = k.COMPANY_CODE and h.proj_code = k.PROJ_CODE
and h.product_code = k.PRDT_CODE
and k.DELETE_FLAG = 0
where h.product_status = 1 and h.lv = 3
<isNotEmpty prepend=" AND " property="accountCode">
h.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
h.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
h.COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
h.proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
h.proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
h.product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositDate">
k.DEPOSIT_DATE = #depositDate#
</isNotEmpty>
) ha on h.id = ha.material_id
join (
select
h.id , -- 主键 -->
h.company_code , -- 公司编码(预留) -->
h.company_name , -- 公司名称(预留) -->
h.proj_code , -- 项目编码(预留) -->
h.proj_name , -- 项目名称(预留) -->
h.parent_prod_code , -- 父节点-产品编码 -->
h.parent_prod_name , -- 父节点-产品名称 -->
h.material_id , -- 物料清单id -->
h.product_id , -- 产品id -->
h.product_type , -- 产品类别 -->
h.product_code , -- 产品编号 -->
h.product_name , -- 产品名称 -->
h.invent_type , -- 档案类型 -->
h.spec , -- 规格 -->
h.length , -- 长 -->
h.width , -- 宽 -->
h.thick , -- 厚 -->
h.quantity , -- 数量 -->
h.single_weight , -- 单重 -->
h.total_weight , -- 总重 -->
h.approval_status , -- 审批状态 0:待审;1:审核中;2:已审 -->
h.leaf , -- 是否有叶子节点 -->
h.sort , -- 排序字段 -->
h.lv , -- 层级 -->
k.RECEIPT_DATE , -- 入库日期 -->
k.INV_QTY , -- 数量 -->
k.INV_WEIGHT -- 重量 -->
from hggp.hgsc004a h
left join (
select
k.COMPANY_CODE ,
k.PROJ_CODE ,
k1.RECEIPT_DATE , -- 入库日期 -->
k.INVENT_CODE ,
sum(k.INV_QTY) as INV_QTY, -- 数量 -->
sum(k.INV_WEIGHT) as INV_WEIGHT -- 重量 -->
from hggp.hgkc008a k
join hggp.hgkc008 k1 on k.RECEIVE_ID = k1.id
where k.DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
k.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
k.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
k.COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
k.RECEIPT_DATE = #receiptDate#
</isNotEmpty>
group by k.COMPANY_CODE, k.PROJ_CODE, k1.RECEIPT_DATE, k.INVENT_CODE
) k on h.company_code = k.COMPANY_CODE
and h.proj_code = k.PROJ_CODE
and h.product_code = k.INVENT_CODE
where h.lv = 4 and h.product_status = 1
<isNotEmpty prepend=" AND " property="accountCode">
h.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
h.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
h.COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
h.product_code = #inventCode#
</isNotEmpty>
) hb on h.id = hb.material_id and ha.product_code = hb.parent_prod_code
order by h.id desc
</select>
</sqlMap>
\ No newline at end of file
...@@ -311,7 +311,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -311,7 +311,7 @@ public class ServiceHGWD001D extends TreeService {
List<Map> results = new ArrayList(); List<Map> results = new ArrayList();
String userId = UserSessionUtils.getLoginName(); String userId = UserSessionUtils.getLoginName();
// 查询项目来源 // 查询项目来源
HGSC001 dbSc001 = HGSCTools.Hgsc001.queryByCode(projCode); HGSC001 dbSc001 = HGSCTools.Hgsc001.getByCode(projCode);
// true:需要权限 // true:需要权限
boolean isSourceAuth = !ProjectSourceEnum.SPARE.getCode().equals(dbSc001.getProjectSource()); boolean isSourceAuth = !ProjectSourceEnum.SPARE.getCode().equals(dbSc001.getProjectSource());
Map queryMap = new HashMap(); Map queryMap = new HashMap();
......
...@@ -22,11 +22,11 @@ $(function () { ...@@ -22,11 +22,11 @@ $(function () {
let inventType = option.model['inventType']; let inventType = option.model['inventType'];
if (inventType){ if (inventType){
return _.filter(inventRecordBox, function (item) { return _.filter(inventRecordBox, function (item) {
return item["param3Field"]==inventType && item["param1Field"]=='1'; return item["param3Field"]==inventType;
}) })
}else { }else {
return _.filter(inventRecordBox, function (item) { return _.filter(inventRecordBox, function (item) {
return item["param1Field"]=='1'; return item;
}) })
} }
}, },
......
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/24
Time: 14:51
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/common/js/dayjs.min.js"></script>
<script src="${ctx}/common/js/vue-2.6.10.js"></script>
<style>
table{
border-color: #99d2ff;
}
table tr{
}
table tr th{
padding: 2px 8px;
font-size: .8125rem;
color: #2f80ed;
background: #dbefff;
height: 30px;
text-align: center;
}
table tr th span{
white-space: nowrap;
}
table tr td span{
white-space: nowrap;
}
table tr td{
padding: 0 8px;
height: 25px;
}
#table-box{
position: relative;
width: 100%;
overflow: auto;
min-height: 100%;
height: 74vh;
}
#table-box .table-content{
position: absolute;
min-height: 100%;
min-width: 100%;
}
.bg-blue{
background-color: #eff8ff;
}
</style>
<EF:EFPage title="委外执行加工表">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="contractDate" cname="委外加工日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="contractCode" cname="委外加工单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="supCode" cname="供应商名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
</EF:EFGrid>
<section id="table-box">
<section class="table-content">
<table border="1" >
<colgroup>
<col v-for="(item,k) in columns2" :key="k">
</colgroup>
<thead>
<tr>
<th v-for="(item,k) in columns" :key="k" :colspan="item.colspan">
<span>{{item.label}}</span>
</th>
</tr>
<tr>
<th v-for="(item,k) in columns2" :key="k" >
<span>{{item.label}}</span>
</th>
</tr>
</thead>
<tbody>
<tr v-for="(valObj,i) in list" :key="i">
<td v-for="(item,k) in columns2" :key="k" v-if="valObj[item.value].show" :rowspan="valObj[item.value].rowspan" :class="i/2%1?'bg-blue':''">
<span>{{valObj[item.value].value}}</span>
</td>
</tr>
</tbody>
</table>
</section>
</section>
</EF:EFRegion>
</EF:EFPage>
...@@ -95,27 +95,23 @@ $(function () { ...@@ -95,27 +95,23 @@ $(function () {
IPLATUI.EFTree = { IPLATUI.EFTree = {
"categoryTree": { "categoryTree": {
query: function (inInfo, model) { query: function (inInfo, model) {
if (model == null) {
return inInfo;
}
let label = model.label;
// 选中树节点
selectTreeId(label);
// 设置选中节点
treeSelectClick(model);
inInfo.set("inqu_status-0-projCode", $("#inqu_status-0-projCode").val()); inInfo.set("inqu_status-0-projCode", $("#inqu_status-0-projCode").val());
return inInfo; return inInfo;
}, },
select: function (e) { select: function (e) {
var _data = this.dataItem(e.node); let nodeData = this.dataItem(e.node);
var labelValue = _data.label; // 设置选中节点
var typeValue = _data.type; treeSelectClick(nodeData);
const eNameValue = _data.ename;
setTreeNodeValue(_data);
$("[name = 'inqu_status-0-parentId']").val(labelValue);
$("[name = 'inqu_status-0-fileId']").val(eNameValue);
$("[name = 'inqu_status-0-leafLevel']").val(_data.leafLevel==null?0:_data.leafLevel);
$("[name = 'inqu_status-0-projCode']").val(_data.projCode);
$("[name = 'inqu_status-0-type']").val(typeValue);
$("[name = 'inqu_status-0-fileName']").val(_data.text);
$("[name = 'inqu_status-0-leafType']").val(_data.leafType);
resultGrid.dataSource.page(1);
// 编辑、删除树节点时,需要刷新的树节点 // 编辑、删除树节点时,需要刷新的树节点
$("[name = 'inqu_status-0-orgParentId']").val(_data.parentId); $("[name = 'inqu_status-0-orgParentId']").val(nodeData.parentId);
// 显示授权按钮
showAuthButton();
}, },
/*ROOT:{label: 'root',text: '组织机构'},*/ /*ROOT:{label: 'root',text: '组织机构'},*/
template: function (node) { template: function (node) {
...@@ -320,8 +316,8 @@ $(function () { ...@@ -320,8 +316,8 @@ $(function () {
if (e.button !== 2) { if (e.button !== 2) {
return return
} }
if ("工程设计图" === e.target.textContent || "外来涉密图" === e.target.textContent if ("engineering" === e.target.title || "foreign" === e.target.title
|| "备件制造图" === e.target.textContent || "其他" === e.target.textContent) { || "spare" === e.target.title || "other" === e.target.title) {
$("#isAdd").css('display', 'none'); $("#isAdd").css('display', 'none');
$("#isDel").css('display', 'none'); $("#isDel").css('display', 'none');
$("#isEdit").css('display', 'none'); $("#isEdit").css('display', 'none');
...@@ -683,42 +679,27 @@ function expandTreeNodeList(tree, nodeIdList) { ...@@ -683,42 +679,27 @@ function expandTreeNodeList(tree, nodeIdList) {
} }
/** /**
* 选中对应的树节点
* @param tree
* @param treeOrgId
*/
const selectTreeNode = (tree, treeOrgId) => {
if (!tree || treeOrgId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeOrgId);
if (barDataItem) {
let barElement = tree.findByUid(barDataItem.uid);
// 刷新完成后选中对应的树节点
tree.select(barElement);
setTreeNodeValue(barDataItem);
} else {
selectTreeNode(tree, treeOrgId)
}
}, 100)
}
/**
* 设置树节点的值 * 设置树节点的值
* *
* @param nodeData * @param nodeData
*/ */
let setTreeNodeValue = function (nodeData) { let setTreeNodeValue = function (nodeData) {
IPLATUI.EFTree.categoryTree.selectTreeNode.fileId = nodeData.id; let leafLevel = nodeData.leafLevel == null ? 0 : nodeData.leafLevel;
IPLATUI.EFTree.categoryTree.selectTreeNode.fileId = nodeData.label;
IPLATUI.EFTree.categoryTree.selectTreeNode.parentId = nodeData.parentId; IPLATUI.EFTree.categoryTree.selectTreeNode.parentId = nodeData.parentId;
IPLATUI.EFTree.categoryTree.selectTreeNode.fileName = nodeData.text; IPLATUI.EFTree.categoryTree.selectTreeNode.fileName = nodeData.text;
IPLATUI.EFTree.categoryTree.selectTreeNode.companyCode = nodeData.companyCode; IPLATUI.EFTree.categoryTree.selectTreeNode.companyCode = nodeData.companyCode;
IPLATUI.EFTree.categoryTree.selectTreeNode.projCode = nodeData.projCode; IPLATUI.EFTree.categoryTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel = nodeData.leafLevel; IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel = leafLevel;
IPLATUI.EFTree.categoryTree.selectTreeNode.leafType = nodeData.leafType; IPLATUI.EFTree.categoryTree.selectTreeNode.leafType = nodeData.leafType;
IPLATUI.EFTree.categoryTree.selectTreeNode.isAuth = nodeData.isAuth; IPLATUI.EFTree.categoryTree.selectTreeNode.isAuth = nodeData.isAuth;
$("[name = 'inqu_status-0-parentId']").val(nodeData.label);
$("[name = 'inqu_status-0-fileId']").val(nodeData.label);
$("[name = 'inqu_status-0-leafLevel']").val(leafLevel);
$("[name = 'inqu_status-0-projCode']").val(nodeData.projCode);
$("[name = 'inqu_status-0-type']").val(nodeData.Type);
$("[name = 'inqu_status-0-fileName']").val(nodeData.text);
$("[name = 'inqu_status-0-leafType']").val(nodeData.leafType);
} }
/** /**
...@@ -1092,3 +1073,51 @@ let isProjectManager = function (parentId) { ...@@ -1092,3 +1073,51 @@ let isProjectManager = function (parentId) {
} }
}, {async: false}) }, {async: false})
} }
/**
* 选中树节点
*
* @param treeId
*/
let selectTreeId = function (treeId) {
// 刷新树节点
const tree = $("#categoryTree").data("kendoTreeView");
// 选中的节点
selectTreeNode(tree, treeId);
}
/**
* 选中树节点
*
* @param tree
* @param treeId
*/
let selectTreeNode = (tree, treeId) => {
if (!tree || treeId == null) {
return
}
setTimeout(() => {
let barDataItem = tree.dataSource.get(treeId);
if (barDataItem) {
let barElement = tree.findByUid(barDataItem.uid);
// 刷新完成后选中对应的树节点
tree.select(barElement);
} else {
selectTreeNode(tree, treeId)
}
}, 300)
}
/**
* 树点击事件
*
* @param nodeData
*/
let treeSelectClick = function (nodeData) {
// 设置选择的树节点信息
setTreeNodeValue(nodeData);
// 显示授权按钮
showAuthButton();
// 刷新列表
query();
}
\ No newline at end of file
...@@ -66,17 +66,18 @@ function previewFile(url, docType) { ...@@ -66,17 +66,18 @@ function previewFile(url, docType) {
previewExcel(url); previewExcel(url);
} else if (isWord(docType)) { } else if (isWord(docType)) {
previewDocx(url); previewDocx(url);
} else if (true) {
previewOnline(url);
} else if (isText(docType)) {
previewText(url);
} else if (isImage(docType)) {
previewImage(url);
} else if (isFrame(docType)) {
previewFrame(url);
} else { } else {
otherDownload(false, docId); previewOnline(url);
} }
// else if (isText(docType)) {
// previewText(url);
// } else if (isImage(docType)) {
// previewImage(url);
// } else if (isFrame(docType)) {
// previewFrame(url);
// } else {
// otherDownload(false, docId);
// }
} }
/** /**
...@@ -95,7 +96,7 @@ function hideHtml() { ...@@ -95,7 +96,7 @@ function hideHtml() {
/** /**
* 是否文本 * 是否文本
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isText(docType) { function isText(docType) {
...@@ -132,7 +133,7 @@ function previewText(docId) { ...@@ -132,7 +133,7 @@ function previewText(docId) {
/** /**
* 是否文本 * 是否文本
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isXml(docType) { function isXml(docType) {
...@@ -161,7 +162,7 @@ function previewXml(url) { ...@@ -161,7 +162,7 @@ function previewXml(url) {
/** /**
* 是否excel * 是否excel
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isExcel(docType) { function isExcel(docType) {
...@@ -210,7 +211,7 @@ function previewExcel(url) { ...@@ -210,7 +211,7 @@ function previewExcel(url) {
/** /**
* 是否WORD * 是否WORD
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isWord(docType) { function isWord(docType) {
...@@ -241,7 +242,7 @@ function previewDocx(url) { ...@@ -241,7 +242,7 @@ function previewDocx(url) {
/** /**
* 判断是否是图片 * 判断是否是图片
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isImage(docType) { function isImage(docType) {
...@@ -263,12 +264,12 @@ function previewImage(docId) { ...@@ -263,12 +264,12 @@ function previewImage(docId) {
} }
/** /**
* 判断是否frame预览 * PDF预览
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isFrame(docType) { function isPdf(docType) {
if (isBlank(docType)) { if (isBlank(docType)) {
return false; return false;
} }
...@@ -279,11 +280,13 @@ function isFrame(docType) { ...@@ -279,11 +280,13 @@ function isFrame(docType) {
/** /**
* frame预览 * frame预览
* *
* @param docId * @param url
*/ */
function previewFrame(docId) { function previewFrame(url) {
// 替换地址中的file-download为file-preview
url = url.replace("file-download", "file-preview");
$("#previewFrame").css('display', ''); $("#previewFrame").css('display', '');
$("#previewFrame").attr("src", downloadHref(docId, true)); $("#previewFrame").attr("src", url);
} }
/** /**
...@@ -363,6 +366,17 @@ let bigImage = null; ...@@ -363,6 +366,17 @@ let bigImage = null;
window.onload = function () { window.onload = function () {
// 监听iframe // 监听iframe
// iframeLoad(); // iframeLoad();
// 禁用鼠标右键
document.addEventListener('contextmenu', event => event.preventDefault());
document.addEventListener('copy', event => event.preventDefault());
// 图片预览初始化
// imageShowInit();
};
/**
* 图片预览初始化
*/
function imageShowInit(){
imageOuterDiv = document.querySelector("#imageOuterDiv"); imageOuterDiv = document.querySelector("#imageOuterDiv");
realImage = document.querySelector("#image"); realImage = document.querySelector("#image");
bigImage = document.querySelector("#bigImage"); bigImage = document.querySelector("#bigImage");
...@@ -383,7 +397,7 @@ window.onload = function () { ...@@ -383,7 +397,7 @@ window.onload = function () {
// 拖转事件调用 // 拖转事件调用
imgDrag(); imgDrag();
}); });
}; }
/** /**
* 点击图片放大 * 点击图片放大
......
...@@ -671,10 +671,6 @@ function loadChange(grid,e,field) { ...@@ -671,10 +671,6 @@ function loadChange(grid,e,field) {
* @param url 文件URL * @param url 文件URL
*/ */
let previewFile = function (url) { let previewFile = function (url) {
// let hostname = window.location.hostname;
// let domain = hostname === "localhost" ? "http://129.211.46.84:8085" : window.location.origin;
// let url = domain + IPLATUI.CONTEXT_PATH + '/file/download/preview/' + docId
// + "?fullfilename=";
// Base64转码 // Base64转码
let urlEncode; let urlEncode;
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment