Commit 957363dd by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

parents 8d88e3de 94eb1b65
......@@ -239,8 +239,12 @@ public enum DdynamicEnum {
* 用途:工序下拉框
* 编写:wwl
*/
PLAN_PROCESS_BLOCK_ID("plan_process_block_id", "processName", "processName", "HGSC005A.queryProcessComboBox")
PLAN_PROCESS_BLOCK_ID("plan_process_block_id", "processName", "processName", "HGSC005A.queryProcessComboBox"),
/**
*
*/
PROJECT_CODE_BOX_BLOCK_ID("projectCodeBox_block_id","projCode","projName","HGSC001.queryProjectCodeBox")
;
......
......@@ -5,7 +5,7 @@ package com.baosight.hggp.hg.constant;
* @date:2024/1/18,17:16
*/
public class HGConstant {
/**
* 序列号
*
......@@ -13,7 +13,7 @@ public class HGConstant {
* @date:2021/8/17,15:22
*/
public static class SequenceId {
// 用户ID
public static final String USER_ID = "USER_ID";
// 组织机构编码
......@@ -40,7 +40,7 @@ public class HGConstant {
public static final String WH_CODE = "HGPZ007_WH_CODE";
// 项目性质编码
public static final String NAT_CODE = "HGPZ008_NAT_CODE";
//项目档案编号
public static final String PROJ_NUMBER = "PROJ_NUMBER";
// 盘点单号
......@@ -103,6 +103,8 @@ public class HGConstant {
public static final String UPKEEP_CODE = "UPKEEP_CODE";
// 蓝图编号
public static final String BLUEPRINT_CODE = "BLUEPRINT_CODE";
public static final String CW_CONTRACT_NO = "CW_CONTRACT_NO";
}
/**
......@@ -112,7 +114,7 @@ public class HGConstant {
* @date:2024/2/22,13:57
*/
public static class CgPlanStatus {
// 待审核
public static final Integer S_0 = 0;
// 审核中
......@@ -124,7 +126,7 @@ public class HGConstant {
// 生成合同
public static final Integer S_4 = 4;
}
/**
* 采购合同状态
*
......@@ -132,7 +134,7 @@ public class HGConstant {
* @date:2024/2/22,13:57
*/
public static class CgContractStatus {
// 待审核
public static final Integer S_0 = 0;
// 审核中
......@@ -166,7 +168,7 @@ public class HGConstant {
// 已入库
public static final Integer S_5 = 5;
}
/**
* 库存类型
*
......@@ -174,7 +176,7 @@ public class HGConstant {
* @date:2024/1/20,15:18
*/
public static class KcType {
// 采购
public static final String CG = "CG";
// 生产
......
......@@ -10,7 +10,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hgcw003.java <br>
* Title:HGCW003.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
......@@ -66,11 +66,11 @@ public class HGCW003 extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String QUERY = "hgcw003.query";
public static final String COUNT = "hgcw003.count";
public static final String INSERT = "hgcw003.insert";
public static final String UPDATE = "hgcw003.update";
public static final String DELETE = "hgcw003.delete";
public static final String QUERY = "HGCW003.query";
public static final String COUNT = "HGCW003.count";
public static final String INSERT = "HGCW003.insert";
public static final String UPDATE = "HGCW003.update";
public static final String DELETE = "HGCW003.delete";
private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/
......@@ -79,7 +79,7 @@ public class HGCW003 extends DaoEPBase {
private String contractNumber = " "; /* 合同号*/
private String inventory = " "; /* 清单*/
private String unit = " "; /* 单位*/
private String provisionalQuantity = " "; /* 暂定工程量*/
private BigDecimal provisionalQuantity = new BigDecimal("0"); /* 暂定工程量*/
private String measurementMethod = " "; /* 计量方式*/
private String supplyMethod = " "; /* 材料供应方式*/
private BigDecimal unitPriceExcludingTax = new BigDecimal("0"); /* 除税单价/元*/
......@@ -323,7 +323,7 @@ public class HGCW003 extends DaoEPBase {
* get the provisionalQuantity - 暂定工程量.
* @return the provisionalQuantity
*/
public String getProvisionalQuantity() {
public BigDecimal getProvisionalQuantity() {
return this.provisionalQuantity;
}
......@@ -332,7 +332,7 @@ public class HGCW003 extends DaoEPBase {
*
* @param provisionalQuantity - 暂定工程量
*/
public void setProvisionalQuantity(String provisionalQuantity) {
public void setProvisionalQuantity(BigDecimal provisionalQuantity) {
this.provisionalQuantity = provisionalQuantity;
}
/**
......@@ -558,7 +558,7 @@ public class HGCW003 extends DaoEPBase {
setContractNumber(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NUMBER)), contractNumber));
setInventory(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENTORY)), inventory));
setUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UNIT)), unit));
setProvisionalQuantity(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROVISIONAL_QUANTITY)), provisionalQuantity));
setProvisionalQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PROVISIONAL_QUANTITY)), provisionalQuantity));
setMeasurementMethod(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MEASUREMENT_METHOD)), measurementMethod));
setSupplyMethod(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUPPLY_METHOD)), supplyMethod));
setUnitPriceExcludingTax(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_PRICE_EXCLUDING_TAX)), unitPriceExcludingTax));
......
......@@ -3,7 +3,10 @@ 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.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -11,6 +14,8 @@ 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.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.util.Arrays;
import java.util.List;
......@@ -66,13 +71,34 @@ public class ServiceHGCW002 extends ServiceBase {
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
List<Map> detail1Rows = inInfo.getBlock("detail1").getRows();
List<Map> detail2Rows = inInfo.getBlock("detail2").getRows();
if (CollectionUtils.isNotEmpty(resultRows)) {
HGCW002 HGCW002 = new HGCW002();
HGCW002.fromMap(resultRows.get(i));
HGCW002.fromMap(resultRows.get(0));
if (HGCW002.getId() == null || HGCW002.getId() == 0) {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
String contractNumber =userVO.getUsercode() +
HGCW002.getContractType() +
SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_CONTRACT_NO);
HGCW002.setCompanyCode(userVO.getUsercode());
HGCW002.setCompanyName(userVO.getUsername());
HGCW002.setContractNumber(contractNumber);
HGCW002.setReviewStatus(0);
HGCW002.setBalanceStatus(1);
HGCW002.setPlanStartDate(DateUtils.formatShort(HGCW002.getPlanStartDate()));
HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate()));
HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate()));
this.add(HGCW002);
// 写入其他数据
HGCWTools.HgCw003.save(detail1Rows,contractNumber,userVO);
HGCWTools.HgCw999.batchUpdate(detail2Rows,HGCW002.getId());
} else {
HGCW002.setPlanStartDate(DateUtils.formatShort(HGCW002.getPlanStartDate()));
HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate()));
HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate()));
this.modify(HGCW002);
}
}
......
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.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.pz.domain.HGPZ002;
import com.baosight.hggp.hg.pz.domain.HGPZ003;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW002A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID), null, false);
inInfo.addBlock("detail1").addBlockMeta(new HGCW002().eiMetadata);
inInfo.addBlock("detail2").addBlockMeta(new HGCW002().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 甲方名称查询
* 合同类别为收入时,乙方为组织机构中的公司,甲方选择客户档案里的客户;数据提交之后需要把客户档案中的客户类别更新为正式客户
* 合同类别为支出时,甲方为组织机构中的公司,乙方选择供应商档案里面的供应商
* @param inInfo
* @return
*/
public EiInfo partyAQuery(EiInfo inInfo) {
try {
List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory");
if (contractCategory.equals("1")) {
List<HGPZ002> hgpz002List = HGPZTools.HgPz002.list(1);
if (CollectionUtils.isNotEmpty(hgpz002List)) {
hgpz002List.forEach(hgpz002 -> {
UserVO userVO = new UserVO();
userVO.setUsercode(hgpz002.getCustCode());
userVO.setUsername(hgpz002.getCustName());
userVOList.add(userVO);
});
}
} else if (contractCategory.equals("2")) {
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
UserVO userVO = new UserVO();
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
userVOList.add(userVO);
} else {
UserVO userVO = new UserVO();
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
userVOList.add(userVO);
}
}
}
inInfo.addBlock("partyAResult").addRows(userVOList);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "甲方名称查询失败");
}
return inInfo;
}
/**
* 乙方名称查询
* @param inInfo
* @return
*/
public EiInfo partyBQuery(EiInfo inInfo) {
try {
List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory");
if (contractCategory.equals("1")) {
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
UserVO userVO = new UserVO();
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
userVOList.add(userVO);
} else {
UserVO userVO = new UserVO();
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
userVOList.add(userVO);
}
}
} else if (contractCategory.equals("2")) {
List<HGPZ003> hgpz003List = HGPZTools.HgPz003.list(4);
if (CollectionUtils.isNotEmpty(hgpz003List)) {
hgpz003List.forEach(hgpz003 -> {
UserVO userVO = new UserVO();
userVO.setUsercode(hgpz003.getSupCode());
userVO.setUsername(hgpz003.getSupName());
userVOList.add(userVO);
});
}
}
inInfo.addBlock("partyAResult").addRows(userVOList);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "乙方名称查询失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.pz.domain.HGPZ002;
import com.baosight.hggp.hg.pz.domain.HGPZ003;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.*;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW002B extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "修改合同",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID), null, false);
String id = inInfo.getString("id");
HGCW002 HGCW002 = HGCWTools.HgCw002.getId(id);
inInfo.addBlock(EiConstant.resultBlock).addRow(HGCW002);
//获取清单
List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(HGCW002.getContractNumber());
inInfo.addBlock("detail1").addRows(hgcw003List);
List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(HGCW002.getId(),"HT");
inInfo.addBlock("detail2").addRows(hgcw999List);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
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.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW003 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW003().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW003.QUERY, new HGCW003());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try {
List<Map> resultRows = inInfo.getBlock("detail1").getRows();
String contractNumber = "";
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
contractNumber = HGCW003.getContractNumber();
if (HGCW003.getId() == null || HGCW003.getId() == 0) {
this.add(HGCW003);
} else {
this.modify(HGCW003);
}
}
List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(contractNumber);
eiInfo.addBlock("detail1").addRows(hgcw003List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return eiInfo;
}
/**
* 新增操作
*
* @param HGCW003
* @return
*/
public void add(HGCW003 HGCW003) {
DaoUtils.insert("HGCW003.insert", HGCW003);
}
/**
* 修改操作
*
* @param HGCW003
* @return
*/
public void modify(HGCW003 HGCW003) {
DaoUtils.update("HGCW003.update", HGCW003);
}
public void deleteEntity(HGCW003 HGCW003) {
DaoUtils.update("HGCW003.delete", HGCW003);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try {
List<Map> resultRows = inInfo.getBlock("detail1").getRows();
String contractNumber = "";
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
contractNumber = HGCW003.getContractNumber();
this.deleteEntity(HGCW003);
}
List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(contractNumber);
eiInfo.addBlock("detail1").addRows(hgcw003List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return eiInfo;
}
/**
* 更新页面上的数据
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "更新",operDesc = "更新")
public EiInfo dataUpdate(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock("result1").getRows();
List<HGCW003> hgcw003List = new ArrayList<>();
BigDecimal taxPoints = NumberUtils.toBigDecimal(inInfo.getString("taxPoints"));
DecimalFormat decimalFormat = new DecimalFormat("#.000");
for (int i = 0; i < resultRows.size(); i++) {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
// 计算总金额
BigDecimal totalPriceExcluding = new BigDecimal(decimalFormat.format(HGCW003.getProvisionalQuantity().multiply(HGCW003.getUnitPriceExcludingTax())));
BigDecimal totalPriceIncluding = new BigDecimal(decimalFormat.format(totalPriceExcluding.multiply(taxPoints.add(new BigDecimal(1)))));
HGCW003.setTotalPriceExcluding(totalPriceExcluding);
HGCW003.setTotalPriceIncluding(totalPriceIncluding);
hgcw003List.add(HGCW003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
*
*/
public class ServiceHGCW099 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "上传",operDesc = "附件上传")
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
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.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,15:25
*/
public class ServiceHGCW999 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "物料清单-附件清单A-初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW999().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "物料清单-附件清单A-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HGCW999.queryRun", new HGCW999());
} else {
inInfo = super.query(inInfo, "HGCW999.queryDev", new HGCW999());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
public EiInfo queryDoc(EiInfo inInfo) {
try {
String docId = inInfo.getString("docId");
HGCW999 HGCW999 = new HGCW999();
List<HGCW999> list = new ArrayList<>();
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
list = this.dao.query("HGCW999.queryRun",map);
} else {
list = this.dao.query("HGCW999.queryDev",map);
}
if (CollectionUtils.isNotEmpty(list)) {
HGCW999 = list.get(0);
inInfo.set("data",HGCW999);
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
public void add(HGCW999 HGCW999) {
DaoUtils.insert("HGCW999.insert", HGCW999);
}
public void deleteEntity(HGCW999 HGCW999) {
DaoUtils.update("HGCW999.delete", HGCW999);
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "新增",operDesc = "物料清单-附件清单A-新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try {
Long matId = null;
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRows.get(i));
matId = fSc002A.getMatId();
this.add(fSc002A);
}
List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(matId,"HT");
eiInfo.addBlock("detail2").addRows(hgcw999List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(eiInfo, e, "新增失败");
}
return eiInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "物料清单-附件清单A-删除操作")
public EiInfo delete(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try {
Long matId = null;
List<Map> resultRows = inInfo.getBlock("detail2").getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRows.get(i));
matId = fSc002A.getMatId();
this.deleteEntity(fSc002A);
}
List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(matId,"HT");
eiInfo.addBlock("detail2").addRows(hgcw999List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(eiInfo, e, "删除失败");
}
return eiInfo;
}
/**
* 删除文件
* @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);
}
}
}
......@@ -23,27 +23,8 @@
-->
<sqlMap namespace="HGCW001">
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......
......@@ -47,27 +47,9 @@
-->
<sqlMap namespace="HGCW002">
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......@@ -417,6 +399,9 @@
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #contractType#, #contractCategory#, #partyA#, #partyB#, #partyC#, #planStartDate#, #planEndDate#, #contractStatus#, #partyAName#, #partyAPhoneNumber#, #alreadyName#, #alreadyPhoneNumber#, #engineeringAddress#, #signingDate#, #mainContractNumber#, #contractContent#, #contractingMethod#, #paymentMethod#, #pricingMethod#, #taxPoints#, #totalContractPriceExcluding#, #valueAddedTax#, #totalContractPriceIncluding#, #reviewStatus#, #balanceStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW002
</selectKey>
</insert>
<delete id="delete">
......
......@@ -28,27 +28,9 @@
-->
<sqlMap namespace="HGCW003">
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
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"> <!-- table information
Generate time : 2024-05-14 14:08:59
Version : 1.0
schema : hggp
tableName : HGCW999
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
DEP_CODE VARCHAR NOT NULL,
MAT_ID BIGINT,
DOC_ID VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
BIZ_TYPE VARCHAR
-->
<sqlMap namespace="HGCW999">
<sql id="column">
A.ID as "id", <!-- 主键ID -->
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.MAT_ID as "matId", <!-- 物料ID -->
A.DOC_ID as "docId", <!-- 文件ID -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.BIZ_TYPE as "bizType" <!-- 业务类型 -->
</sql>
<sql id="columnDev">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnRun">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
MAT_ID = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
BIZ_TYPE = #bizType#
</isNotEmpty>
</sql>
<!-- 开发环境 -->
<sql id="conditionDev">
AND A.DOC_ID = B.DOC_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<!-- 正式环境 -->
<sql id="conditionRun">
AND A.DOC_ID = B.RES_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="queryDev" resultClass="com.baosight.hggp.hg.cw.domain.HGCW999">
SELECT
<include refid="columnDev"/>
FROM ${hggpSchema}.HGCW999 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="countDev" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCW999 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
</select>
<select id="queryRun" resultClass="com.baosight.hggp.hg.cw.domain.HGCW999">
SELECT
<include refid="columnRun"/>
FROM ${hggpSchema}.HGCW999 A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="countRun" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCW999 A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW999 (ID, <!-- 主键ID -->
ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
DEP_CODE, <!-- 部门编码 预留 -->
MAT_ID, <!-- 物料ID -->
DOC_ID, <!-- 文件ID -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
BIZ_TYPE <!-- 业务类型 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #depCode#, #matId#, #docId#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #bizType#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCW999 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW999
SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
MAT_ID = #matId#, <!-- 物料ID -->
DOC_ID = #docId#, <!-- 文件ID -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
BIZ_TYPE = #bizType# <!-- 业务类型 -->
WHERE
ID = #id#
</update>
<update id="batchUpdate">
UPDATE ${hggpSchema}.HGCW999
SET
MAT_ID = #matId#, <!-- 物料ID -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE
DOC_ID IN <iterate close=")" open="(" conjunction="," property="docIds">#docIds[]#</iterate>
</update>
</sqlMap>
package com.baosight.hggp.hg.cw.tools;
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.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
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;
public class HGCWTools {
public static class HgCw002 {
public static UserVO getUserCompany() {
UserVO userVO = new UserVO();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname());
} else {
userVO.setUsercode(org.getOrgId());
userVO.setUsername(org.getOrgCname());
}
}
return userVO;
}
public static HGCW002 getId(String id) {
AssertUtils.isNull(id, "合同ID不能为空!");
List<HGCW002> results = DaoBase.getInstance().query(HGCW002.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
return results.get(0);
}
}
public static class HgCw003{
public static void save(List<Map> rows, String contractNumber, UserVO userVO) {
AssertUtils.isNull(contractNumber, "合同号不能为空!");
rows.forEach(row -> {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(row);
HGCW003.setCompanyCode(userVO.getUsercode());
HGCW003.setCompanyName(userVO.getUsername());
HGCW003.setContractNumber(contractNumber);
DaoUtils.insert(HGCW003.INSERT, HGCW003);
});
}
/**
* 根据合同号获取合同清单
* @param contractNumber
* @return
*/
public static List<HGCW003> queryByContractNumber(String contractNumber) {
AssertUtils.isNull(contractNumber, "合同号不能为空!");
List<HGCW003> results = DaoBase.getInstance().query(HGCW003.QUERY,new HashMap<String,Object>(){
{put("contractNumber",contractNumber);}
});
return results;
}
}
public static class HgCw999 {
public static void batchUpdate(List<Map> rows, Long id) {
AssertUtils.isNull(id, "业务ID不能为空!");
String[] docIds = rows.stream().map(row -> row.get("docId").toString()).toArray(String[]::new);
DaoUtils.update("HGCW999.batchUpdate", new HashMap<String,Object>(){
{put("docIds",docIds);}
{put("matId",id);}
});
}
public static List<HGCW999> queryByBiz(Long matId, String bizType) {
AssertUtils.isNull(matId, "业务ID不能为空!");
AssertUtils.isNull(bizType, "业务类型不能为空!");
List<HGCW999> results = new ArrayList<>();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
results = DaoBase.getInstance().query("HGCW999.queryRun",new HashMap<String,Object>(){
{put("matId",matId);}
{put("bizType",bizType);}
});
} else {
results = DaoBase.getInstance().query("HGCW999.queryDev",new HashMap<String,Object>(){
{put("matId",matId);}
{put("bizType",bizType);}
});
}
return results;
}
}
}
package com.baosight.hggp.hg.cw.vo;
public class UserVO {
private String username;
private String usercode;
public String getUsercode() {
return usercode;
}
public void setUsercode(String usercode) {
this.usercode = usercode;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
......@@ -12,6 +12,15 @@ import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.common.ed.domain.TEDCM01;
import com.baosight.hggp.hg.pz.domain.HGPZ002;
import com.baosight.hggp.hg.pz.domain.HGPZ003;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -35,7 +44,42 @@ import lombok.extern.slf4j.Slf4j;
*/
@Slf4j
public class HGPZTools {
public static class HgPz002 {
/**
* 查询
*
* @param status
* @return
*/
public static List<HGPZ002> list(Integer status) {
if (status == null) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("status", status);
return DaoBase.getInstance().query(HGPZ002.QUERY, queryMap);
}
}
public static class HgPz003 {
/**
* 查询
*
* @param supType
* @return
*/
public static List<HGPZ003> list(Integer supType) {
if (supType == null) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("status", 1);
queryMap.put("supType", supType);
return DaoBase.getInstance().query(HGPZ003.QUERY, queryMap);
}
}
/**
* 仓库管理
* HPPZ007 公共DAO定义
......@@ -391,20 +435,21 @@ public class HGPZTools {
}
}
public static class HgPz005A{
public static class HgPz005A {
/**
* 通过存货编码查询存货工序*
*
* @param inventCode
* @return
*/
public static List<HGPZ005A> queryByInventCode(String inventCode){
public static List<HGPZ005A> queryByInventCode(String inventCode) {
AssertUtils.isEmpty(inventCode, "存货编码不能为空!");
Map paramMap = new HashMap();
paramMap.put(HGPZ005A.FIELD_INVENT_CODE, inventCode);
List<HGPZ005A> results = DaoBase.getInstance().query(HGPZ005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
}
}
......@@ -211,5 +211,17 @@ public class ServiceHGSC001 extends ServiceBase {
return inInfo;
}
/**
* 项目下拉
* @param inInfo
* @return
*/
public EiInfo projectComboBox(EiInfo inInfo){
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID.getBlockId(),"projCode","projCode");
return inInfo;
}
}
......@@ -381,4 +381,11 @@
</isNotEmpty>
ORDER BY PROJ_CODE
</select>
<select id="queryProjectCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT distinct
proj_code as "projCode", <!-- 项目编码 -->
CONCAT(proj_code,"-",proj_name) as "projName" <!-- 项目名称 -->
FROM ${hggpSchema}.HGSC001 WHERE approval_status = 2
<include refid="condition" />
</select>
</sqlMap>
......@@ -300,6 +300,18 @@ public class HGXSTools {
List<Org> results = DaoBase.getInstance().query(HGSqlConstant.HgXsOrg.QUERY_PARENT, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(results.size() - 1);
}
/**
* 查询所有公司
*
* @return
*/
public static List<Org> queryCompanyAll() {
Map queryMap = new HashMap();
queryMap.put("orgType", OrgTypeEnum.COMPANY.getCode());
List<Org> results = DaoBase.getInstance().query(HGSqlConstant.HgXsOrg.QUERY_PARENT, queryMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
/**
* 查询所属厂区
......
......@@ -32,6 +32,11 @@
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC005A.xml"/>
<!-- 財務 -->
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW003.xml"/>
<!--配置-->
<sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ005A.xml"/>
......
......@@ -51,4 +51,4 @@
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/PZ/HGCW001.js"></script>
\ No newline at end of file
<script src="${ctx}/HG/CW/HGCW001.js"></script>
\ No newline at end of file
$(function() {
// 查询
......@@ -11,7 +12,16 @@ $(function() {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + contractDetailFunc(item.id) + '" target="_blank">合同详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + fileDetailFunc(item.id) + '" target="_blank">附件详情</a>';
return template;
}
}
],
loadComplete: function (e) {
$("#BTN_INSERT").on("click",addFunc);
......@@ -56,14 +66,31 @@ let query = function () {
* 新增
*/
function addFunc() {
console.log("新增");
JSColorbox.open({
href: "HGCW002A?methodName=initLoad&efParentFormEname=HGCW002",
title: "<div style='text-align: center;'>新增合同</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
/**
* 修改
*/
function updateFunc() {
console.log("修改");
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
JSColorbox.open({
href: "HGCW002B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW002",
title: "<div style='text-align: center;'>修改合同</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
/**
* 删除
......@@ -92,4 +119,18 @@ function deleteFunc() {
}
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function contractDetailFunc(id) {
return "";
}
function fileDetailFunc(id) {
return "";
}
......@@ -51,7 +51,7 @@
<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="200" align="center"/>
<EF:EFColumn ename="companyName" cname="所属公司" align="center" enable="false"/>
<EF:EFColumn ename="projCode" cname="项目编号" align="center" enable="false"/>
<EF:EFColumn ename="projName" cname="项目名称" align="center" enable="false"/>
......@@ -90,4 +90,4 @@
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/PZ/HGCW002.js"></script>
\ No newline at end of file
<script src="${ctx}/HG/CW/HGCW002.js"></script>
\ No newline at end of file
<!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}"/>
<head>
</head>
<EF:EFPage title="修改合同">
<EF:EFRegion id="inqu1" title="基本信息">
<div class="row">
<EF:EFInput ename="result-0-id" cname="id" type="hidden"/>
<EF:EFSelect cname="项目编号" ename="projCodeBox" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions
blockId="projectCodeBox_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-projCode" cname="项目编号" type="hidden"/>
<EF:EFInput ename="result-0-projName" cname="项目简称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-contractNumber" cname="合同号" colWidth="4" readonly="true" />
</div>
<div class="row">
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/>
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-contractCategory" cname="合同类别" type="hidden"/>
<EF:EFInput ename="contractCategoryName" cname="合同类别" colWidth="4" readonly="true"/>
<%-- <EF:EFSelect cname="合同类别" ename="result-0-contractCategory" colWidth="4" filter="contains" readonly="true" required="true">--%>
<%-- <EF:EFOption label="-- 请选择 --" value=""/>--%>
<%-- <EF:EFCodeOption codeName="hggp.cw.contractCategory"/>--%>
<%-- </EF:EFSelect>--%>
</div>
<div class="row">
<EF:EFPopupInput ename="popupInputPartyA" cname="甲方名称" colWidth="4"
serviceName="HGCW002A" methodName="partyAQuery"
resultId="partyAResult"
required="true" save="false" popupType="ServiceGrid"
valueField="username" textField="username"
columnEnames="username,usercode"
columnCnames="名称,编码"
readonly="true"
resizable="true" popupTitle="甲方名称" popupWidth="400">
</EF:EFPopupInput>
<EF:EFInput ename="result-0-partyA" cname="甲方名称" type="hidden" />
<EF:EFPopupInput ename="popupInputPartyB" cname="乙方名称" colWidth="4"
serviceName="HGCW002A" methodName="partyBQuery"
resultId="partyAResult"
save="false" popupType="ServiceGrid"
valueField="username" textField="username"
columnEnames="username,usercode"
columnCnames="名称,编码"
readonly="true"
resizable="true" popupTitle="乙方名称" popupWidth="400">
</EF:EFPopupInput>
<EF:EFInput ename="result-0-partyB" cname="乙方名称" type="hidden"/>
<EF:EFInput ename="result-0-partyC" cname="丙方" colWidth="4" />
</div>
<div class="row">
<EF:EFDateSpan startCname="计划开工/竣工日期" endCname="至" required="true" colWidth="8" blockId="result"
startName="planStartDate" endName="planEndDate" row="0" role="date"
format="yyyy-MM-dd" ratio="4:4" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
<EF:EFSelect cname="合同状态" ename="result-0-contractStatus" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractStatus"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput ename="result-0-partyAName" cname="甲方联系人姓名" colWidth="4" />
<EF:EFInput ename="result-0-partyAPhoneNumber" cname="甲方联系人电话" colWidth="4" />
<EF:EFInput ename="result-0-alreadyName" cname="已方联系人姓名" colWidth="4" />
</div>
<div class="row">
<EF:EFInput ename="result-0-alreadyPhoneNumber" cname="已方联系人电话" colWidth="4" />
<EF:EFInput ename="result-0-engineeringAddress" cname="工程地址" colWidth="8" ratio="2:10" required="true"/>
</div>
<div class="row">
<EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput ename="result-0-mainContractNumber" cname="主合同号" colWidth="8" ratio="2:10"/>
</div>
<div class="row">
<EF:EFInput type="textarea" ename="result-0-contractContent" cname="合同内容" colWidth="8" ratio="2:10" required="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="inqu2" title="承包方式及合同价款">
<div class="row">
<EF:EFInput ename="result-0-contractingMethod" cname="承包方式" colWidth="4" />
<EF:EFSelect cname="付款方式" ename="result-0-paymentMethod" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.paymentMethod"/>
</EF:EFSelect>
<EF:EFSelect cname="计价方式" ename="result-0-pricingMethod" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.pricingMethod"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="税点" ename="result-0-taxPoints" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-valueAddedTax" cname="增值税" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="contractNumber" cname="合同号" hidden="true"/>
<EF:EFColumn ename="inventory" cname="清单" align="center" />
<EF:EFColumn ename="unit" cname="单位" align="center" />
<EF:EFColumn ename="provisionalQuantity" cname="暂定工程量" format="{0:N3}" align="center"/>
<EF:EFColumn ename="measurementMethod" cname="计量方式" align="center" />
<EF:EFColumn ename="supplyMethod" cname="材料供应方式" align="center"/>
<EF:EFColumn ename="unitPriceExcludingTax" cname="除税单价/元" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceExcluding" cname="不含税总价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceIncluding" cname="含税总价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="laborCosts" cname="其中人工费、元" format="{0:N3}" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail2" title="附件信息">
<EF:EFGrid blockId="detail2" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="matId" cname="matId" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HG/CW/HGCW002B.js"></script>
\ No newline at end of file
$(function () {
IPLATUI.EFUpload = {
uploadFile: {
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
return;
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
var matId = $("#inqu_status-0-matId").val();
var bizType = $("#inqu_status-0-bizType").val();
console.log($("#fileDocId").val())
console.log($("#inqu_status-0-matId").val())
console.log($("#inqu_status-0-bizType").val())
var data = {
docId: docId,
matId: matId,
bizType: bizType
}
// saveTemp(e);
try {
parent.JSColorbox.setValueCallback(data);
} catch (e){
}
},
}
};
function saveTemp(e) {
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
let result = new EiInfo();
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HGDS002", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
<!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}"/>
<EF:EFPage title="附件上传">
<EF:EFInput cname="物料ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hk_file11" path="A"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment