Commit 9a774d2c by 宋祥

Merge branch 'dev' of http://129.211.46.84:8800/platform/hg-smart into dev-sx

parents aad7b2a3 59fdd571
......@@ -11,6 +11,7 @@ public enum ChangeTypeEnum {
UPDATE("update", "修改"),
DELETE("delete", "删除"),
UPLOAD_ADD("uploadAdd", "附件添加"),
UPLOAD_UPDATE("uploadUpdate", "附件变更"),
UPLOAD_DELETE("uploadDelete", "附件删除"),
RELEASE("release", "发布"),
;
......
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 -> {
......
package com.baosight.hggp.hg.cg.constant;
/**
* @author:songx
* @date:2024/8/30,15:53
*/
public class HgCgConst {
/**
* 计算方式
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class CalculationMethod {
// 数量计算
public static final Integer S0 = 0;
// 重量计算
public static final Integer S1 = 1;
}
}
......@@ -58,6 +58,7 @@ public class HGCG001A extends DaoEPBase {
public static final String FIELD_REMARKS = "remarks"; /*备注*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_CALCULATION_METHOD = "calculationMethod"; /* 计算方式 0-数量乘单价 1-重量乘单价*/
//页面展示
public static final String FIELD_SOURCE = "source"; /* 数据来源 根据采购数据来源小代码 目前默认0材料计划,1手工录入*/
......@@ -143,6 +144,7 @@ public class HGCG001A extends DaoEPBase {
private String remarks; /*备注*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private Integer calculationMethod; /* 计算方式 0-数量乘单价 1-重量乘单价*/
//选择合同需要信息
private Integer source; /* 数据来源 根据采购数据来源小代码 目前默认0材料计划,1手工录入*/
......@@ -368,6 +370,10 @@ public class HGCG001A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CALCULATION_METHOD);
eiColumn.setDescName("计算方式 0-数量乘单价 1-重量乘单价");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -969,7 +975,15 @@ public class HGCG001A extends DaoEPBase {
public void setProjName(String projName) {
this.projName = projName;
}
public Integer getCalculationMethod() {
return calculationMethod;
}
public void setCalculationMethod(Integer calculationMethod) {
this.calculationMethod = calculationMethod;
}
/**
* get the value from Map.
*
......@@ -1013,6 +1027,7 @@ public class HGCG001A extends DaoEPBase {
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setCalculationMethod(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CALCULATION_METHOD)), calculationMethod));
setSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SOURCE)), source));
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
......@@ -1066,6 +1081,7 @@ public class HGCG001A extends DaoEPBase {
map.put(FIELD_REMARKS,StringUtils.toString(remarks, eiMetadata.getMeta(FIELD_REMARKS)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_CALCULATION_METHOD, StringUtils.toString(calculationMethod, eiMetadata.getMeta(FIELD_CALCULATION_METHOD)));
map.put(FIELD_SOURCE, StringUtils.toString(source, eiMetadata.getMeta(FIELD_SOURCE)));
map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE)));
......
......@@ -63,6 +63,8 @@ public class HGCG002B extends DaoEPBase {
//页面需要展示
public static final String FIELD_BC_RECEIVE_QTY = "bcReceiveQty"; /* 本次收货数量*/
public static final String FIELD_BC_MAX_RECEIVE_QTY = "bcMaxReceiveQty"; /* 本次最大收货数量*/
public static final String FIELD_BC_RECEIVE_WEIGHT = "bcReceiveWeight"; /* 本次收货重量*/
public static final String FIELD_BC_MAX_RECEIVE_WEIGHT = "bcMaxReceiveWeight"; /* 本次最大收货重量*/
public static final String FIELD_CONTRACT_DATE = "contractDate"; /* 合同日期*/
public static final String FIELD_CONTRACT_NO = "contractNo"; /* 合同号*/
public static final String FIELD_PLAN_NO = "planNo"; /* 计划单号*/
......@@ -155,6 +157,8 @@ public class HGCG002B extends DaoEPBase {
//页面需要填写、展示字段
private BigDecimal bcReceiveQty = new BigDecimal(0.000); /* 本次收货数量*/
private BigDecimal bcMaxReceiveQty = new BigDecimal(0.000); /* 本次最大收货数量*/
private BigDecimal bcReceiveWeight = new BigDecimal(0.000); /* 本次收货重量*/
private BigDecimal bcMaxReceiveWeight = new BigDecimal(0.000); /* 本次最大收货重量*/
private String contractDate = " "; /* 合同日期*/
private String contractNo = " "; /* 合同号*/
private String planNo = " "; /* 计划单号*/
......@@ -359,7 +363,22 @@ public class HGCG002B extends DaoEPBase {
eiColumn.setFieldLength(20);
eiColumn.setDescName("本次最大收货数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BC_RECEIVE_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("本次收货重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BC_MAX_RECEIVE_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("本次最大收货重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONTRACT_DATE);
eiColumn.setDescName("合同日期");
eiMetadata.addMeta(eiColumn);
......@@ -956,7 +975,23 @@ public class HGCG002B extends DaoEPBase {
public void setBcMaxReceiveQty(BigDecimal bcMaxReceiveQty) {
this.bcMaxReceiveQty = bcMaxReceiveQty;
}
public BigDecimal getBcReceiveWeight() {
return bcReceiveWeight;
}
public void setBcReceiveWeight(BigDecimal bcReceiveWeight) {
this.bcReceiveWeight = bcReceiveWeight;
}
public BigDecimal getBcMaxReceiveWeight() {
return bcMaxReceiveWeight;
}
public void setBcMaxReceiveWeight(BigDecimal bcMaxReceiveWeight) {
this.bcMaxReceiveWeight = bcMaxReceiveWeight;
}
public String getContractDate() {
return contractDate;
}
......@@ -1101,6 +1136,8 @@ public class HGCG002B extends DaoEPBase {
setBcReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BC_RECEIVE_QTY)), bcReceiveQty));
setBcMaxReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BC_MAX_RECEIVE_QTY)), bcMaxReceiveQty));
setBcReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BC_RECEIVE_WEIGHT)), bcReceiveWeight));
setBcMaxReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BC_MAX_RECEIVE_WEIGHT)), bcMaxReceiveWeight));
setContractDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_DATE)), contractDate));
setContractNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NO)), contractNo));
setPlanNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_NO)), planNo));
......@@ -1158,6 +1195,8 @@ public class HGCG002B extends DaoEPBase {
map.put(FIELD_BC_RECEIVE_QTY, StringUtils.toString(bcReceiveQty, eiMetadata.getMeta(FIELD_BC_RECEIVE_QTY)));
map.put(FIELD_BC_MAX_RECEIVE_QTY, StringUtils.toString(bcMaxReceiveQty, eiMetadata.getMeta(FIELD_BC_MAX_RECEIVE_QTY)));
map.put(FIELD_BC_RECEIVE_WEIGHT, StringUtils.toString(bcReceiveWeight, eiMetadata.getMeta(FIELD_BC_RECEIVE_WEIGHT)));
map.put(FIELD_BC_MAX_RECEIVE_WEIGHT, StringUtils.toString(bcMaxReceiveWeight, eiMetadata.getMeta(FIELD_BC_MAX_RECEIVE_WEIGHT)));
map.put(FIELD_CONTRACT_DATE, StringUtils.toString(contractDate, eiMetadata.getMeta(FIELD_CONTRACT_DATE)));
map.put(FIELD_CONTRACT_NO, StringUtils.toString(contractNo, eiMetadata.getMeta(FIELD_CONTRACT_NO)));
map.put(FIELD_PLAN_NO, StringUtils.toString(planNo, eiMetadata.getMeta(FIELD_PLAN_NO)));
......
......@@ -101,6 +101,7 @@ public class ServiceHGCG001 extends ServiceBase {
// 写入数据
for (int i = 0; i < fCg001s.size(); i++) {
HGCG001 hgcg001 = fCg001s.get(i);
hgcg001.setPlanDate(DateUtils.formatShort(hgcg001.getPlanDate()));
if (hgcg001.getId() == null || hgcg001.getId() == 0) {
// 修改数据
this.saveData(hgcg001);
......
......@@ -94,11 +94,9 @@ public class ServiceHGCG002A extends ServiceBase {
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGCG001A> fCg001As = MapUtils.toDaoEPBases(inInfo, HGCG001A.class);
// db数据
Map<Long, HGCG001A> dbCg001Map = this.lockGetData(fCg001As);
//计划主表信息
List<String> planNos = fCg001As.stream().map(HGCG001A::getPlanNo).collect(Collectors.toList());
Map<String, HGCG001> hgcg001Map = HGCGTools.HgCg001.map(planNos);
......
......@@ -4,7 +4,11 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.*;
import com.baosight.hggp.hg.cg.constant.HgCgConst;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002B;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
......@@ -33,7 +37,7 @@ import java.util.Map;
* @date:2024/5/9,11:04
*/
public class ServiceHGCG003A extends ServiceBase {
/**
* 画面初始化
*
......@@ -54,7 +58,7 @@ public class ServiceHGCG003A extends ServiceBase {
}
return inInfo;
}
/**
* 查询操作
*
......@@ -75,7 +79,7 @@ public class ServiceHGCG003A extends ServiceBase {
}
return inInfo;
}
/**
* 确认操作.
*
......@@ -103,10 +107,11 @@ public class ServiceHGCG003A extends ServiceBase {
}
return inInfo;
}
/**
* 数据校验
* @param fCg002Bs
*
* @param fCg002Bs
* @param dbCg002BMap
* @param cg001
*/
......@@ -120,6 +125,9 @@ public class ServiceHGCG003A extends ServiceBase {
AssertUtils.isGt(fCg002B.getBcReceiveQty(), fCg002B.getBcMaxReceiveQty(),
String.format("合同[%s]本次收货数量(%s)不能大于本次最大收货数量(%s)", cg001.getContractNo(),
fCg002B.getBcReceiveQty(), fCg002B.getBcMaxReceiveQty()));
AssertUtils.isGt(fCg002B.getBcReceiveWeight(), fCg002B.getBcMaxReceiveWeight(),
String.format("合同[%s]本次收货重量(%s)不能大于本次最大收货重量(%s)", cg001.getContractNo(),
fCg002B.getBcReceiveWeight(), fCg002B.getBcMaxReceiveWeight()));
}
}
......@@ -135,9 +143,19 @@ public class ServiceHGCG003A extends ServiceBase {
Long id = fCg002B.getId();
HGCG002B dbCg002b = dbCg002BMap.get(id);
// 总重
fCg002B.setReceiveWeight(fCg002B.getBcReceiveQty().multiply(dbCg002b.getPurUnitWeight()));
BigDecimal bcReceiveWeight = fCg002B.getBcReceiveWeight();
if (bcReceiveWeight == null || bcReceiveWeight.compareTo(BigDecimal.ZERO) == 0) {
fCg002B.setReceiveWeight(fCg002B.getBcReceiveQty().multiply(dbCg002b.getPurUnitWeight()));
} else {
fCg002B.setReceiveWeight(bcReceiveWeight);
}
// 含税总金额
BigDecimal amount = fCg002B.getReceiveWeight().multiply(dbCg002b.getPrice());
BigDecimal amount;
if (HgCgConst.CalculationMethod.S1.equals(fCg002B.getCalculationMethod())) {
amount = fCg002B.getReceiveWeight().multiply(dbCg002b.getPrice());
} else {
amount = fCg002B.getBcReceiveQty().multiply(dbCg002b.getPrice());
}
// 如果税率不为空,总金额减去税额
if (dbCg002b.getTaxRate() != null) {
amount = amount.subtract(amount.multiply(dbCg002b.getTaxRate()).divide(new BigDecimal("100")));
......@@ -213,5 +231,5 @@ public class ServiceHGCG003A extends ServiceBase {
// 更新合同状态
HGCGTools.HgCg002B.updateReceive(dbCg002b, cg003B.getReceiveQty());
}
}
......@@ -6,7 +6,11 @@ import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.domain.*;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.domain.HGCG002B;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
......@@ -14,21 +18,30 @@ import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.AssertUtils;
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.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGCG003B extends ServiceBase {
/**
* 画面初始化
*
......@@ -41,18 +54,18 @@ public class ServiceHGCG003B extends ServiceBase {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID),
new HashMap<String, Object>(){{
put(HGPZ005.FIELD_STATUS,1);
new HashMap<String, Object>() {{
put(HGPZ005.FIELD_STATUS, 1);
put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
}}, false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003B().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
......@@ -69,7 +82,7 @@ public class ServiceHGCG003B extends ServiceBase {
}
return inInfo;
}
/**
* 保存操作.
*
......@@ -81,7 +94,7 @@ public class ServiceHGCG003B extends ServiceBase {
try {
List<HGCG003B> fCg003Bs = MapUtils.toDaoEPBases(inInfo, HGCG003B.class);
HGCG003 cg003 = HGCGTools.HgCg003.get(fCg003Bs.get(0).getPrimaryId());
if(cg003.getSource().intValue() == HGConstant.CgSource.DEFAULT){
if (cg003.getSource().intValue() == HGConstant.CgSource.DEFAULT) {
// 采购收货DB数据
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(fCg003Bs);
// 采购合同DB数据
......@@ -91,24 +104,21 @@ public class ServiceHGCG003B extends ServiceBase {
Map<Long, HGCG002B> dbCg002BMap = HGCGUtils.HgCg002B.lockGetData(
ObjectUtils.listEpKey(fCg003Bs, HGCG003B.FIELD_CONTRACT_DETAIL_ID));
// 数据校验
this.checkEditData(fCg003Bs, dbCg003BMap,cg003);
this.checkEditData(fCg003Bs, dbCg003BMap, cg003);
// 保存数据
this.editData(fCg003Bs, dbCg003BMap, dbCg002AMap,cg003,dbCg002BMap);
}else{
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.saveData(hgcg003B,cg003);
for (HGCG003B fCg003B : fCg003Bs) {
if (fCg003B.getId() == null || fCg003B.getId() == 0) {
this.addData(fCg003B, cg003);
} else {
this.updateData(hgcg003B);
this.updateData(fCg003B);
}
}
//修改主表信息
updateCg003Pur(cg003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg003Bs.size() + "]条数据保存成功!");
......@@ -117,10 +127,11 @@ public class ServiceHGCG003B extends ServiceBase {
}
return inInfo;
}
/**
* 数据校验
* @param fCg003Bs
*
* @param fCg003Bs
* @param dbCg003Map
* @param cg003
*/
......@@ -146,9 +157,10 @@ public class ServiceHGCG003B extends ServiceBase {
}
}
}
/**
* 数据保存
*
* @param fCg003Bs
* @param dbCg003BMap
* @param dbCg002AMap
......@@ -167,7 +179,7 @@ public class ServiceHGCG003B extends ServiceBase {
HGCGTools.HgCg002B.updateReceive(dbCg002BMap.get(fCg003B.getContractDetailId()), diffQty);
}
List<HGCG002> hgcg002List = new LinkedList<>();
dbCg002AMap.forEach((k, v)->{
dbCg002AMap.forEach((k, v) -> {
hgcg002List.add(v);
});
//根据子表明细刷新合同主表信息
......@@ -175,9 +187,14 @@ public class ServiceHGCG003B extends ServiceBase {
//修改主表信息
updateCg003Pur(cg003);
}
private void saveData(HGCG003B hgcg003B, HGCG003 cg003) {
// 新增数据
/**
* 新增数据
*
* @param hgcg003B
* @param cg003
*/
private void addData(HGCG003B hgcg003B, HGCG003 cg003) {
hgcg003B.setPrimaryId(cg003.getId());
hgcg003B.setReceiveNo(cg003.getReceiveNo());
hgcg003B.setStatus(HGConstant.CgReceiveStatus.S_0);
......@@ -189,24 +206,30 @@ public class ServiceHGCG003B extends ServiceBase {
hgcg003B.setAccountCode(cg003.getAccountCode());
DaoUtils.insert(HGCG003B.INSERT, hgcg003B);
}
/**
* 修改数据
*
* @param hgcg003B
*/
private void updateData(HGCG003B hgcg003B) {
// 新增数据
DaoUtils.update(HGCG003B.UPDATE, hgcg003B);
}
private void updateCg003Pur(HGCG003 cg003) {
List<HGCG003B> queryCG003Bs = HGCGTools.HgCg003B.listByPrimaryId(cg003.getId());
List<HGCG003B> queryCG003Bs = HGCGTools.HgCg003B.listByPrimaryId(cg003.getId());
//修改主表信息
//收货数量
BigDecimal receiveQtySum = queryCG003Bs.stream().map(HGCG003B::getReceiveQty).reduce(BigDecimal.ZERO,BigDecimal::add);
BigDecimal receiveQtySum = queryCG003Bs.stream().map(HGCG003B::getReceiveQty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setReceiveQty(receiveQtySum);
//收货重量
BigDecimal receiveWeightSum = queryCG003Bs.stream().map(HGCG003B::getReceiveWeight).reduce(BigDecimal.ZERO,BigDecimal::add);
BigDecimal receiveWeightSum = queryCG003Bs.stream().map(HGCG003B::getReceiveWeight)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setReceiveWeight(receiveWeightSum);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_QTY, cg003);
}
/**
* 删除操作.
*
......@@ -227,9 +250,9 @@ public class ServiceHGCG003B extends ServiceBase {
Map<Long, HGCG002B> dbCg002BMap = HGCGUtils.HgCg002B.lockGetData(
ObjectUtils.listEpKey(fCg003Bs, HGCG003B.FIELD_CONTRACT_DETAIL_ID));
// 数据校验
this.checkRemoveData(fCg003Bs, dbCg003BMap,cg003);
this.checkRemoveData(fCg003Bs, dbCg003BMap, cg003);
// 保存数据
this.removeData(fCg003Bs, dbCg003BMap, dbCg002AMap,cg003,dbCg002BMap);
this.removeData(fCg003Bs, dbCg003BMap, dbCg002AMap, cg003, dbCg002BMap);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg003Bs.size() + "]条数据删除成功!");
......@@ -238,10 +261,11 @@ public class ServiceHGCG003B extends ServiceBase {
}
return inInfo;
}
/**
* 数据校验
* @param fCg003Bs
*
* @param fCg003Bs
* @param dbCg003BMap
* @param cg003
*/
......@@ -254,9 +278,10 @@ public class ServiceHGCG003B extends ServiceBase {
String.format("收货单[%s]状态不是\"待确认\",不允许操作", receiveNo));
}
}
/**
* 数据保存
*
* @param fCg003Bs
* @param dbCg003bMap
* @param dbCg002AMap
......@@ -276,12 +301,12 @@ public class ServiceHGCG003B extends ServiceBase {
dbCg003B.getReceiveQty().negate());
}
List<HGCG002> hgcg002List = new LinkedList<>();
dbCg002AMap.forEach((k, v)->{
dbCg002AMap.forEach((k, v) -> {
hgcg002List.add(v);
});
//根据子表明细刷新合同主表信息
HGCGTools.HgCg002.updateContractPrimary(hgcg002List);
}else{
} else {
//手工录入的
for (HGCG003B fCg003B : fCg003Bs) {
HGCG003B dbCg003B = dbCg003bMap.get(fCg003B.getId());
......@@ -292,5 +317,5 @@ public class ServiceHGCG003B extends ServiceBase {
//修改主表信息
updateCg003Pur(cg003);
}
}
......@@ -210,6 +210,19 @@
</update>
<!-- 修改采购信息 -->
<update id="update">
UPDATE ${hggpSchema}.HGCG001
SET
COMPANY_CODE = #companyCode#,
COMPANY_NAME = #companyName#,
PROJ_CODE = #projCode#,
PROJ_NAME = #projName#,
PLAN_DATE = #planDate#,
<include refid="updateRevise"/>
WHERE PLAN_NO = #planNo#
</update>
<!-- 修改采购信息 -->
<update id="updatePur">
UPDATE ${hggpSchema}.HGCG001
SET
......
<?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">
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCG002A">
<sql id="condition">
<sql id="condition">
AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......@@ -116,6 +116,7 @@
CALCULATION_METHOD = #calculationMethod#
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
......@@ -292,9 +293,8 @@
</update>
<select id="queryByReceive" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT
<select id="queryByReceive" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT
a.ID as "id",
a.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
a.DEP_CODE as "depCode", <!-- 部门编码 -->
......@@ -329,6 +329,7 @@
a.INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
a.PRIMARY_ID as "primaryId", <!-- 主表id -->
(a.PUR_QTY - a.RECEIVE_QTY) as "bcMaxReceiveQty",
(a.PUR_WEIGHT - a.RECEIVE_WEIGHT) as "bcMaxReceiveWeight",
a.PROJ_CODE as "projCode", <!-- 项目编码 -->
a.PROJ_NAME as "projName", <!-- 项目名称 -->
a.CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
......@@ -341,10 +342,11 @@
b.PUR_USER_ID as "purUserId", <!-- 采购员 -->
b.PUR_USER_NAME as "purUserName" <!-- 采购员名称 -->
FROM ${hggpSchema}.HGCG002A a
LEFT JOIN ${hggpSchema}.HGCG002 b ON a.PRIMARY_ID = b.id
LEFT JOIN ${hggpSchema}.HGCG002 b ON a.PRIMARY_ID = b.id
WHERE 1=1
AND a.DELETE_FLAG = 0
AND b.DELETE_FLAG = 0
AND (a.PUR_QTY - a.RECEIVE_QTY) > 0
<isNotEmpty prepend=" AND " property="id">
a.ID = #id#
</isNotEmpty>
......
<?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">
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCG003A">
<sql id="condition">
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -259,52 +259,42 @@
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCG003A
SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
RECEIVE_DATE = #receiveDate#, <!-- 收货日期 -->
RECEIVE_NO = #receiveNo#, <!-- 收货单号 -->
PLAN_NO = #planNo#, <!-- 计划单号 -->
CONTRACT_NO = #contractNo#, <!-- 合同号 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
SPEC_ID = #specId#, <!-- 规格ID -->
SPEC = #spec#, <!-- 规格 -->
MATERIAL = #material#, <!-- 材质 -->
UNIT = #unit#, <!-- 单位 -->
LENGTH = #length#, <!-- 长度 -->
WIDTH = #width#, <!-- 宽度 -->
THICK = #thick#, <!-- 厚度 -->
RECEIVE_QTY = #receiveQty#, <!-- 收货数量 -->
DELIVER_QTY = #deliverQty#, <!-- 退货数量 -->
DEPOSIT_QTY = #depositQty#, <!-- 入库数量 -->
RECEIVE_UNIT_WEIGHT = #receiveUnitWeight#, <!-- 收货单重 -->
RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 -->
STATUS = #status#, <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
PRICE = #price#, <!-- 单价 -->
AMOUNT = #amount#, <!-- 金额(不含税金额) -->
INVENT_TYPE_DETAIL = #inventTypeDetail#, <!-- 存货类型大类 -->
PRIMARY_ID = #primaryId#, <!-- 主表id -->
CONTRACT_DETAIL_ID = #contractDetailId#, <!-- 合同明细id -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
CALCULATION_METHOD = #calculationMethod#,
IS_INVOICING = #isInvoicing#
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hggpSchema}.HGCG003A
SET
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
RECEIVE_DATE = #receiveDate#, <!-- 收货日期 -->
RECEIVE_NO = #receiveNo#, <!-- 收货单号 -->
CONTRACT_NO = #contractNo#, <!-- 合同号 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
SPEC_ID = #specId#, <!-- 规格ID -->
SPEC = #spec#, <!-- 规格 -->
MATERIAL = #material#, <!-- 材质 -->
UNIT = #unit#, <!-- 单位 -->
LENGTH = #length#, <!-- 长度 -->
WIDTH = #width#, <!-- 宽度 -->
THICK = #thick#, <!-- 厚度 -->
RECEIVE_QTY = #receiveQty#, <!-- 收货数量 -->
RECEIVE_UNIT_WEIGHT = #receiveUnitWeight#, <!-- 收货单重 -->
RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 -->
STATUS = #status#, <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
PRICE = #price#, <!-- 单价 -->
AMOUNT = #amount#, <!-- 金额(不含税金额) -->
INVENT_TYPE_DETAIL = #inventTypeDetail#, <!-- 存货类型大类 -->
PRIMARY_ID = #primaryId#, <!-- 主表id -->
CONTRACT_DETAIL_ID = #contractDetailId#, <!-- 合同明细id -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
CALCULATION_METHOD = #calculationMethod#,
IS_INVOICING = #isInvoicing#
WHERE ID = #id#
</update>
<!-- 修改开票 -->
<update id="updateIsInvoicing">
......@@ -355,10 +345,9 @@
WHERE ID = #id#
</update>
<select id="queryByQualityTesting" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cg.domain.HGCG003B">
SELECT
a.ID as "id",
<select id="queryByQualityTesting" resultClass="com.baosight.hggp.hg.cg.domain.HGCG003B">
SELECT
a.ID as "id",
a.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
a.DEP_CODE as "depCode", <!-- 部门编码 -->
a.CREATED_BY as "createdBy", <!-- 记录创建者 -->
......
......@@ -373,14 +373,16 @@ public class HGConstant {
//生产报工
public static final String SCBG = "SCBG";
}
/**
*
* 采购计划数据来源
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class CgSource {
// 合同
public static final Integer DEFAULT = 0;
// 手动录入
public static final Integer SDLR = 1;
......
......@@ -108,14 +108,19 @@ public class HGSqlConstant {
// 收货完成
public static final String UPDATE_CONFIRM = MODULE_NAME + "updateConfirm";
}
/**
* @author:songx
* @date:2024/8/30,16:25
*/
public class HgCg003A {
/**
* 模块名称:HGCW003A
*/
// 模块名称:HGCW003A
private static final String MODULE_NAME = "HGCG003A.";
//
public static final String UPDATE_IS_INVOICING = MODULE_NAME + "updateIsInvoicing";
// 修改数量
public static final String UPDATE_QTY = MODULE_NAME + "updateQty";
}
/**
......@@ -626,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>
......
......@@ -41,7 +41,7 @@ public class HpDmTools {
}
}
public static List<HGDM099> getByBizId(String bizType, String docId) {
public static List<HGDM099> getByDocId(String bizType, String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGDM099.FIELD_BIZ_TYPE, bizType);
......
......@@ -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());
......
......@@ -19,5 +19,21 @@ public class HgWdSqlConstant {
// 搜索树节点
public static final String SEARCH_TREE_NODE = "HGWD001.searchTreeNode";
}
/**
* HGCW999 SQL定义
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class HgWd099 {
// 预览自增
public static final String PREVIEW_INCR = "HGWD099.previewIncr";
// 下载自增
public static final String DOWNLOAD_INCR = "HGWD099.downloadIncr";
// 发布
public static final String RELEASE_DATE = "HGWD099.updateReleaseDate";
}
}
......@@ -37,7 +37,9 @@ public class HGWD001A extends DaoEPBase {
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_CHANGE_TYPE = "changeType"; /* 变更类型*/
public static final String FIELD_CHANGE_CONTENT = "changeContent"; /* 变更内容*/
public static final String FIELD_CHANGE_START_CODE = "changeStartCode"; /* 变更前编码*/
public static final String FIELD_CHANGE_START = "changeStart"; /* 变更前*/
public static final String FIELD_CHANGE_END_CODE = "changeEndCode"; /* 变更后编码*/
public static final String FIELD_CHANGE_END = "changeEnd"; /* 变更后*/
public static final String FIELD_MAT_ID = "matId"; /* 上级ID*/
......@@ -66,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 = " "; /* 企业编码*/
......@@ -83,7 +87,9 @@ public class HGWD001A extends DaoEPBase {
private String projName = " "; /* 项目名称*/
private String changeType = " "; /* 变更类型*/
private String changeContent = " "; /* 变更内容*/
private String changeStartCode = " "; /* 变更前编码*/
private String changeStart = " "; /* 变更前*/
private String changeEndCode = " "; /* 变更后编码*/
private String changeEnd = " "; /* 变更后*/
private Long matId = new Long(0);
......@@ -158,10 +164,18 @@ public class HGWD001A extends DaoEPBase {
eiColumn.setDescName("变更内容");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_START_CODE);
eiColumn.setDescName("变更前编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_START);
eiColumn.setDescName("变更前");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_END_CODE);
eiColumn.setDescName("变更后编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_END);
eiColumn.setDescName("变更后");
eiMetadata.addMeta(eiColumn);
......@@ -477,6 +491,22 @@ public class HGWD001A extends DaoEPBase {
this.matId = matId;
}
public String getChangeStartCode() {
return changeStartCode;
}
public void setChangeStartCode(String changeStartCode) {
this.changeStartCode = changeStartCode;
}
public String getChangeEndCode() {
return changeEndCode;
}
public void setChangeEndCode(String changeEndCode) {
this.changeEndCode = changeEndCode;
}
/**
* get the value from Map.
*
......@@ -501,7 +531,9 @@ public class HGWD001A extends DaoEPBase {
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setChangeType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_TYPE)), changeType));
setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent));
setChangeStartCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_START_CODE)), changeStartCode));
setChangeStart(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_START)), changeStart));
setChangeEndCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END_CODE)), changeEndCode));
setChangeEnd(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END)), changeEnd));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
}
......@@ -529,7 +561,9 @@ public class HGWD001A extends DaoEPBase {
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_CHANGE_TYPE, StringUtils.toString(changeType, eiMetadata.getMeta(FIELD_CHANGE_TYPE)));
map.put(FIELD_CHANGE_CONTENT, StringUtils.toString(changeContent, eiMetadata.getMeta(FIELD_CHANGE_CONTENT)));
map.put(FIELD_CHANGE_START_CODE, StringUtils.toString(changeStartCode, eiMetadata.getMeta(FIELD_CHANGE_START_CODE)));
map.put(FIELD_CHANGE_START, StringUtils.toString(changeStart, eiMetadata.getMeta(FIELD_CHANGE_START)));
map.put(FIELD_CHANGE_END_CODE, StringUtils.toString(changeEndCode, eiMetadata.getMeta(FIELD_CHANGE_END_CODE)));
map.put(FIELD_CHANGE_END, StringUtils.toString(changeEnd, eiMetadata.getMeta(FIELD_CHANGE_END)));
map.put(FIELD_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID)));
......
......@@ -90,7 +90,7 @@ public class ServiceHGWD001B extends ServiceBase {
List<HGWD001B> fWd001bs = MapUtils.toDaoEPBases(inInfo, HGWD001B.class);
for (HGWD001B fWd001b : fWd001bs) {
// 预览记录+1
HGCWTools.HgCw999.previewIncr(fWd001b.getDocId());
HGWDTools.HgWd099.previewIncr(fWd001b.getDocId());
// 新增
DaoUtils.insert(HGWD001B.INSERT, fWd001b);
}
......
......@@ -90,7 +90,7 @@ public class ServiceHGWD001C extends ServiceBase {
List<HGWD001C> fWd001cs = MapUtils.toDaoEPBases(inInfo, HGWD001C.class);
for (HGWD001C fWd001c : fWd001cs) {
// 下载记录+1
HGCWTools.HgCw999.downloadIncr(fWd001c.getDocId());
HGWDTools.HgWd099.downloadIncr(fWd001c.getDocId());
// 新增
DaoUtils.insert(HGWD001C.INSERT, fWd001c);
}
......
......@@ -37,7 +37,7 @@ public class ServiceHGWD001D extends TreeService {
String accountCode = UserSessionUtils.getAccountCode();
if (StringUtils.isEmpty(accountCode) || CommonConstant.Field.ADMIN.equals(accountCode)) {
map.put("label", "root");
map.put("text", "组织机构");
map.put("text", "文档库");
list.add(map);
} else {
//Org org = HGXSTools.XsOrg.get(accountCode);
......@@ -50,6 +50,7 @@ public class ServiceHGWD001D extends TreeService {
hashMap.put("text", hgsc001.getProjName());
hashMap.put("projCode", hgsc001.getProjCode());
hashMap.put("projName", hgsc001.getProjName());
hashMap.put("ename", hgsc001.getProjCode());
hashMap.put("type", "1");
hashMap.put("leaf", "0");
hashMap.put("leafLevel", "0");
......@@ -71,8 +72,6 @@ public class ServiceHGWD001D extends TreeService {
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
queryMap.put("accountCode", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())
? null : UserSessionUtils.getAccountCode());
queryMap.put("userId", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())
? null : UserSessionUtils.getUserId());
List<Map> ret = this.dao.query("HGWD001.queryOrganiation", queryMap, 0, -999999);
Map parentOrgMap = new HashMap();
......
......@@ -104,7 +104,7 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
/**
......@@ -123,14 +123,14 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){
List<Map> fileType1 = edcm01List.stream().filter(map -> map.get("itemCode").equals(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
......
......@@ -98,7 +98,7 @@ public class ServiceHGWD001F extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
/**
......@@ -117,14 +117,14 @@ public class ServiceHGWD001F extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){
List<Map> fileType1 = edcm01List.stream().filter(map -> map.get("itemCode").equals(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
......
......@@ -97,7 +97,7 @@ public class ServiceHGWD001G extends ServiceEPBase {
hgwd001a.setChangeContent("项目名称");
hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
/**
......@@ -116,14 +116,14 @@ public class ServiceHGWD001G extends ServiceEPBase {
hgwd001a.setChangeContent("项目名称");
hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){
List<Map> fileType1 = edcm01List.stream().filter(map -> map.get("itemCode").equals(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
......
......@@ -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;
}
}
......@@ -3,24 +3,21 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.vo.UserVO;
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.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ProjectInfo;
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.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -44,7 +41,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -62,8 +59,8 @@ public class ServiceHGWD099 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow =EiInfoUtils.getFirstRow(inInfo);
if(StringUtils.isNotEmpty(queryRow.get(HGDM099.FIELD_BIZ_ID).toString())){
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
if (StringUtils.isNotEmpty(queryRow.get(HGWD001.FIELD_FILE_ID).toString())){
inInfo = super.query(inInfo, HGWD099.QUERY, new HGWD099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -83,10 +80,10 @@ public class ServiceHGWD099 extends ServiceEPBase {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HGDM099 hgdm099 = new HGDM099();
HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGDM099.INSERT, hgdm099);
DaoUtils.insert(HGWD099.INSERT, hgdm099);
HGWD001 hgwd001 =HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
......@@ -95,11 +92,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeContent("上传附件");
hgwd001a.setChangeContent(hgwd001.getFileName());
hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(hgdm099.getDocId());
hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
......@@ -124,9 +122,9 @@ public class ServiceHGWD099 extends ServiceEPBase {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HGDM099 hgdm099 = new HGDM099();
HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow);
DaoUtils.update(HGDM099.DELETE, hgdm099);
DaoUtils.update(HGWD099.DELETE, hgdm099); //逻辑删除
HGWD001 hgwd001 = HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
......@@ -135,11 +133,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode());
hgwd001a.setChangeContent("删除附件");
hgwd001a.setChangeContent(hgwd001.getFileName());
hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(hgdm099.getDocId());
hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
......@@ -151,45 +150,4 @@ public class ServiceHGWD099 extends ServiceEPBase {
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGCW999.FIELD_DOC_ID,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
......@@ -30,6 +30,7 @@
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......@@ -272,37 +273,32 @@
<!-- 文档库子节点树查询 -->
<select id="queryOrganiation" resultClass="java.util.HashMap">
SELECT
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.FILE_ID as "label",
A.FILE_ID as "ename",
A.FILE_NAME as "text",
A.FILE_TYPE as "leaf",
A.FILE_TYPE as "type",
A.PARENT_ID as "parentId",
A.DELETE_FLAG as "isDeleted",
A.LEAF_LEVEL as "leafLevel"
FROM ${hggpSchema}.HGWD001 A INNER JOIN ${hggpSchema}.HGWD003 B ON A.FILE_ID = B.FILE_ID
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
FILE_ID as "label",
FILE_ID as "ename",
FILE_NAME as "text",
FILE_TYPE as "leaf",
FILE_TYPE as "type",
PARENT_ID as "parentId",
DELETE_FLAG as "isDeleted",
LEAF_LEVEL as "leafLevel"
FROM ${hggpSchema}.HGWD001
WHERE 1=1
<isEmpty prepend=" AND " property="deletedQuery">
A.DELETE_FLAG = '0'
DELETE_FLAG = '0'
</isEmpty>
<isNotEmpty prepend=" AND " property="node">
A.PARENT_ID = #node#
PARENT_ID = #node#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
B.USER_ID = #userId#
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
group by A.COMPANY_CODE,A.PROJ_CODE,A.FILE_ID,A.FILE_NAME,A.FILE_TYPE,A.PARENT_ID,A.DELETE_FLAG
order by A.CREATED_TIME asc
<!--group by COMPANY_CODE, PROJ_CODE, FILE_ID, FILE_NAME, FILE_TYPE, PARENT_ID, DELETE_FLAG-->
order by CREATED_TIME asc
</select>
<!--档库所有子节点树查询-->
......
......@@ -72,11 +72,17 @@
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#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeStart">
CHANGE_START = #changeStart#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeEndCode">
CHANGE_END_CODE = #changeEndCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeEnd">
CHANGE_END = #changeEnd#
</isNotEmpty>
......@@ -104,7 +110,9 @@
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
......@@ -184,26 +192,30 @@
<insert id="insert">
INSERT INTO ${hggpSchema}.HGWD001A (ID,
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
CHANGE_TYPE, <!-- 变更类型 -->
CHANGE_CONTENT, <!-- 变更内容 -->
CHANGE_START, <!-- 变更前 -->
CHANGE_END, <!-- 变更后 -->
MAT_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #changeType#, #changeContent#, #changeStart#, #changeEnd#,#matId#)
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
CHANGE_TYPE, <!-- 变更类型 -->
CHANGE_CONTENT, <!-- 变更内容 -->
CHANGE_START_CODE,
CHANGE_START, <!-- 变更前 -->
CHANGE_END_CODE,
CHANGE_END, <!-- 变更后 -->
MAT_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #changeType#,
#changeContent#, #changeStartCode#, #changeStart#, #changeEndCode#, #changeEnd#,#matId#)
</insert>
<delete id="delete">
......@@ -234,11 +246,51 @@
PROJ_NAME = #projName#, <!-- 项目名称 -->
CHANGE_TYPE = #changeType#, <!-- 变更类型 -->
CHANGE_CONTENT = #changeContent#, <!-- 变更内容 -->
CHANGE_START_CODE = #changeStartCode#,
CHANGE_START = #changeStart#, <!-- 变更前 -->
CHANGE_END_CODE as #changeEndCode#,
CHANGE_END = #changeEnd#, <!-- 变更后 -->
MAT_ID = #matId#
WHERE
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>
......
<?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="HGWD099">
<sql id="column">
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", <!-- 修改时间 -->
BIZ_TYPE as "bizType", <!-- 业务类型 -->
BIZ_ID as "bizId", <!-- 业务ID -->
DOC_ID as "docId", <!-- 文件ID -->
DOC_NAME as "docName", <!-- 文件名称 -->
STATUS as "status",
PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 -->
DOC_VERSION as "docVersion", <!-- 文件版本号 -->
RELEASE_DATE as "releaseDate" <!-- 发布时间 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = '0'
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizId">
BIZ_ID = #bizId#
</isNotEmpty>
<!--<isNotEmpty prepend=" AND " property="fileId">
BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId# and FILE_ID = #fileId# )
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docVersion">
DOC_VERSION = #docVersion#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="releaseDate">
RELEASE_DATE = #releaseDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
BIZ_ID = #parentId#
</isNotEmpty>
</sql>
<sql id="customCondition">
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.wd.domain.HGWD099">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGWD099
WHERE 1=1
<include refid="customCondition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGWD099
WHERE 1=1
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGWD099 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除 -->
BIZ_TYPE, <!-- 业务类型 -->
BIZ_ID, <!-- 业务ID -->
DOC_ID, <!-- 文件ID -->
DOC_NAME, <!-- 文件名称 -->
STATUS,
DOC_VERSION,
RELEASE_DATE
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #status#, #docVersion#, #releaseDate#
)
</insert>
<delete id="deleteBizId">
UPDATE ${hggpSchema}.HGWD099
SET DELETE_FLAG = 1
WHERE BIZ_ID = #bizId#
</delete>
<delete id="delete">
UPDATE ${hggpSchema}.HGWD099
SET DELETE_FLAG = 1
WHERE ID = #id#
</delete>
<delete id="deleteDocId">
DELETE FROM ${hggpSchema}.HGWD099 WHERE DOC_ID = #docId#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD099
SET
DOC_ID = #docId#, <!-- 文件ID -->
DOC_NAME = #docName#, <!-- 文件名称 -->
STATUS = #status#,
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
RELEASE_DATE = #releaseDate#, <!--发布时间-->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE ID = #id#
</update>
<update id="updateStatus">
UPDATE ${hggpSchema}.HGWD099
SET
STATUS = #status#, <!-- 状态 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE ID = #id#
</update>
<update id="updateReleaseDate">
UPDATE ${hggpSchema}.HGWD099
SET
RELEASE_DATE = #releaseDate#, <!--发布时间-->
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
STATUS = #status#, <!-- 状态 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<update id="batchUpdate">
UPDATE ${hggpSchema}.HGWD099
SET
BIZ_ID = #bizId#, <!-- 物料ID -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE DOC_ID IN <iterate close=")" open="(" conjunction="," property="docIds">#docIds[]#</iterate>
</update>
<!-- 预览自增 -->
<update id="previewIncr">
UPDATE ${hggpSchema}.HGWD099
SET
PREVIEW_NUM = PREVIEW_NUM + 1,
<include refid="SqlBase.updateRevise"/>
WHERE DOC_ID = #docId#
</update>
<!-- 下载自增 -->
<update id="downloadIncr">
UPDATE ${hggpSchema}.HGWD099
SET
DOWNLOAD_NUM = DOWNLOAD_NUM + 1,
<include refid="SqlBase.updateRevise"/>
WHERE DOC_ID = #docId#
</update>
</sqlMap>
\ No newline at end of file
package com.baosight.hggp.hg.wd.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.constant.HgCwSqlConstant;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -84,7 +92,7 @@ public class HGWDTools {
return DaoBase.getInstance().query(HgWdSqlConstant.HgWd001.SEARCH_TREE_NODE, queryMap);
}
public static void add(HGWD001A hgwd001a) {
public static void addHGWD001A(HGWD001A hgwd001a) {
AssertUtils.isNull(hgwd001a, "文档对象不能为空");
DaoUtils.insert(HGWD001A.INSERT, hgwd001a);
}
......@@ -127,4 +135,50 @@ public class HGWDTools {
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
public static class HgWd099 {
public static List<HGWD099> getByDocId(String bizType, String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGWD099.FIELD_BIZ_TYPE, bizType);
paramMap.put(HGWD099.FIELD_DOC_ID, docId);
return DaoBase.getInstance().query(HGWD099.QUERY, paramMap);
}
/**
* 预览记录自增
*
* @param docId
*/
public static void previewIncr(String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HGCW999.FIELD_DOC_ID, docId);
DaoUtils.update(HgWdSqlConstant.HgWd099.PREVIEW_INCR, queryMap);
}
/**
* 下载记录自增
*
* @param docId
*/
public static void downloadIncr(String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HGCW999.FIELD_DOC_ID, docId);
DaoUtils.update(HgWdSqlConstant.HgWd099.DOWNLOAD_INCR, queryMap);
}
public static List<HGWD099> queryByBiz(String bizType) {
AssertUtils.isNull(bizType, "业务类型不能为空!");
List<HGWD099> results = DaoBase.getInstance().query(HGWD099.QUERY,
new HashMap<String,Object>(){{put("bizType",bizType);}}
);
return results;
}
}
}
......@@ -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);
}
......
......@@ -53,6 +53,8 @@ public class HGYX001 extends DaoEPBase {
public static final String FIELD_CONS_QUANTITY = "consQuantity"; /* 发货数量*/
public static final String FIELD_CONS_WEIGHT = "consWeight"; /* 发货重量*/
public static final String FIELD_STATUS = "status"; /* 审批状态 0-未审核,1-已审核*/
public static final String FIELD_IS_CONTRACT = "isContract"; /*是否扣款*/
public static final String FIELD_CONTRACT_NAME = "contractName"; /*扣款方*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -124,6 +126,8 @@ public class HGYX001 extends DaoEPBase {
private BigDecimal consQuantity = new BigDecimal("0"); /* 发货数量*/
private BigDecimal consWeight = new BigDecimal("0"); /* 发货重量*/
private Integer status = 0; /* 审批状态 0-未审核,1-已审核*/
private Integer isContract = 0;
private String contractName = " ";
/**
* initialize the metadata.
......@@ -258,6 +262,13 @@ public class HGYX001 extends DaoEPBase {
eiColumn.setDescName("审批状态 0-未审核,1-已审核");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_IS_CONTRACT);
eiColumn.setDescName("是否扣款");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONTRACT_NAME);
eiColumn.setDescName("扣款方");
eiMetadata.addMeta(eiColumn);
}
......@@ -748,6 +759,23 @@ public class HGYX001 extends DaoEPBase {
public void setStatus(Integer status) {
this.status = status;
}
public Integer getIsContract() {
return isContract;
}
public void setIsContract(Integer isContract) {
this.isContract = isContract;
}
public String getContractName() {
return contractName;
}
public void setContractName(String contractName) {
this.contractName = contractName;
}
/**
* get the value from Map.
*
......@@ -786,6 +814,8 @@ public class HGYX001 extends DaoEPBase {
setConsQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_CONS_QUANTITY)), consQuantity));
setConsWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_CONS_WEIGHT)), consWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setIsContract(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_CONTRACT)), isContract));
setContractName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NAME)), contractName));
}
/**
......@@ -825,6 +855,8 @@ public class HGYX001 extends DaoEPBase {
map.put(FIELD_CONS_QUANTITY, StringUtils.toString(consQuantity, eiMetadata.getMeta(FIELD_CONS_QUANTITY)));
map.put(FIELD_CONS_WEIGHT, StringUtils.toString(consWeight, eiMetadata.getMeta(FIELD_CONS_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_IS_CONTRACT, StringUtils.toString(isContract, eiMetadata.getMeta(FIELD_IS_CONTRACT)));
map.put(FIELD_CONTRACT_NAME, StringUtils.toString(contractName, eiMetadata.getMeta(FIELD_CONTRACT_NAME)));
return map;
}
......
......@@ -48,6 +48,7 @@ public class ServiceHGYX001A extends ServiceEPBase {
outInfo = super.query(inInfo, HGYX001A.QUERY, new HGYX001A());
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgYx001));
outInfo.getBlock(EiConstant.queryBlock).setBlockMeta(new HGYX001().eiMetadata);
}
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "type", type);
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
......
......@@ -43,6 +43,7 @@ public class ServiceHGYX001B extends ServiceEPBase {
outInfo = super.query(inInfo, HGYX001A.QUERY, new HGYX001A());
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgYx001));
outInfo.getBlock(EiConstant.queryBlock).setBlockMeta(new HGYX001().eiMetadata);
}
//UserVO userVO = HGCWTools.HgCw002.getUserCompany();
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
......
......@@ -69,7 +69,9 @@
NUM_PLATE as "numPlate", <!-- 车号 -->
CONS_QUANTITY as "consQuantity", <!-- 发货数量 -->
CONS_WEIGHT as "consWeight", <!-- 发货重量 -->
STATUS as "status" <!-- 审批状态 0-未审核,1-已审核 -->
STATUS as "status", <!-- 审批状态 0-未审核,1-已审核 -->
IS_CONTRACT as "isContract", <!-- 是否完成 -->
CONTRACT_NAME as "contractName"
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
......@@ -166,6 +168,9 @@
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="isContract">
IS_CONTRACT = #isContract#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGYX001">
......@@ -311,12 +316,14 @@
NUM_PLATE, <!-- 车号 -->
CONS_QUANTITY, <!-- 发货数量 -->
CONS_WEIGHT, <!-- 发货重量 -->
STATUS <!-- 审批状态 0-未审核,1-已审核 -->
STATUS, <!-- 审批状态 0-未审核,1-已审核 -->
IS_CONTRACT,
CONTRACT_NAME
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #deliveryCode#,
#outboundCode#, #consCode#, #consName#, #consWhCode#, #consWhName#, #consAddr#, #receCode#, #receName#,
#receAddr#, #receUserPhone#, #tranType#, #numPlate#, #consQuantity#, #consWeight#, #status#)
#receAddr#, #receUserPhone#, #tranType#, #numPlate#, #consQuantity#, #consWeight#, #status#, #isContract#, #contractName#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGYX001
</selectKey>
......@@ -364,7 +371,9 @@
NUM_PLATE = #numPlate#, <!-- 车号 -->
CONS_QUANTITY = #consQuantity#, <!-- 发货数量 -->
CONS_WEIGHT = #consWeight#, <!-- 发货重量 -->
STATUS = #status# <!-- 审批状态 0-未审核,1-已审核 -->
STATUS = #status#, <!-- 审批状态 0-未审核,1-已审核 -->
IS_CONTRACT = #isContract#,
CONTRACT_NAME = #contractName#
WHERE
ID = #id#
</update>
......
......@@ -68,6 +68,7 @@ public class ServiceHGZL001B extends ServiceEPBase {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGCG003B.FIELD_SOURCE, HGConstant.CgSource.DEFAULT);
queryMap.put(HGCG003B.FIELD_STATUS, HGConstant.CgReceiveStatus.S_0);
inInfo = super.query(inInfo, HGCG003B.QUERY_BY_QUALITY_TESTING, new HGCG003B());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
package com.baosight.xservices.xs.service;
import com.baosight.iplat4j.core.FrameworkInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.log.Logger;
import com.baosight.iplat4j.core.log.LoggerFactory;
......@@ -11,11 +12,12 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.StringUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.xservices.xs.jwt.JwtTokenValidator;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import java.util.HashMap;
import java.util.Map;
/**
* 重写
*
......@@ -76,6 +78,49 @@ public class ServiceXSUserJwt extends ServiceBase {
return outInfo;
}
/**
* 德诚系统对接专用
*
* @param inInfo
* @return
*/
public EiInfo generateJwtDc(EiInfo inInfo) {
String username = inInfo.getString("loginName");
String password = inInfo.getString("password");
String audience = inInfo.getString("audience");
EiInfo outInfo = new EiInfo();
try {
if (!StringUtils.isNotEmpty(audience)) {
audience = FrameworkInfo.getProjectEname().toUpperCase();
}
IUserManager um = SecurityFactory.getUserManager();
User user = um.getUser("DC" + username);
if (user == null) {
throw new UsernameNotFoundException("Can't find user!");
}
Map tokenMap = new HashMap();
tokenMap.put("sub", user.getLoginName());
tokenMap.put("uid", user.getUserId());
Object userCname = user.get("userName");
if (userCname != null) {
tokenMap.put("ucn", userCname.toString());
}
if (!StringUtils.isNotEmpty(audience)) {
audience = FrameworkInfo.getProjectEname().toUpperCase();
}
String token = this.jwtTokenValidator.generateToken(tokenMap, audience);
outInfo.setStatus(EiConstant.STATUS_SUCCESS);
outInfo.setMsg("登录成功!");
outInfo.set("token", token);
} catch (Exception var11) {
this.logger.error(var11.getMessage(), var11);
outInfo.setStatus(EiConstant.STATUS_FAILURE);
outInfo.setMsg(var11.getMessage());
}
return outInfo;
}
public EiInfo validateTest(EiInfo inInfo) {
new HashMap();
inInfo.set("userSessionData", new HashMap(UserSession.getData()));
......
......@@ -96,7 +96,9 @@
<!-- 文档库 -->
<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"/>
</sqlMapConfig>
......@@ -8,22 +8,22 @@ $(function () {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
if (!isBlank(item.id)){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', ' + item.source + ')" >详情</a>';
}
return template;
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
if (!isBlank(item.id)) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', ' + item.source
+ ')" >详情</a>';
}
}, {
field: "companyCode",
title: "公司编码",
template: function (dataItem) {
return template;
}
}, {
field: "companyCode",
title: "公司编码",
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']) {
return companyCodeBox[i]['companyCode'];
......@@ -41,9 +41,9 @@ $(function () {
return projCodeBox[i]['valueField'];
}
}
return dataItem["projCode"];
return dataItem["projCode"] == null ? "" : dataItem["projCode"];
},
editor: function (container, options) {
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-approvalStatus", 2);
......
......@@ -45,11 +45,11 @@
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="companyName" cname="公司名称" width="220" enable="false" readonly="true" align="left"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="140" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="left" enable="false"/>
<EF:EFColumn ename="planDate" cname="计划日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.planStatus"/>
......
......@@ -10,10 +10,8 @@ $(function () {
loadComplete: function (grid) {
grid.dataSource.bind("change", function (e) {
var item = e.items[0];
if (e.field == "price") {
calAmount(item);
}
if (e.field == "taxRate") {
if (e.field == "purQty" || e.field == "purWeight" || e.field == "price"
|| e.field == "taxRate" || e.field == "calculationMethod") {
calAmount(item);
}
});
......@@ -94,13 +92,16 @@ let confirm = function () {
* @param coefficient
*/
let calAmount = function (item) {
//原材料
if(item.inventTypeDetail === '3'){
if(item.purWeight && item.price && item.taxRate){
let price = item.price;
let taxRate = item.taxRate;
// 计算方式为重量乘单价
if (item.calculationMethod == 1) {
let purWeight = item.purWeight;
if (!isBlank(purWeight) && !isBlank(price) && !isBlank(taxRate)) {
// 重量*单价金额
let totalAmount = item.purWeight * item.price;
//不含税金额
let amount = totalAmount / (1 + item.taxRate / 100);
let totalAmount = purWeight * price;
// 不含税金额
let amount = totalAmount / (1 + taxRate / 100);
//税额
let taxAmount = totalAmount - amount;
//含税金额
......@@ -109,12 +110,13 @@ let calAmount = function (item) {
resultGrid.setCellValue(item, 'amount', amount)
resultGrid.setCellValue(item, 'taxIncludeAmount', taxIncludeAmount)
}
}else{
if(item.purQty && item.price && item.taxRate){
} else {
let purQty = item.purQty;
if (!isBlank(purQty) && !isBlank(price) && !isBlank(taxRate)) {
// 数量*单价金额
let totalAmount = item.purQty * item.price;
let totalAmount = purQty * price;
//不含税金额
let amount = totalAmount / (1 + item.taxRate / 100);
let amount = totalAmount / (1 + taxRate / 100);
//税额
let taxAmount = totalAmount - amount;
//含税金额
......
......@@ -42,6 +42,10 @@
required="true"/>
<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"
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"/>
<EF:EFComboColumn ename="taxRate" cname="税率(%)" enable="true" width="100" align="center" required="true"
copy="true">
......
......@@ -106,6 +106,8 @@ let confirm = function () {
for (let i = 0; i < rows.length; i++) {
let bcReceiveQty = rows[i]['bcReceiveQty'];
let bcMaxReceiveQty = rows[i]['bcMaxReceiveQty'];
let bcReceiveWeight = rows[i]['bcReceiveWeight'];
let bcMaxReceiveWeight = rows[i]['bcMaxReceiveWeight'];
if (!isPositiveNumber(bcReceiveQty)) {
message("勾选的第" + (i + 1) + "行本次收货数量必须大于0");
return;
......@@ -114,6 +116,10 @@ let confirm = function () {
message("勾选的第" + (i + 1) + "行本次收货数量不能大于本次最大收货数量");
return;
}
if (!isBlank(bcReceiveWeight) && parseFloat(bcReceiveWeight) > parseFloat(bcMaxReceiveWeight)) {
message("勾选的第" + (i + 1) + "行本次收货重量不能大于本次最大收货重量");
return;
}
}
JSUtils.confirm("确定对勾选的[" + rows.length + "]条数据生成\"采购收货\"吗? ", {
ok: function () {
......
......@@ -55,11 +55,20 @@
<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"
format="{0:N3}"/>
<EF:EFColumn ename="bcReceiveWeight" cname="本次</br>收货重量" width="100" align="right" format="{0:N3}"
required="true"/>
<EF:EFColumn ename="bcMaxReceiveWeight" cname="本次最大</br>收货重量" enable="false" width="100" align="right"
format="{0:N3}"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="receiveWeight" cname="已收货重量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purQty" cname="采购数量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purUnitWeight" cname="采购单重" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purWeight" cname="采购重量" enable="false" width="100" align="right" format="{0:N3}"/>
......@@ -68,6 +77,9 @@
<EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="purUserName" cname="采购员" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="100" align="center">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" enable="false"/>
<EF:EFColumn ename="taxRate" cname="税率(%)" width="80" align="right" format="{0:N3}" enable="false"/>
<EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="120" align="right" format="{0:C3}"
......@@ -76,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
}
}
......@@ -153,13 +152,17 @@ $(window).load(function () {
//合同选择的存货不让新增、删除
var source = $("#source").val();
if(source === '0'){
$(".k-grid-add").hide();
$(".k-grid-save-changes").hide();
$(".k-grid-cancel-changes").hide();
$(".k-grid-delete").hide();
}
}
});
/**
* 计算金额
*
* @param item
* @param length
* @param width
......
......@@ -41,18 +41,19 @@
<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="receiveQty" cname="收货数量" width="120" align="right" format="{0:N3}" required="true"
sumType="page"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="depositQty" cname="入库数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="receiveUnitWeight" cname="收货单重" enable="false" width="120" align="right" format="{0:N3}"
hidden="true"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="120" align="center" required="true">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod" />
<EF:EFColumn ename="receiveWeight" cname="收货重量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<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="单价" width="120" align="right" format="{0:C3}" required="true"/>
<EF:EFColumn ename="amount" cname="金额" enable="false" width="120" align="right" format="{0:C3}"
......
......@@ -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"/>
......
......@@ -6,15 +6,15 @@ $(function () {
const init = () => {
$("#HGWD001").css("padding-bottom", "8px")
sessionStorage.removeItem("__user_id__")
setTimeout(() => {
setTimeout(() => {
resultGrid.dataSource.page(1);
// 显示授权按钮
showAuthButton();
}, 1000);
// 查询
$("#QUERY").on("click", function (e) {
resultGrid.dataSource.page(1);
});
// 分割线组件
(function () {
splitter = $("#splitter").kendoSplitter({
......@@ -94,21 +94,22 @@ $(function () {
"categoryTree": {
select: function (e) {
var _data = this.dataItem(e.node);
var nodeData = IPLATUI.EFTree.categoryTree.selectTreeNode;
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-bizId']").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(_data.type);
$("[name = 'inqu_status-0-type']").val(typeValue);
$("[name = 'inqu_status-0-fileName']").val(_data.text);
resultGrid.dataSource.page(1);
// 编辑、删除树节点时,需要刷新的树节点
$("[name = 'inqu_status-0-orgParentId']").val(_data.parentId);
// 显示授权按钮
showAuthButton();
},
/*ROOT:{label: 'root',text: '组织机构'},*/
template: function (node) {
......@@ -130,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'
}
}
......@@ -201,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"){
......@@ -234,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()
......@@ -296,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"){
......@@ -351,7 +352,6 @@ $(function () {
selectTreeNode(tree, orgId);
// 设置当前选中的节点信息
$("[name = 'inqu_status-0-parentId']").val(orgId);
$("[name = 'inqu_status-0-bizId']").val(orgId);
$("[name = 'inqu_status-0-projCode']").val(data.projCode);
$("[name = 'inqu_status-0-companyCode']").val(data.companyCode);
$("[name = 'inqu_status-0-type']").val(data.type);
......@@ -378,7 +378,14 @@ $(function () {
this.expandPath(['root']);
}, 1000);
},
selectTreeNode: {},
selectTreeNode: {
fileId: '',
parentId: '',
projCode: '',
companyCode: '',
leafLevel: '',
type: '',
},
// expandLevel:1,
/**
* 开启结点拖拽功能,默认dragAndDrop = false不开启,
......@@ -464,7 +471,10 @@ $(function () {
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
//发布
$("#RELEASE").click("click",updateRelease);
//变更记录
$("#CHANGE_RECORD").on("click", changeResord);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
......@@ -801,8 +811,6 @@ function showPreview() {
/**
* 文件上传
*
* @param id
*/
function uploadFile() {
let lv = $("#inqu_status-0-leafLevel").val();
......@@ -816,7 +824,7 @@ function uploadFile() {
}
JSColorbox.open({
href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType=WD" +
"&inqu_status-0-bizId="+$("#inqu_status-0-bizId").val()+"" +
"&inqu_status-0-bizId="+$("#inqu_status-0-parentId").val()+"" +
"&inqu_status-0-operType=add" +
"&efParentFormEname=HGWD001",
title: "<div style='text-align: center;'>附件上传</div>",
......@@ -888,3 +896,70 @@ function deleteFunc() {
}
})
}
/**
* 发布
*/
function updateRelease() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"))
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, {
onSuccess(response) {
if (response.status != -1) {
NotificationUtil(response.msg);
query();
} else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
/**
* 显示授权按钮
*/
let showAuthButton = function () {
let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel;
// C:目录
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"/>
......@@ -54,7 +54,6 @@
<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="bizId" 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"/>
......@@ -69,6 +68,9 @@
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="120" align="center" defaultValue="0" hidden="false">
<EF:EFCodeOption codeName="hggp.hgwd.status"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
......
......@@ -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"/>
......
......@@ -78,7 +78,6 @@ $(function () {
//console.log(dayjs,"dayjs")
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
$("#RELEASE").click("click",updateRelease)
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "projCode") {
......@@ -178,41 +177,20 @@ 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);
}
});
}
}
/**
* 发布
*/
function updateRelease() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"))
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, {
onSuccess(response) {
if (response.status != -1) {
NotificationUtil(response.msg);
query();
} else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: 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>
......@@ -38,6 +38,10 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgyx.status" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="isContract" cname="是否扣款" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
......@@ -76,6 +80,10 @@
<EF:EFColumn ename="consAddr" cname="发货地址" hidden="true" width="120" align="center"/>
<EF:EFColumn ename="consQuantity" cname="发货数量" enable="true" readonly="true" width="120" align="center" format="{0:N3}" data-rules="number"/>
<EF:EFColumn ename="consWeight" cname="发货重量" width="120" align="center" format="{0:N3}" data-rules="number"/>
<EF:EFComboColumn ename="isContract" cname="是否扣款" width="80" align="center" enable="false" defaultValue="0" required="true">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFComboColumn>
<EF:EFColumn ename="contractName" cname="扣款方" width="120" align="center"/>
<EF:EFComboColumn ename="status" cname="审核状态" width="80" align="center" enable="false" defaultValue="0" required="true">
<EF:EFCodeOption codeName="hggp.hgyx.status" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFComboColumn>
......
......@@ -221,6 +221,13 @@ $(function() {
});
return false;
}
let isContract = $("#inqu_status-0-isContract").val();
let contractName = $("#inqu_status-0-contractName").val();
if (isContract=="1" && isBlank(contractName)){
message("是扣款,扣款方不能为空");
flag = false;
return false;
}
let rows = resultGrid.getDataItems();
if (rows.length < 1) {
message("明细信息不能为空,请选择数据");
......@@ -259,6 +266,13 @@ $(function() {
});
return false;
}
let isContract = $("#inqu_status-0-isContract").val();
let contractName = $("#inqu_status-0-contractName").val();
if (isContract=="1" && isBlank(contractName)){
message("是扣款,扣款方不能为空");
flag = false;
return false;
}
let rows = resultGrid.getDataItems();
if (rows.length < 1) {
message("明细信息不能为空,请选择数据");
......
......@@ -66,6 +66,10 @@
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFInput blockId="inqu_status" row="0" ename="type" cname="type" type="hidden" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="isContract" cname="是否扣款" colWidth="3" filter="contains">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="contractName" cname="扣款方" required="false" colWidth="3"/>
</div>
</EF:EFRegion>
......
......@@ -65,6 +65,10 @@
required="true" colWidth="3" disabled="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="isContract" cname="是否扣款" colWidth="3" filter="contains">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="contractName" cname="扣款方" required="true" colWidth="3"/>
</div>
</EF:EFRegion>
......
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