Commit a23928af by 宋祥
parents 177ada9a 59fdd571
package com.baosight.hggp.core.extapp.decheng.annotation;
import org.springframework.core.annotation.AliasFor;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
......@@ -11,10 +13,19 @@ import java.lang.annotation.RetentionPolicy;
public @interface AliasNameAnon {
/**
* 值
*
* @return
*/
@AliasFor("name")
String value() default "";
/**
* 名称
*
* @return
*/
@AliasFor("value")
String name() default "";
}
......@@ -16,7 +16,6 @@ import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.exception.PlatException;
import java.io.IOException;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
......@@ -50,8 +49,8 @@ public class DcOpenApi {
*
* @param pageIndex 当前页
*/
public static Pager<DcUserList> userList(int pageIndex)
throws IOException, InstantiationException, IllegalAccessException {
public static Pager<DcUserList> userList(int pageIndex) throws IOException, InstantiationException,
IllegalAccessException {
JSONObject paramJson = DcApiUtils.buildParamJson(pageIndex);
String result = HttpUtils.post(DeChengConst.USER_LIST, DcApiUtils.buildHeader(), JSON.toJSONString(paramJson),
HttpUtils.JSON_MEDIA_TYPE);
......@@ -84,7 +83,7 @@ public class DcOpenApi {
* @param endTime 结束日期 20240820
* @param pageIndex 当前页
*/
public static List<DcChance> chanceList(String startTime, String endTime, int pageIndex) throws IOException {
public static Pager<DcChance> chanceList(String startTime, String endTime, int pageIndex) throws IOException {
JSONArray dataJsons = new JSONArray();
dataJsons.add(DcApiUtils.buildValueJson("a_date_0", startTime));
dataJsons.add(DcApiUtils.buildValueJson("a_date_1", endTime));
......@@ -103,7 +102,7 @@ public class DcOpenApi {
*
* @param pageIndex 当前页
*/
public static List<DcContractList> contactList(int pageIndex) throws IOException {
public static Pager<DcContractList> contactList(int pageIndex) throws IOException {
JSONArray dataJsons = new JSONArray();
dataJsons.add(DcApiUtils.buildValueJson("pageindex", pageIndex));
dataJsons.add(DcApiUtils.buildValueJson("pagesize", 100));
......
......@@ -191,12 +191,24 @@ public class DcApiUtils {
* @param result
* @return
*/
public static <T> List<T> handleResult(String result, Class<T> clazz) {
public static <T> Pager<T> handleResult(String result, Class<T> clazz) {
JSONObject resultJson = JSONObject.parseObject(result);
// 异常处理
handleMessage(resultJson);
// 获取结果数据集
JSONObject bodyJson = resultJson.getJSONObject("body");
JSONObject sourceJson = bodyJson.getJSONObject("source");
JSONObject tableJson = sourceJson.getJSONObject("table");
// 构建结果数据集
return buildTableData(resultJson, clazz);
Pager pager = new Pager<T>();
pager.setData(buildTableData(tableJson, clazz));
// 分页数据
JSONObject pageJson = tableJson.getJSONObject("page");
pager.setPageIndex(pageJson.getInteger("pageindex"));
pager.setPageSize(pageJson.getInteger("pagesize"));
pager.setTotalRows(pageJson.getInteger("recordcount"));
pager.setTotalPages(pageJson.getInteger("pagecount"));
return pager;
}
/**
......@@ -221,15 +233,12 @@ public class DcApiUtils {
/**
* 构建数据集
*
* @param resultJson
* @param tableJson
* @param clazz
* @param <T>
* @return
*/
public static <T> List<T> buildTableData(JSONObject resultJson, Class<T> clazz) {
JSONObject bodyJson = resultJson.getJSONObject("body");
JSONObject sourceJson = bodyJson.getJSONObject("source");
JSONObject tableJson = sourceJson.getJSONObject("table");
public static <T> List<T> buildTableData(JSONObject tableJson, Class<T> clazz) {
JSONArray colJsons = tableJson.getJSONArray("cols");
JSONArray rowJsons = tableJson.getJSONArray("rows");
return rowJsons.stream().map(item -> {
......
......@@ -109,13 +109,11 @@ public class ServiceHGCG003B extends ServiceBase {
this.editData(fCg003Bs, dbCg003BMap, dbCg002AMap, cg003, dbCg002BMap);
} else {
// 写入数据
for (int i = 0; i < fCg003Bs.size(); i++) {
HGCG003B hgcg003B = fCg003Bs.get(i);
if (hgcg003B.getId() == null || hgcg003B.getId() == 0) {
// 修改数据
this.addData(hgcg003B, cg003);
for (HGCG003B fCg003B : fCg003Bs) {
if (fCg003B.getId() == null || fCg003B.getId() == 0) {
this.addData(fCg003B, cg003);
} else {
this.updateData(hgcg003B);
this.updateData(fCg003B);
}
}
//修改主表信息
......
......@@ -631,7 +631,9 @@ public class HGSqlConstant {
* @date:2024/5/8,10:55
*/
public class HgXsUser {
// 查询
public static final String GET_BY_LOGIN = "HGXSUser.getByLogin";
// 查询
public static final String QUERY = "HGXSUser.query";
// 查询
......
......@@ -46,6 +46,7 @@ public class HGCW005 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_COMPANY_CODES = "companyCodes";
public static final String FIELD_DELIVERY_CODE = "deliveryCode"; /* 发货单号*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -99,6 +100,7 @@ public class HGCW005 extends DaoEPBase {
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private String depCode = " "; /* 部门编码*/
private String deliveryCode = " "; /* 发货单号*/
/**
* initialize the metadata.
......@@ -194,6 +196,9 @@ public class HGCW005 extends DaoEPBase {
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELIVERY_CODE);
eiColumn.setDescName("发货单号");
eiMetadata.addMeta(eiColumn);
}
......@@ -540,6 +545,15 @@ public class HGCW005 extends DaoEPBase {
public void setDepCode(String depCode) {
this.depCode = depCode;
}
public String getDeliveryCode() {
return deliveryCode;
}
public void setDeliveryCode(String deliveryCode) {
this.deliveryCode = deliveryCode;
}
/**
* get the value from Map.
*
......@@ -569,6 +583,7 @@ public class HGCW005 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setDeliveryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_CODE)), deliveryCode));
}
/**
......@@ -599,6 +614,7 @@ public class HGCW005 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_DELIVERY_CODE, StringUtils.toString(deliveryCode, eiMetadata.getMeta(FIELD_DELIVERY_CODE)));
return map;
}
......
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.domain.HGCW005;
import com.baosight.hggp.hg.cw.domain.HGCW005A;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/8/31
* @description 选择发货单
*/
public class ServiceHGCW005A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
CommonMethod.initBlock(inInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID,
DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,
DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,
DdynamicEnum.SPEC_BOX_BLOCK_ID,
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
put(HGCW005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
}}, false);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGCW005A.QUERY,new HGCW005A());
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "扣款单",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
//List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGCW005A> hgcw005AList = MapUtils.toDaoEPBases(inInfo, HGCW005A.class);
Map<String, List<HGCW005A>> hgcw005Map = Optional.ofNullable(hgcw005AList).orElse(new ArrayList<>()).stream().collect(Collectors.groupingBy(HGCW005A::getDeliveryCode,Collectors.toList()));
Set<String> deliveryCodeSet = hgcw005Map.keySet();
for (String deliveryCode : deliveryCodeSet) {
List<HGCW005A> hgcw005As = hgcw005Map.get(deliveryCode);
BigDecimal totalContractPriceIncluding =hgcw005As.stream().map(HGCW005A::getTotalContractPriceIncluding).reduce(BigDecimal.ZERO, BigDecimal::add);
HGCW005 hgcw005 = new HGCW005();
hgcw005.setDeliveryCode(deliveryCode);
hgcw005.setCompanyCode(hgcw005As.get(0).getCompanyCode());
hgcw005.setCompanyName(hgcw005As.get(0).getCompanyName());
hgcw005.setProjCode(hgcw005As.get(0).getProjCode());
hgcw005.setProjName(hgcw005As.get(0).getProjName());
hgcw005.setPartyA(hgcw005As.get(0).getReceCode()+"-"+hgcw005As.get(0).getReceName());
hgcw005.setPartyB(hgcw005As.get(0).getCompanyCode()+"-"+hgcw005As.get(0).getCompanyName());
hgcw005.setContractContent("发货单扣款");
hgcw005.setSigningDate(DateUtils.date());
hgcw005.setReviewStatus(0);
hgcw005.setTotalContractPriceIncluding(totalContractPriceIncluding);
DaoUtils.insert(HGCW005.INSERT, hgcw005);
for (HGCW005A hgcw005A : hgcw005As) {
if (hgcw005A.getId() == null || hgcw005A.getId() == 0) {
hgcw005A.setParentId(hgcw005.getId().toString());
this.add(hgcw005A);
} else {
this.modify(hgcw005A);
}
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgcw005AList.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param hgcw005A
* @return
*/
public void add(HGCW005A hgcw005A) {
DaoUtils.insert(HGCW005A.INSERT, hgcw005A);
}
/**
* 修改操作
*
* @param hgcw005A
* @return
*/
public void modify(HGCW005A hgcw005A) {
DaoUtils.update(HGCW005A.UPDATE, hgcw005A);
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.domain.HGCW005A;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
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.HashMap;
import java.util.List;
/**
* @author LiuYang
* @version 1.0 2024/8/31
* @description 发货明细
*/
public class ServiceHGCW005B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
EiInfo outInfo = super.initLoad(inInfo, new HGCW005A());
try {
outInfo = super.query(inInfo, HGCW005A.QUERY_HGYX001, new HGCW005A());
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_ALL_BLOCK_ID));
CommonMethod.initBlock(outInfo,
Arrays.asList(
DdynamicEnum.PROJ_RECORD_BLOCK_ID,
DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,
DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,
DdynamicEnum.SPEC_BOX_BLOCK_ID,
DdynamicEnum.WH_RECORD_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
put(HGCW005A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
}}, false);
}catch (Exception e){
LogUtils.setDetailMsg(outInfo, e, "初始化失败");
}
return outInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGCW005A.QUERY_HGYX001,new HGCW005A());
}
}
......@@ -98,6 +98,9 @@
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deliveryCode">
DELIVERY_CODE like CONCAT('%',#deliveryCode#,'%')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -123,7 +126,8 @@
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
DELIVERY_CODE as "deliveryCode"
FROM ${hggpSchema}.HGCW005 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -131,7 +135,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
SIGNING_DATE desc ,ID desc
</isEmpty>
</dynamic>
......@@ -229,9 +233,13 @@
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
DEP_CODE, <!-- 部门编码 -->
DELIVERY_CODE
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projName#, #projCode#, #contractNumber#, #contractName#, #signingDate#, #partyA#, #partyB#, #reviewStatus#, #contractContent#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projName#, #projCode#, #contractNumber#, #contractName#, #signingDate#, #partyA#, #partyB#, #reviewStatus#, #contractContent#, #totalContractPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#, #deliveryCode#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGCW005
</selectKey>
</insert>
<delete id="delete">
......@@ -261,7 +269,8 @@
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
DELIVERY_CODE = #deliveryCode#
WHERE
ID = #id#
</update>
......
......@@ -697,6 +697,7 @@ public class HGPZTools {
pz005.setCoefficient(hgsc009a.getCoefficient());
pz005.setUnit(hgsc009a.getUnit());
pz005.setStatus(1); //默认启用
jointSpec(pz005);
DaoUtils.insert(HGPZ005.INSERT,pz005);
......
......@@ -14,6 +14,8 @@ public class HgScSqlConstant {
*/
public static class HgSc001 {
// 获取
public static final String GET_BY_CODE = "HGSC001.get";
// 德诚修改
public static final String UPDATE_FOR_DC = "HGSC001.updateForDc";
// 修改项目名称
......
......@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi;
import com.baosight.hggp.core.extapp.decheng.model.DcContractList;
import com.baosight.hggp.core.model.Pager;
import com.baosight.hggp.core.utils.ThreadUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......@@ -125,12 +126,13 @@ public class ServiceHGSC101 extends ServiceEPBase {
if (pageIndex > 1000) {
break;
}
List<DcContractList> zbContracts = DcOpenApi.contactList(pageIndex);
if (CollectionUtils.isEmpty(zbContracts)) {
Pager<DcContractList> pager = DcOpenApi.contactList(pageIndex);
List<DcContractList> dcContractLists = pager.getData();
if (CollectionUtils.isEmpty(dcContractLists) || pageIndex > pager.getTotalPages()) {
break;
}
// 写入合同数据
saveContractData(accountCode, zbContracts);
saveContractData(accountCode, dcContractLists);
pageIndex++;
}
}
......@@ -139,27 +141,27 @@ public class ServiceHGSC101 extends ServiceEPBase {
* 写入合同信息
*
* @param accountCode
* @param zbContracts
* @param dcContractLists
*/
private void saveContractData(String accountCode, List<DcContractList> zbContracts) {
private void saveContractData(String accountCode, List<DcContractList> dcContractLists) {
// 查询帐套信息
HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(accountCode);
String prefix = dbPz009.getLoginPrefix();
for (DcContractList zbContract : zbContracts) {
String projCode = prefix + zbContract.getOrd();
HGSC001 dbSc001 = HGSCTools.Hgsc001.queryByCode(projCode);
for (DcContractList dcContractList : dcContractLists) {
String projCode = prefix + dcContractList.getOrd();
HGSC001 dbSc001 = HGSCTools.Hgsc001.getByCode(projCode);
if (dbSc001 == null) {
dbSc001 = new HGSC001();
dbSc001.setAccountCode(accountCode);
dbSc001.setDepCode(accountCode);
dbSc001.setDepName(dbPz009.getAccountName());
dbSc001.setProjCode(projCode);
dbSc001.setProjName(zbContract.getTitle());
dbSc001.setProjName(dcContractList.getTitle());
DaoUtils.insert(HGSC001.INSERT, dbSc001);
} else {
Map updateMap = new HashMap();
updateMap.put(HGSC001.FIELD_proj_code, projCode);
updateMap.put(HGSC001.FIELD_proj_name, zbContract.getTitle());
updateMap.put(HGSC001.FIELD_proj_name, dcContractList.getTitle());
DaoUtils.insert(HgScSqlConstant.HgSc001.UPDATE_PROJ_NAME, dbSc001);
}
}
......
......@@ -2,6 +2,37 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC001">
<sql id="column">
id as "id",
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
subcontract_code as "subcontractCode", <!-- 分包商编码 -->
subcontract_name as "subcontractName", <!-- 分包商名称 -->
genral_contract_code as "genralContractCode", <!-- 总包商编码 -->
genral_contract_name as "genralContractName", <!-- 总包商名称 -->
party_pm_name as "partyPmName", <!-- 甲方项目经理名称 -->
party_pm_hpone as "partyPmHpone", <!-- 甲方项目经理联系电话 -->
contract_name as "contractName", <!-- 合同名称 -->
contract_work_txt as "contractWorkTxt", <!-- 合同工作量 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
proj_type as "projType", <!-- 项目性质 -->
proj_status as "projStatus", <!-- 项目状态 0:在建;1:完工 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
permiss_start_date as "permissStartDate", <!-- 准许开工日期 -->
start_date as "startDate", <!-- 开工日期 -->
end_date as "endDate", <!-- 完工日期 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
......@@ -98,47 +129,27 @@
</isNotEmpty>
</sql>
<select id="get" resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSC001
WHERE PROJ_CODE = #projCode#
</select>
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT
id as "id",
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
subcontract_code as "subcontractCode", <!-- 分包商编码 -->
subcontract_name as "subcontractName", <!-- 分包商名称 -->
genral_contract_code as "genralContractCode", <!-- 总包商编码 -->
genral_contract_name as "genralContractName", <!-- 总包商名称 -->
party_pm_name as "partyPmName", <!-- 甲方项目经理名称 -->
party_pm_hpone as "partyPmHpone", <!-- 甲方项目经理联系电话 -->
contract_name as "contractName", <!-- 合同名称 -->
contract_work_txt as "contractWorkTxt", <!-- 合同工作量 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
proj_type as "projType", <!-- 项目性质 -->
proj_status as "projStatus", <!-- 项目状态 0:在建;1:完工 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
permiss_start_date as "permissStartDate", <!-- 准许开工日期 -->
start_date as "startDate", <!-- 开工日期 -->
end_date as "endDate", <!-- 完工日期 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC001 WHERE 1=1
<include refid="customCondition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc
</isEmpty>
</dynamic>
</select>
<include refid="column"/>
FROM ${hggpSchema}.HGSC001 WHERE 1=1
<include refid="customCondition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC001 WHERE 1=1
......
package com.baosight.hggp.hg.sc.tools;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hggp.common.*;
import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.CheckStatusEnum;
import com.baosight.hggp.common.ComputeTypeEnum;
import com.baosight.hggp.common.HandleStatusEnum;
import com.baosight.hggp.common.ProductTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
......@@ -13,18 +16,37 @@ import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.*;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.domain.HGSC004B;
import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.domain.HGSC006;
import com.baosight.hggp.hg.sc.domain.HGSC006A;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.domain.HGSC009;
import com.baosight.hggp.hg.sc.domain.HGSC009A;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.hg.zl.tools.HGZLTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.DateUtil;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.FileUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
......@@ -33,12 +55,24 @@ import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors;
import static com.baosight.hggp.common.AssignStatusEnum.*;
import cn.hutool.core.bean.BeanUtil;
import static com.baosight.hggp.common.AssignStatusEnum.ASSIGNED;
import static com.baosight.hggp.common.AssignStatusEnum.PARTIAL_ASSIGN;
import static com.baosight.hggp.common.AssignStatusEnum.UNASSIGN;
import static java.math.BigDecimal.ROUND_DOWN;
/**
......@@ -196,18 +230,34 @@ public class HGSCTools {
*/
public static class Hgsc001 {
/**
*
* @param code
* @return
*/
public static HGSC001 queryByCode(String code) {
AssertUtils.isNull(code, "项目Code不能为空!");
List<HGSC001> results = DaoBase.getInstance().query(HGSC001.QUERY, new HashMap<String,Object>(){
{put("projCode",code);}
});
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
public static HGSC001 getByCode(String code) {
AssertUtils.isNull(code, "项目Code不能为空!");
Map queryMap = new HashMap();
queryMap.put(HGSC001.FIELD_proj_code, code);
List<HGSC001> results = DaoBase.getInstance().query(HgScSqlConstant.HgSc001.GET_BY_CODE, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
*
* @param code
* @return
*/
public static HGSC001 queryByCode(String code) {
AssertUtils.isNull(code, "项目Code不能为空!");
List<HGSC001> results = DaoBase.getInstance().query(HGSC001.QUERY, new HashMap<String, Object>() {
{
put("projCode", code);
}
});
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* @param projCodes
......@@ -421,7 +471,7 @@ public class HGSCTools {
pz005.setCoefficient(hgsc004a.getCoefficient());
pz005.setUnit(hgsc004a.getUnit());
pz005.setStatus(1); //默认启用
HGPZTools.HgPz005.jointSpec(pz005);
DaoUtils.insert(HGPZ005.INSERT,pz005);
}
hgsc004a.setProductId(pz005.getId());
......
......@@ -68,6 +68,8 @@ public class HGWD001A extends DaoEPBase {
public static final String UPDATE = "HGWD001A.update";
public static final String DELETE = "HGWD001A.delete";
public static final String DELETE_MAT_ID = "HGWD001A.deleteMatId";
public static final String QUERY_DELETE = "HGWD001A.queryDelete";
private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/
......
......@@ -60,6 +60,8 @@ public class HGWD099 extends DaoEPBase {
public static final String INSERT = "HGWD099.insert";
public static final String UPDATE = "HGWD099.update";
public static final String DELETE = "HGWD099.delete";
public static final String DELETE_DOC_ID = "HGWD099.deleteDocId";
private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/
......
......@@ -181,7 +181,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
DaoUtils.update(HGWD001.UPDATE, hgwd001);
}
@OperationLogAnnotation(operModul = "文档库",operType = "发布",operDesc = "发布操作")
@OperationLogAnnotation(operModul = "文档库",operType = "发布",operDesc = "发布附件操作")
public EiInfo updateRelease(EiInfo inInfo){
int i = 0;
try {
......@@ -209,6 +209,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd001a.setChangeContent("发布");
hgwd001a.setChangeStart("V".concat(hgwd001.getDocVersion()+""));
hgwd001a.setChangeEnd("V".concat(hgwd001.getDocVersion()+1+""));
//添加变更记录
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_1);
......@@ -223,7 +224,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "文档库",operType = "修改",operDesc = "文档库-附件清单A-修改附件操作")
@OperationLogAnnotation(operModul = "文档库",operType = "修改",operDesc = "文档库-附件变更-变更附件操作")
public EiInfo updateFile(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
......@@ -258,6 +259,13 @@ public class ServiceHGWD001 extends ServiceEPBase {
return inInfo;
}
/**
* 初始化变更记录
* @param hgwd001 项目信息
* @param hgwd099 附件信息
* @param type 变更类型
* @return HGWD001A 变更记录
*/
public HGWD001A initHgwd001a(HGWD001 hgwd001,HGWD099 hgwd099,String type){
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
......@@ -312,7 +320,12 @@ public class ServiceHGWD001 extends ServiceEPBase {
return inInfo;
}
/**
* 附件变更通知
* @param hgwd001 待变更的项目名称
* @param oldName 变更前附件名称
* @param newName 变更后附件名称
*/
public void interaction(HGWD001 hgwd001,String oldName,String newName){
try {
HGPZ009 hgpz009 = HGPZTools.HgPz009.getByCode(hgwd001.getAccountCode());
......
......@@ -2,12 +2,15 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
......@@ -52,6 +55,7 @@ public class ServiceHGWD002 extends ServiceBase {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, User.FIELD_USER_ID, UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/8/31
* @description 回收站
*/
public class ServiceHGWD004 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),new HashMap<String,Object>(){{
put(Org.FIELD_ORG_TYPE, OrgTypeEnum.COMPANY.getCode());
}});
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD001().eiMetadata);
}catch (Exception e){
LogUtils.setMsg(inInfo,e,"初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
if (block != null) {
String startDate = block.getCellStr(ACConstants.ROW_CODE_0,"createdTimeFrom");
String endDate = block.getCellStr(ACConstants.ROW_CODE_0,"createdTimeTo");
if (!startDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "createdTimeFrom", StringUtil.removeHorizontalLine(startDate));
}
if (!endDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,"createdTimeTo", StringUtil.removeHorizontalLine(endDate));
}
}
return super.query(inInfo, HGWD001A.QUERY_DELETE,new HGWD001A());
}
@OperationLogAnnotation(operModul = "回收站", operType = "删除", operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.fromMap(map);
Iplat4jUtils.deleteFileByDocId(hgwd001a.getChangeStartCode()); //删除物理附件
//删除附件详情
DaoUtils.update(HGWD099.DELETE_DOC_ID,
new HashMap<String,String>(){{
put(HGWD099.FIELD_DOC_ID, hgwd001a.getChangeStartCode());
}}
);
DaoUtils.update(HGWD001A.DELETE, hgwd001a); //删除变更记录
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
LogUtils.setMsg(inInfo, e,"删除失败");
}
return inInfo;
}
}
......@@ -60,7 +60,6 @@ public class ServiceHGWD099 extends ServiceEPBase {
try {
Map queryRow =EiInfoUtils.getFirstRow(inInfo);
if (StringUtils.isNotEmpty(queryRow.get(HGWD001.FIELD_FILE_ID).toString())){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, User.FIELD_USER_ID, UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HGWD099.QUERY, new HGWD099());
}
} catch (Throwable e) {
......@@ -125,7 +124,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
for (Map resultRow : resultRows) {
HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow);
DaoUtils.update(HGWD099.DELETE, hgdm099);
DaoUtils.update(HGWD099.DELETE, hgdm099); //逻辑删除
HGWD001 hgwd001 = HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
......
......@@ -30,6 +30,7 @@
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......
......@@ -72,7 +72,7 @@
CHANGE_TYPE = #changeType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeContent">
CHANGE_CONTENT = #changeContent#
CHANGE_CONTENT like concat('%',#changeContent#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeStartCode">
CHANGE_START_CODE = #changeStartCode#
......@@ -255,4 +255,42 @@
ID = #id#
</update>
<select id="queryDelete" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.wd.domain.HGWD001A">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CHANGE_TYPE as "changeType", <!-- 变更类型 -->
CHANGE_CONTENT as "changeContent", <!-- 变更内容 -->
CHANGE_START_CODE as "changeStartCode",
CHANGE_START as "changeStart", <!-- 变更前 -->
CHANGE_END_CODE as "changeEndCode",
CHANGE_END as "changeEnd", <!-- 变更后 -->
MAT_ID as "matId"
FROM ${hggpSchema}.HGWD001A WHERE 1=1 and CHANGE_TYPE IN ('uploadUpdate','uploadDelete')
<include refid="BaseCondition.createdTimeCondition"/>
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -13,8 +13,8 @@
A.FILE_ID as "fileId", <!-- 文件ID -->
A.FILE_TYPE as "fileType", <!-- 文件类型 -->
A.FILE_NAME as "fileName", <!-- 文件名称 -->
A.DOC_VERSION as "docVersion", <!-- 文件版本号 -->
A.RELEASE_DATE as "releaseDate", <!-- 发布时间 -->
B.DOC_VERSION as "docVersion", <!-- 文件版本号 -->
B.RELEASE_DATE as "releaseDate", <!-- 发布时间 -->
B.DOC_ID as "docId", <!-- 文件号 -->
B.DOC_NAME as "docName", <!-- 文件附件名称 -->
B.PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
......@@ -23,6 +23,7 @@
<sql id="condition">
AND A.DELETE_FLAG = 0
AND B.DELETE_FLAG = 0
AND B.BIZ_TYPE = 'WD'
<include refid="HGXSDataAuth.authConditionA"/>
<isNotEmpty prepend=" AND " property="id">
......@@ -52,6 +53,9 @@
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
B.BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId# and FILE_ID = #parentId# )
</isNotEmpty>
</sql>
<sql id="orderBy">
......@@ -69,7 +73,7 @@
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGWD001 A
INNER JOIN ${hggpSchema}.HGCW999 B ON A.ID = B.MAT_ID
INNER JOIN ${hggpSchema}.HGWD099 B ON A.FILE_ID = B.BIZ_ID
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
......@@ -78,7 +82,7 @@
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGWD001 A
INNER JOIN ${hggpSchema}.HGCW999 B ON A.ID = B.MAT_ID
INNER JOIN ${hggpSchema}.HGWD099 B ON A.FILE_ID = B.BIZ_ID
WHERE 1=1
<include refid="condition"/>
</select>
......
......@@ -35,9 +35,9 @@
<isNotEmpty prepend=" AND " property="bizId">
BIZ_ID = #bizId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId">
<!--<isNotEmpty prepend=" AND " property="fileId">
BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId# and FILE_ID = #fileId# )
</isNotEmpty>
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
......@@ -50,6 +50,9 @@
<isNotEmpty prepend=" AND " property="releaseDate">
RELEASE_DATE = #releaseDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
BIZ_ID = #parentId#
</isNotEmpty>
</sql>
<sql id="customCondition">
......@@ -125,6 +128,10 @@
WHERE ID = #id#
</delete>
<delete id="deleteDocId">
DELETE FROM ${hggpSchema}.HGWD099 WHERE DOC_ID = #docId#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD099
SET
......
......@@ -150,34 +150,34 @@ public class ServiceHGXSOrg extends ServiceBase {
private void syncDcDeptData(String accountCode) throws IOException, InstantiationException, IllegalAccessException {
int pageIndex = 1;
Pager<DcDeptList> pager = DcOpenApi.deptList(pageIndex);
List<DcDeptList> zbDepts = pager.getData();
if (CollectionUtils.isEmpty(zbDepts)) {
List<DcDeptList> dcDeptLists = pager.getData();
if (CollectionUtils.isEmpty(dcDeptLists)) {
return;
}
// 写入合同数据
syncDcDeptData(accountCode, zbDepts);
syncDcDeptData(accountCode, dcDeptLists);
}
/**
* 写入部门信息
*
* @param accountCode
* @param zbDepts
* @param dcDeptLists
*/
private void syncDcDeptData(String accountCode, List<DcDeptList> zbDepts) {
private void syncDcDeptData(String accountCode, List<DcDeptList> dcDeptLists) {
// 查询帐套信息
HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(accountCode);
for (DcDeptList zbDept : zbDepts) {
String orgId = dbPz009.getLoginPrefix() + zbDept.getNodeId();
for (DcDeptList dcDeptList : dcDeptLists) {
String orgId = dbPz009.getLoginPrefix() + dcDeptList.getNodeId();
Org dbOrg = HGXSTools.XsOrg.get(orgId);
if (dbOrg == null) {
dbOrg = new Org();
dbOrg.setOrgId(orgId);
this.syncDcDeptAdd(accountCode, zbDept, dbOrg, dbPz009);
this.syncDcDeptAdd(accountCode, dcDeptList, dbOrg, dbPz009);
} else {
Map updateMap = new HashMap();
updateMap.put(Org.FIELD_ORG_ID, orgId);
updateMap.put(Org.FIELD_ORG_CNAME, zbDept.getNodeText());
updateMap.put(Org.FIELD_ORG_CNAME, dcDeptList.getNodeText());
updateMap.put(Org.FIELD_REC_REVISOR, "System");
updateMap.put(Org.FIELD_REC_REVISE_TIME, DateUtils.shortDateTime());
updateMap.put(Org.FIELD_IS_DELETED, DeleteFlagEnum.UN_REMOVE.getCode().toString());
......@@ -194,16 +194,16 @@ public class ServiceHGXSOrg extends ServiceBase {
* @param dbOrg
* @param dbPz009
*/
private void syncDcDeptAdd(String accountCode, DcDeptList zbDept, Org dbOrg, HGPZ009 dbPz009) {
private void syncDcDeptAdd(String accountCode, DcDeptList dcDeptList, Org dbOrg, HGPZ009 dbPz009) {
String orgId = dbOrg.getOrgId();
dbOrg.setAccountCode(accountCode);
dbOrg.setOrgEname(orgId);
dbOrg.setOrgCname(zbDept.getNodeText());
dbOrg.setOrgCname(dcDeptList.getNodeText());
dbOrg.setOrgType(OrgTypeEnum.DEPT.getCode());
dbOrg.setParentOrgId("-1".equals(zbDept.getParentId())
? accountCode : dbPz009.getLoginPrefix() + zbDept.getParentId());
dbOrg.setParentOrgId("-1".equals(dcDeptList.getParentId())
? accountCode : dbPz009.getLoginPrefix() + dcDeptList.getParentId());
dbOrg.setEstablishDate("20240101");
dbOrg.setSortIndex(zbDept.getFullSort());
dbOrg.setSortIndex(dcDeptList.getFullSort());
dbOrg.setCompanyCode(accountCode);
dbOrg.setCompanyName(dbPz009.getAccountName());
dbOrg.setRecCreator("System");
......
......@@ -238,12 +238,12 @@ public class ServiceHGXSUser extends ServiceBase {
break;
}
Pager<DcUserList> pager = DcOpenApi.userList(pageIndex);
List<DcUserList> zbUsers = pager.getData();
if (CollectionUtils.isEmpty(zbUsers) || pageIndex > pager.getTotalPages()) {
List<DcUserList> dcUserLists = pager.getData();
if (CollectionUtils.isEmpty(dcUserLists) || pageIndex > pager.getTotalPages()) {
break;
}
// 写入合同数据
syncDcUserData(accountCode, zbUsers);
syncDcUserData(accountCode, dcUserLists);
pageIndex++;
}
}
......@@ -252,14 +252,14 @@ public class ServiceHGXSUser extends ServiceBase {
* 写入用户信息
*
* @param accountCode
* @param ZbUserLists
* @param dcUserLists
*/
private void syncDcUserData(String accountCode, List<DcUserList> ZbUserLists) {
private void syncDcUserData(String accountCode, List<DcUserList> dcUserLists) {
// 查询帐套信息
HGPZ009 dbPz009 = HGPZTools.HgPz009.getByCode(accountCode);
for (DcUserList zbUserList : ZbUserLists) {
for (DcUserList dcUserList : dcUserLists) {
try {
syncDcUserSingle(dbPz009, zbUserList.getOrd());
syncDcUserSingle(dbPz009, dcUserList.getOrd());
} catch (Exception e) {
log.error("同步德诚用户失败:{}", e.getMessage(), e);
}
......@@ -281,7 +281,7 @@ public class ServiceHGXSUser extends ServiceBase {
}
String userId = dbPz009.getLoginPrefix() + ord;
// 判断用户是否存在
User dbUser = HGXSTools.XsUser.get(userId);
User dbUser = HGXSTools.XsUser.getByLogin(userId);
if (dbUser == null) {
this.syncDcSingleUserAdd(zbUser, dbPz009, userId);
} else {
......@@ -297,8 +297,7 @@ public class ServiceHGXSUser extends ServiceBase {
* @param userId
* @throws Exception
*/
private void syncDcSingleUserAdd(DcUser zbUser, HGPZ009 dbPz009, String userId)
throws Exception {
private void syncDcSingleUserAdd(DcUser zbUser, HGPZ009 dbPz009, String userId) throws Exception {
// 新增用户
HGXSTools.XsUser.addUser(dbPz009.getAccountCode(), userId, zbUser.getName(), zbUser.getSex(), zbUser.getEmail(),
zbUser.getCardid());
......
......@@ -57,8 +57,7 @@
SELECT
<include refid="column"/>
FROM ${platSchema}.TXSOG01
WHERE 1=1
AND ORG_ID = #orgId#
WHERE ORG_ID = #orgId#
</select>
<!-- 查询组织信息 -->
......
......@@ -2,6 +2,16 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGXSUser">
<sql id="column">
USER_ID as "userId", <!-- 用户id -->
USER_NAME as "userName", <!-- 用户名 -->
LOGIN_NAME as "loginName", <!-- 登录id -->
GENDER as "gender", <!-- 性别 -->
MOBILE as "mobile", <!-- 手机号 -->
EMAIL as "email", <!-- 邮箱 -->
ACCOUNT_CODE as "accountCode" <!-- 企业编码 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="loginName">
LOGIN_NAME = #loginName#
......@@ -21,15 +31,17 @@
</sql>
<!-- 查询用户信息 -->
<select id="getByLogin" resultClass="com.baosight.hggp.hg.xs.domain.User">
SELECT
<include refid="column"/>
FROM ${platSchema}.XS_USER
WHERE LOGIN_NAME = #loginName#
</select>
<!-- 查询用户信息 -->
<select id="query" resultClass="com.baosight.hggp.hg.xs.domain.User">
SELECT
USER_ID as "userId", <!-- 用户id -->
USER_NAME as "userName", <!-- 用户名 -->
LOGIN_NAME as "loginName", <!-- 登录id -->
GENDER as "gender", <!-- 性别 -->
MOBILE as "mobile", <!-- 手机号 -->
EMAIL as "email", <!-- 邮箱 -->
ACCOUNT_CODE as "accountCode" <!-- 企业编码 -->
<include refid="column"/>
FROM ${platSchema}.XS_USER
WHERE 1=1
<include refid="condition"/>
......
......@@ -121,11 +121,11 @@ public class HGXSTools {
*
* @return
*/
public static User get(String loginName) {
public static User getByLogin(String loginName) {
AssertUtils.isEmpty(loginName, "用户登录名不能为空");
Map paramMap = new HashMap();
paramMap.put("loginName", loginName);
List<User> results = DaoBase.getInstance().query(HGSqlConstant.HgXsUser.QUERY, paramMap);
List<User> results = DaoBase.getInstance().query(HGSqlConstant.HgXsUser.GET_BY_LOGIN, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
......
......@@ -96,6 +96,7 @@
<!-- 文档库 -->
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD001A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD099.xml"/>
......
......@@ -43,7 +43,7 @@
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="100" align="center"
required="true">
copy="true" required="true">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" required="true"/>
......
......@@ -55,6 +55,10 @@
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="bcReceiveQty" cname="本次</br>收货数量" width="100" align="right" format="{0:N3}"
required="true"/>
<EF:EFColumn ename="bcMaxReceiveQty" cname="本次最大</br>收货数量" enable="false" width="100" align="right"
......@@ -84,10 +88,7 @@
sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right"
format="{0:C3}" sumType="page"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
......
......@@ -108,7 +108,6 @@ $(function () {
//系数
let coefficient = inventRecordBoxBlockId[i]['param10Field']
calUnitWeight(e.items[0],e.items[0].length,e.items[0].width,e.items[0].thick,coefficient);
break
}
}
......
......@@ -49,12 +49,13 @@
sumType="page"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<EF:EFColumn ename="receiveUnitWeight" cname="收货单重" enable="false" width="120" align="right"
format="{0:N3}"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="false" width="120" align="center">
<EF:EFColumn ename="receiveUnitWeight" cname="收货单重" width="120" align="right" format="{0:N3}"
required="true"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" width="120" align="center" required="true"
copy="true">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" enable="false" width="120" align="right" format="{0:C3}"/>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:C3}" required="true"/>
<EF:EFColumn ename="amount" cname="金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
......
......@@ -22,6 +22,10 @@ $(function() {
let auditStatus = item.status;
let template = '';
if (item.id) {
if (item.deliveryCode){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="detailFunc(' + item.id + ',\'' + item.deliveryCode + '\')">扣款明细</a>';
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')" >附件上传</a>';
}
......@@ -41,7 +45,16 @@ $(function() {
init: function (e, options) {
console.log(e);
},
},
},{
field: "signingDate",
editor: "date",
init: function (e, options) {
console.log(e);
},
defaultValue: function (e, options) {
return currDate()
},
}
],
onSave: function (e) {
......@@ -58,6 +71,7 @@ $(function() {
loadComplete: function (e) {
$("#BTN_SUBMIT").on("click",submitFunc);
$("#BTN_SELECT").on("click",selectFunc)
},
onSuccess: function (e) {
......@@ -68,15 +82,7 @@ $(function() {
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
downKeyUp();
});
$(window).load(function () {
......@@ -275,4 +281,49 @@ function fileDetailFunc(id) {
width: "80%",
height: "80%",
});
}
/**
* 选择发货单
*/
function selectFunc() {
JSColorbox.open({
href: "HGCW005B?methodName=initLoad",
title: "<div style='text-align: center;'>选择发货单</div>",
width: "80%",
height: "80%",
callbackName: windowCallback
});
}
/**
*
* @param deliveryCode 发货单
*/
function detailFunc(id,deliveryCode) {
/*let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
if (rows[0].reviewStatus == "3") {
message("已经审核的单据不能修改");
return;
}*/
JSColorbox.open({
href: "HGCW005A?methodName=initLoad&inqu_status-0-parentId=" + id + "&inqu_status-0-deliveryCode=" + deliveryCode + "&efParentFormEname=HGCW005",
title: "<div style='text-align: center;'>扣款明细</div>",
width: "80%",
height: "80%",
callbackName: windowCallback
});
}
function windowCallback(ei) {
if (ei.getStatus() >= 0) {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}
\ No newline at end of file
......@@ -23,6 +23,7 @@
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="主合同名称" ename="contractName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput blockId="inqu_status" row="0" ename="deliveryCode" cname="发货单号" colWidth="3"/>
<EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
......@@ -33,18 +34,17 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="150" align="center"/>
<EF:EFColumn ename="companyName" cname="所属公司" width="120" enable="false" readonly="true" align="center"/>
<EF:EFPopupColumn ename="projCode" cname="项目编号" width="200"
serviceName="HGCW002" methodName="projectComboBox"
resultId="projcet_combo_box" popupType="ServiceGrid"
valueField="projCode" textField="projCode"
columnEnames="projCode,projName,contractNumber,contractName,partyA,partyB"
columnCnames="项目编码,项目名称,合同号,合同名称,甲方名称,乙方名称"
backFillColumnIds="projCode,projName,contractNumber,contractName,partyA,partyB"
backFillFieldIds="projCode,projName,contractNumber,contractName,partyA,partyB"
popupTitle="所属公司" popupWidth="800">
</EF:EFPopupColumn>
<EF:EFPopupColumn ename="projCode" cname="项目编号" width="200"
serviceName="HGCW002" methodName="projectComboBox"
resultId="projcet_combo_box" popupType="ServiceGrid"
valueField="projCode" textField="projCode"
columnEnames="projCode,projName,contractNumber,contractName,partyA,partyB"
columnCnames="项目编码,项目名称,合同号,合同名称,甲方名称,乙方名称"
backFillColumnIds="projCode,projName,contractNumber,contractName,partyA,partyB"
backFillFieldIds="projCode,projName,contractNumber,contractName,partyA,partyB"
popupTitle="所属公司" popupWidth="800"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractNumber" cname="主合同号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractName" cname="主合同名称" width="120" enable="false" readonly="true" align="center"/>
......@@ -54,6 +54,7 @@
<EF:EFColumn ename="totalContractPriceIncluding" cname="扣款金额" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="signingDate" cname="扣款日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="deliveryCode" cname="发货单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
......
$(function() {
var companyBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var projCodeBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var inventTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
var inventCodedBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
var specIdBox = __eiInfo.getBlock("spec_box_block_id").getMappedRows();
var customerAllBox = __eiInfo.getBlock("customer_record_all_block_id").getMappedRows();
var whRecordBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "companyCode",
template: function (row) {
for (let i = 0; i < companyBox.length; i++) {
if (companyBox[i]['companyCode'] === row['companyCode']){
row['inventName'] = companyBox[i]['companyName']
return companyBox[i]['companyName'];
}
}
return row["companyCode"];
}
}, {
field: "projCode",
title: "存货名称",
template: function (row) {
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]['valueField'] === row['projCode']){
row['projName'] = projCodeBox[i]['textField']
return projCodeBox[i]['textField'];
}
}
return row["projCode"];
}
}, {
field: "receCode",
template: function (row) {
for (let i = 0; i < customerAllBox.length; i++) {
if (customerAllBox[i]['valueField'] === row['receCode']){
row['receName'] = customerAllBox[i]['textField']
return customerAllBox[i]['textField'];
}
}
return row["receCode"];
}
}, {
field: "inventCode",
template: function (row) {
for (let i = 0; i < inventCodedBox.length; i++) {
if (inventCodedBox[i]['valueField'] === row['inventCode']){
row['inventName'] = inventCodedBox[i]['textField']
return inventCodedBox[i]['textField'];
}
}
return row["inventCode"];
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "quantity"){
for (let i = 0; i < e.items.length; i++) {
let quantity = e.items[i]["quantity"];
let unitWeight = e.items[i]["unitWeight"];
let weight = quantity*unitWeight;
resultGrid.setCellValue(e.items[i],"weight",weight);
$("#inqu_status-0-consQuantity_textField").val(quantity)
$("#inqu_status-0-consQuantity").val(quantity)
$("#inqu_status-0-consWeight_textField").val(weight)
$("#inqu_status-0-consWeight").val(weight)
}
}
});
},
onSuccess: function (e) {
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function(e) {
},
}
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let inventType= item.get("inventType");
let inventCode= item.get("inventCode");
let spec= item.get("spec");
let quantity= item.get("quantity");
if(isBlank(inventType)){
message("选中的第" + (index + 1) + "行\"存货类型\",不能为空!");
flag = false;
return false;
}
if(isBlank(inventCode)){
message("选中的第" + (index + 1) + "行\"存货编码\",不能为空!");
flag = false;
return false;
}
if(isBlank(spec)){
message("选中的第" + (index + 1) + "行\"规格\",不能为空!");
flag = false;
return false;
}
if(isBlank(quantity) || parseInt(quantity) <= 0){
message("选中的第" + (index + 1) + "行\"数量\",必须是数值并且数量必须大于0!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW005A", "save", true);
}
});
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/31
Time: 12:11
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="扣款单明细s">
<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:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deliveryCode" cname="发货单号" readonly="true" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="receName" cname="收货方" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" autoBind="true" queryMethod="query">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" enable="true" cname="公司名称" width="200" align="center"
filter="contains" readonly="true" required="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projCode" cname="所属项目" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="160" required="true"
align="center" filter="contains" sort="true"/>
<EF:EFColumn ename="deliveryCode" cname="发货单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="receCode" cname="收货方" enable="true" width="160" required="true"
blockName="customer_record_all_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
maxLength="16" readonly="true" align="center" filter="contains" sort="true"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="扣款金额" width="120" enable="true" align="center" required="true"/>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" required="true"
filter="contains"/>
<EF:EFColumn ename="spec" cname="规格" width="140" align="center" maxLength="50"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="weight" cname="重量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
var companyBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var projCodeBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var inventTypeBox = __eiInfo.getBlock("invent_type_box_block_id").getMappedRows();
var inventCodedBox = __eiInfo.getBlock("invent_code_box_block_id").getMappedRows();
var specIdBox = __eiInfo.getBlock("spec_box_block_id").getMappedRows();
var customerAllBox = __eiInfo.getBlock("customer_record_all_block_id").getMappedRows();
var whRecordBox = __eiInfo.getBlock("wh_record_box_block_id").getMappedRows();
// 查询
$("#QUERY").on("click", query);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "companyCode",
template: function (row) {
for (let i = 0; i < companyBox.length; i++) {
if (companyBox[i]['companyCode'] === row['companyCode']){
row['inventName'] = companyBox[i]['companyName']
return companyBox[i]['companyName'];
}
}
return row["companyCode"];
}
}, {
field: "projCode",
template: function (row) {
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]['valueField'] === row['projCode']){
row['projName'] = projCodeBox[i]['textField']
return projCodeBox[i]['textField'];
}
}
return row["projCode"];
}
}, {
field: "receCode",
template: function (row) {
for (let i = 0; i < customerAllBox.length; i++) {
if (customerAllBox[i]['valueField'] === row['receCode']){
row['receName'] = customerAllBox[i]['textField']
return customerAllBox[i]['textField'];
}
}
return row["receCode"];
}
}, {
field: "inventCode",
template: function (row) {
for (let i = 0; i < inventCodedBox.length; i++) {
if (inventCodedBox[i]['valueField'] === row['inventCode']){
row['inventName'] = inventCodedBox[i]['textField']
return inventCodedBox[i]['textField'];
}
}
return row["inventCode"];
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "quantity"){
for (let i = 0; i < e.items.length; i++) {
let quantity = e.items[i]["quantity"];
let unitWeight = e.items[i]["unitWeight"];
let weight = quantity*unitWeight;
resultGrid.setCellValue(e.items[i],"weight",weight);
$("#inqu_status-0-consQuantity_textField").val(quantity)
$("#inqu_status-0-consQuantity").val(quantity)
$("#inqu_status-0-consWeight_textField").val(weight)
$("#inqu_status-0-consWeight").val(weight)
}
}
});
},
onSuccess: function (e) {
},
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function(e) {
},
}
downKeyUp();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let totalContractPriceIncluding= item.get("totalContractPriceIncluding");
if(isBlank(totalContractPriceIncluding) || parseInt(totalContractPriceIncluding) <= 0){
message("选中的第" + (index + 1) + "行\"扣款金额\",必须是数值并且数量必须大于0!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW005A", "save", true,
function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback(e);
}
});
}
});
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/31
Time: 14:36
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<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:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deliveryCode" cname="发货单号" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="receName" cname="收货方" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" enable="false" cname="公司名称" width="200" align="center"
filter="contains" readonly="true" required="false">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" enable="false"
maxLength="16" readonly="true" width="160" required="false"
align="center" filter="contains" sort="true"/>
<EF:EFColumn ename="deliveryCode" cname="发货单号" enable="false" width="130" align="center"/>
<EF:EFComboColumn ename="receCode" cname="收货方" enable="false" width="160" required="false"
blockName="customer_record_all_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
maxLength="16" readonly="true" align="center" filter="contains" sort="true"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="扣款金额" width="120" enable="true" align="center" required="true"/>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" required="false"
filter="contains"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="140" align="center" maxLength="50"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}$/" maxLength="20" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="weight" cname="重量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -58,7 +58,7 @@
<EF:EFColumn ename="depositNo" cname="入库单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiveNo" cname="收货单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="true" width="120" align="left" defaultValue=""
filter="contains" required="true">
filter="contains" required="true" copy="true">
<EF:EFOptions blockId="wh_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whName" cname="仓库名称" enable="false" width="100" align="center" hidden="true"/>
......
......@@ -199,11 +199,11 @@ let save = function () {
flag = false;
return false;
}
if(isBlank(spec)){
/*if(isBlank(spec)){
message("选中的第"+(index+1)+"行\"规格\",不能为空!");
flag = false;
return false;
}
}*/
if((isBlank(quantity) || parseInt(quantity) <= 0) && (isBlank(grossAmount) || parseInt(grossAmount) <= 0)){
message("选中的第" + (index + 1) + "行\"数量、重量\",必须有一项大于0!");
flag = false;
......
......@@ -42,28 +42,28 @@
<%-- columnTemplate="#=valueField#" itemTemplate="#=valueField#" readonly="false"--%>
<%-- filter="contains">--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="inventCode" required="true" cname="产品编号" />
<EF:EFColumn ename="inventCode" required="true" cname="产品编号" width="160"/>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="false"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains" enable="false" >
</EF:EFComboColumn>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" required="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" required="true"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" align="right" format="{0:N3}"
defaultValue="0"
<EF:EFColumn ename="material" cname="材质" enable="false" width="120" align="center" required="false"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center" required="false"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N0}" required="false"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N0}" required="false"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N0}" required="false"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" align="right" format="{0:N3}"
defaultValue="0" required="true"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="singleWeight" cname="单重(KG)" width="120" align="right" format="{0:N3}"
defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!" enable="false"/>
<EF:EFColumn ename="grossAmount" cname="总重(KG)" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="grossAmount" cname="总重(KG)" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="remarks" cname="备注" width="150"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
......
......@@ -131,10 +131,10 @@ $(function () {
icon = 'fa fa-user'
break;
case '1':
icon = 'fa fa-folder'
icon = 'fa fa-clipboard'
break;
default :
icon = 'fa fa-clipboard'
icon = 'fa fa-folder'
//icon = 'fa fa-home'
}
}
......@@ -202,7 +202,7 @@ $(function () {
let leafLevel = parseInt($("#inqu_status-0-leafLevel").val())+1;
let type = $("#inqu_status-0-type").val();
if (null == parentId || "" === parentId) {
message( "请在文档库树选择任意节点后新增文档库");
message( "请在文档目录树选择任意节点后新增文档目录");
return
}
/*if (type == "company"){
......@@ -235,7 +235,7 @@ $(function () {
$("#remove").on("click", () => {
const orgId = $("#inqu_status-0-parentId").val()
if (null == orgId || "" === orgId || "root" === orgId) {
message2("文档库", "请在文档库树选择任意节点后删除文档库");
message2("文档库", "请在文档目录树选择任意节点后删除文档目录");
return
}
$("#deleteOrgWindow").data("kendoWindow").center()
......@@ -297,7 +297,7 @@ $(function () {
let leafLevel = parseInt($("#inqu_status-0-leafLevel").val())+1;
let type = $("#inqu_status-0-type").val();
if (null == orgId || "" === orgId || "root" === orgId) {
message2("提示", "请在文档库树选择公司节点后编辑文档库");
message2("提示", "请在文档目录树选择公司节点后编辑文档目录");
return
}
if (type == "1"){
......@@ -471,9 +471,10 @@ $(function () {
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
$("#RELEASE").click("click",updateRelease)
//发布
$("#RELEASE").click("click",updateRelease);
//变更记录
$("#CHANGE_RECORD").on("click", changeResord);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
......@@ -810,8 +811,6 @@ function showPreview() {
/**
* 文件上传
*
* @param id
*/
function uploadFile() {
let lv = $("#inqu_status-0-leafLevel").val();
......@@ -927,7 +926,6 @@ function updateRelease() {
);
}
/**
* 显示授权按钮
*/
......@@ -937,8 +935,31 @@ let showAuthButton = function () {
if (leafType && leafType >0) {
$("#RELEASE").attr("disabled", false);
$("#UPLOAD_FILE").attr("disabled", false);
$("#CHANGE_RECORD").attr("disabled", true);
} else {
$("#RELEASE").attr("disabled", true);
$("#UPLOAD_FILE").attr("disabled", true);
$("#CHANGE_RECORD").attr("disabled", false);
}
}
/**
* 文件上传
*/
function changeResord() {
let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel;
if (isBlank(leafType)){
message("请选择文档目录树节点!");
return;
}
JSColorbox.open({
href: "HGWD001A?methodName=initLoad&inqu_status-0-bizType=WD" +
"&inqu_status-0-projCode=" + $("#inqu_status-0-parentId").val()+"" +
"&inqu_status-0-projName=" + $("#inqu_status-0-fileName").val() +
"&efParentFormEname=HGWD001",
title: "<div style='text-align: center;'>变更记录</div>",
width: "80%",
height: "80%",
callbackName: uploadFileCallback
});
}
\ No newline at end of file
......@@ -14,7 +14,7 @@
<div id="splitter" class="i-fit-height">
<div id="left-pane" class="i-fit-height">
<EF:EFRegion title="文档树" id="tree" fitHeight="true">
<EF:EFRegion title="文档目录树" id="tree" fitHeight="true">
<div class="row" style="display: block">
<div class="col-md-12" style="display:flex;align-items: center">
<%--<EF:EFInput ename="searchText" colWidth="8" inline="true"/>
......
......@@ -4,7 +4,7 @@ $(function () {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSize: 10,
pageSizes: [20, 50, 70, 100],
},
columns: [/*{
......@@ -22,19 +22,19 @@ $(function () {
field: "changeStart",
template: function (item) {
let template = item["changeStart"]
if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete") {
/* if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete") {
template = "";
}
}*/
return template;
}
},{
field: "changeEnd",
template: function (item) {
let template = item["changeEnd"]
if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete") {
/*if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete") {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.changeStart) + '" target="_blank">'+item.changeEnd+'</a>';
}
}*/
return template;
}
}],
......
......@@ -20,11 +20,12 @@
<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" readonly="true">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="projCode" cname="项目编码" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3" readonly="true"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="changeType" cname="变更类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.changeType"/>
......
......@@ -177,7 +177,14 @@ let save = function (btnNode) {
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD001E", "save", true);
JSUtils.submitGridsData("result", "HGWD001E", "save", true,
function (e) {
var status = e.status;
if (status !== -1) {
let parentOrgId = $("#inqu_status-0-parentOrgId").val();
parent.JSColorbox.setValueCallback(parentOrgId);
}
});
btnNode.attr("disabled", false);
}
});
......
......@@ -145,7 +145,15 @@ let save = function (btnNode) {
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD001F", "save", true);
JSUtils.submitGridsData("result", "HGWD001F", "save", true,
function (e) {
var status = e.status;
if (status !== -1) {
let parentOrgId = $("#inqu_status-0-parentOrgId").val();
parent.JSColorbox.setValueCallback(parentOrgId);
}
}
);
btnNode.attr("disabled", false);
}
});
......
$(function () {
const init = () => {
$("#HGWD002").css("padding-bottom", "8px")
sessionStorage.removeItem("__user_id__")
setTimeout(() => {
let parendId = $("inqu_status-0-parentId").val();
if (!isBlank(parendId)){
resultGrid.dataSource.page(1);
}
// 显示授权按钮
showAuthButton();
}, 1000);
// 查询
$("#QUERY").on("click", function (e) {
resultGrid.dataSource.page(1);
});
// 分割线组件
(function () {
splitter = $("#splitter").kendoSplitter({
panes: [
{size: "30%", min: "25%", max: "75%", collapsible: true},
{},
{collapsible: true}
]
}).data("kendoSplitter");
// 当 EFRegion 的 fitHeight="true" 时,需要为 splitter 中的 k-splitbar 加上 class="i-fit-height"。
$("#splitter").find(".k-splitbar").addClass("i-fit-height");
//加下面的延迟是为了处理 多界面同时刷新 界面展示不全的问题
var interval01 = setInterval(splitterInterval, 200);
function splitterInterval() {
if (document.getElementById("splitter").getElementsByClassName("k-splitbar").length !== 1) {
$("#splitter").kendoSplitter({
panes: [
{size: "30%", min: "25%", max: "75%", collapsible: true},
{},
{collapsible: true}
]
});
} else {
clearInterval(interval01);
}
}
})();
// 抽屉组件
(function () {
$(".close-btn span").on("click", function () {
closeDrawer()
})
function closeDrawer() {
$(".drawer-wrapper").css("transform", "translateX(-100%)");
// 重置splitter
splitter.collapse(".k-pane:first")
splitter.expand(".k-pane:first")
}
function openDrawer(url, userId) {
$(".drawer-wrapper").css("transform", "translateX(0%)");
const lastId = sessionStorage.getItem("__user_id__")
if (lastId !== userId) {
sessionStorage.setItem("__user_id__", userId);
}
if ($(".drawer-wrapper iframe").attr("src") === '') {
$(".drawer-wrapper iframe").attr("src", url)
}
refreshUserDetail();
function refreshUserDetail() {
if ($("#iframeDrawer")?.get(0)?.contentWindow?.refreshWindow) {
$("#iframeDrawer").get(0).contentWindow.refreshWindow()
return
}
setTimeout(() => {
refreshUserDetail();
}, 50)
}
}
window.closeDrawer = closeDrawer;
window.openDrawer = openDrawer;
})();
}
init();
IPLATUI.EFTree = {
"docTree": {
select: function (e) {
var _data = this.dataItem(e.node);
var labelValue = _data.label;
var typeValue = _data.type;
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-companyCode']").val(_data.companyCode);
$("[name = 'inqu_status-0-type']").val(typeValue);
$("[name = 'inqu_status-0-fileName']").val(_data.text);
resultGrid.dataSource.page(1);
// 显示授权按钮
showAuthButton();
},
/*ROOT:{label: 'root',text: '组织机构'},*/
template: function (node) {
var item = node.item;
var title = item.text;
let icon = 'fa fa-globe'
if (item.label !== 'root') {
switch (item.type) {
case 'company':
// title = title + ' [公司]';
icon = 'fa fa-building'
break;
case 'dept':
// title = title + ' [部门]';
icon = 'fa fa-users'
break;
case 'post':
// title = title + ' [岗位]';
icon = 'fa fa-user'
break;
case '1':
icon = 'fa fa-clipboard'
break;
default :
icon = 'fa fa-folder'
//icon = 'fa fa-home'
}
}
return ' <span class="' + icon + '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label + '">' + title + '</span>'
},
loadComplete: function (options) {
},
selectTreeNode: {
fileId: '',
parentId: '',
projCode: '',
companyCode: '',
leafLevel: '',
type: '',
},
// expandLevel:1,
/**
* 开启结点拖拽功能,默认dragAndDrop = false不开启,
* 若未开启拖拽,不会触发dragstart和dragend事件
*/
dragAndDrop: false,
}
};
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
......@@ -22,7 +180,7 @@ $(function () {
}, {
field: "docVersion",
template: function (model) {
return "v" + model.docVersion;
return "V" + model.docVersion;
}
}],
loadComplete: function (grid) {
......@@ -46,7 +204,7 @@ $(function () {
*/
$(window).load(function () {
// 查询
query();
//query();
// 按键事件
downKeyUp();
});
......@@ -139,3 +297,32 @@ let download = function () {
}
});
}
/**
* 设置树节点的值
*
* @param nodeData
*/
let setTreeNodeValue = function (nodeData) {
IPLATUI.EFTree.docTree.selectTreeNode.fileId = nodeData.label;
IPLATUI.EFTree.docTree.selectTreeNode.parentId = nodeData.parentId;
IPLATUI.EFTree.docTree.selectTreeNode.fileName = nodeData.text;
IPLATUI.EFTree.docTree.selectTreeNode.companyCode = nodeData.companyCode;
IPLATUI.EFTree.docTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.docTree.selectTreeNode.leafLevel = nodeData.leafLevel;
}
/**
* 显示授权按钮
*/
let showAuthButton = function () {
let leafType = IPLATUI.EFTree.docTree.selectTreeNode.leafLevel;
// C:目录
if (leafType && leafType >0) {
$("#PREVIEW").attr("disabled", false);
$("#DOWNLOAD").attr("disabled", false);
} else {
$("#PREVIEW").attr("disabled", true);
$("#DOWNLOAD").attr("disabled", true);
}
}
\ No newline at end of file
......@@ -6,37 +6,45 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="文档浏览">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="公司名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="文件类型" ename="fileType" blockId="inqu_status" row="0" colWidth="3" optionLabel="全部"
defultValue="">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
<div id="splitter" class="i-fit-height">
<div id="left-pane" class="i-fit-height">
<EF:EFRegion title="文档目录树" id="tree" fitHeight="true">
<div id="menu" style="margin-top: 12px; margin-bottom: 8px">
<EF:EFTree bindId="docTree" ename="tree_name" textField="text" valueField="label"
hasChildren="leaf" pid="parentId"
serviceName="HGWD001D" methodName="query">
</EF:EFTree>
</div>
</EF:EFRegion>
</div>
</EF:EFRegion>
<div id="right-pane" class="i-fit-height">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="公司代码" ename="companyCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库名称" ename="fileName" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" width="160" enable="false" align="center"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="left"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="140" align="left"/>
<EF:EFColumn ename="fileId" cname="文件ID" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="fileType" cname="文件类型" enable="false" width="90" align="center">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="fileName" cname="文件名" enable="false" width="100" align="left"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="docId" cname="附件ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="100" align="left"/>
<EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right"/>
<EF:EFColumn ename="downloadNum" cname="下载次数" enable="false" width="100" align="right"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="no" personal="true" queryMethod="query">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="fileId" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right"/>
<EF:EFColumn ename="downloadNum" cname="下载次数" enable="false" width="100" align="right"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
</EF:EFPage>
$(function () {
$(".row").children().attr("class", "col-md-3");
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [
{
field: "changeStartCode",
template: function (item) {
let template = item["changeStartCode"]
/*if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete" || item.changeType == "uploadUpdate") {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.changeStartCode) + '" target="_blank">'+item.changeStart+'</a>';
}*/
return template;
}
}
],
loadComplete: function (grid) {},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
}
}
// 查询
$("#QUERY").on("click", query);
$("#BATCH_DOWNLOAD").on("click", download); //批量下载
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
// 按键事件
downKeyUp();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 下载
*/
let download = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
window.open(downloadHref(rows[i]['changeStartCode']), '_blank');
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD004", "delete", true,
function (e) {
if (e.getStatus() != -1){
query();
}
});
}
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/31
Time: 20:30
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ 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" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<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="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFDateSpan startCname="删除开始日期" endCname="删除结束日期" blockId="inqu_status" row="0" colWidth="3"
startName="createdTimeFrom" endName="createdTimeTo" role="date"
format="yyyy-MM-dd" satrtRatio="4:8" endRatio="4:8"/>
<EF:EFInput blockId="inqu_status" row="0" ename="changeContent" cname="文件名称" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="160" required="false"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="projName" cname="项目名称" width="160" enable="true" readonly="false" align="left" required="false"/>
<EF:EFColumn ename="changeContent" cname="文件名称" width="160" enable="true" readonly="true" align="center" required="false"/>
<EF:EFColumn ename="changeStartCode" cname="附件ID" width="160" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="changeStart" cname="附件名称" width="160" enable="true" readonly="true" align="center" required="false"/>
<EF:EFColumn ename="createdName" cname="删除人" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn ename="createdTime" cname="删除时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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