Commit 06c0d0b3 by wuwenlong

项目立项修改BUGFIX;

parent e7ae2777
......@@ -22,7 +22,7 @@ public class HGSC001 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id";
public static final String FIELD_id = "id";
public static final String FIELD_company_code = "companyCode"; /* 公司编码*/
public static final String FIELD_company_name = "companyName"; /* 公司名称*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
......@@ -51,7 +51,7 @@ public class HGSC001 extends DaoEPBase {
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 更新时间*/
public static final String COL_id = "id";
public static final String COL_id = "id";
public static final String COL_company_code = "company_code"; /* 公司编码*/
public static final String COL_company_name = "company_name"; /* 公司名称*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/
......@@ -90,34 +90,34 @@ public class HGSC001 extends DaoEPBase {
public static final String BATCH_COMMIT = "HGSC001.batch_commit";
private Long id = new Long(0);
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String depCode = " "; /* 部门编码*/
private String depName = " "; /* 部门名称*/
private String subcontractCode = " "; /* 分包商编码*/
private String subcontractName = " "; /* 分包商名称*/
private String genralContractCode = " "; /* 总包商编码*/
private String genralContractName = " "; /* 总包商名称*/
private String partyPmName = " "; /* 甲方项目经理名称*/
private String partyPmHpone = " "; /* 甲方项目经理联系电话*/
private String contractName = " "; /* 合同名称*/
private String contractWorkTxt = " "; /* 合同工作量*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String projType = " "; /* 项目性质*/
private Long id = new Long(0);
private String companyCode = ""; /* 公司编码*/
private String companyName = ""; /* 公司名称*/
private String depCode = ""; /* 部门编码*/
private String depName = ""; /* 部门名称*/
private String subcontractCode = ""; /* 分包商编码*/
private String subcontractName = ""; /* 分包商名称*/
private String genralContractCode = ""; /* 总包商编码*/
private String genralContractName = ""; /* 总包商名称*/
private String partyPmName = ""; /* 甲方项目经理名称*/
private String partyPmHpone = ""; /* 甲方项目经理联系电话*/
private String contractName = ""; /* 合同名称*/
private String contractWorkTxt = ""; /* 合同工作量*/
private String projCode = ""; /* 项目编码*/
private String projName = ""; /* 项目名称*/
private String projType = ""; /* 项目性质*/
private Integer projStatus = new Integer(0); /* 项目状态\t0:在建;1:完工*/
private Integer approvalStatus = new Integer(0); /* 审批状态\t0:待审;1:审核中;2:已审*/
private String permissStartDate = " "; /* 准许开工日期*/
private String startDate = " "; /* 开工日期*/
private String endDate = " "; /* 完工日期*/
private String accountCode = " "; /* 帐套*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
private String permissStartDate = ""; /* 准许开工日期*/
private String startDate = ""; /* 开工日期*/
private String endDate = ""; /* 完工日期*/
private String accountCode = ""; /* 帐套*/
private String createdBy = ""; /* 创建人*/
private String createdName = ""; /* 创建人名称*/
private String createdTime = ""; /* 创建时间*/
private String updatedBy = ""; /* 更新人*/
private String updatedName = ""; /* 修改人名称*/
private String updatedTime = ""; /* 更新时间*/
/**
* initialize the metadata.
......@@ -127,7 +127,7 @@ public class HGSC001 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_id);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiColumn.setDescName("");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_code);
......@@ -259,7 +259,7 @@ public class HGSC001 extends DaoEPBase {
/**
* set the id .
*
* @param id
* @param id
*/
public void setId(Long id) {
this.id = id;
......
......@@ -131,15 +131,10 @@ public class ServiceHGSC001 extends ServiceBase {
*
* @param hgsc001
*/
private void checkSaveData(HGSC001 hgsc001) throws InstantiationException, IllegalAccessException {
private void checkSaveData(HGSC001 hgsc001) {
if(Objects.nonNull(hgsc001.getId())&&hgsc001.getId()>0){
EiInfo inInfo = new EiInfo();
EiInfoUtils.addBlock(inInfo,EiConstant.queryBlock, new HGSC001(){{setId(hgsc001.getId());}}, HGSC001.class);
inInfo = super.query(inInfo,HGSC001.QUERY,new HGSC001());
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC001 oldHgsc001 = new HGSC001();
oldHgsc001.fromMap(resultMap);
AssertUtils.isTrue(oldHgsc001.getApprovalStatus() == CommonConstant.YesNo.NO_0,"项目已提交不可修改!");
HGSC001 oldHgsc001 = (HGSC001) super.dao.get(HGSC001.QUERY,HGSC001.FIELD_id,hgsc001.getId());
AssertUtils.isTrue(oldHgsc001.getApprovalStatus().compareTo(CommonConstant.YesNo.NO_0) == 1,"项目已提交不可修改!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
......
......@@ -4,10 +4,10 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.ListUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author wwl
......@@ -47,7 +47,10 @@ public class HGSCTools {
*/
public static void checkProjMgData(List<HGSC001A> objList) {
AssertUtils.isEmpty(objList, "项目负责人不能为空!");
AssertUtils.isTrue(ListUtils.allSameProperty(objList,HGSC001A::getUserCode), "项目负责人重复!");
List<String> stringList = objList.stream().map(HGSC001A::getUserCode)
.collect(Collectors.toList());
long count = stringList.stream().distinct().count();
AssertUtils.isTrue(stringList.size() != count, "项目负责人重复!");
}
public static List<HGSC001A> save(List<HGSC001A> hgsc001AList, Long projId){
......
package com.baosight.hggp.util;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;
/**
* @Author wwl
* @Date 2024/5/10 10:11
*/
public class ListUtils {
public static <T> boolean allSameProperty(List<T> list, Function<T, ?> propertyExtractor) {
if (list == null || list.isEmpty()) {
return true;
}
Object firstValue = propertyExtractor.apply(list.get(0));
return list.stream().allMatch(item -> Objects.equals(firstValue, propertyExtractor.apply(item)));
}
}
......@@ -106,7 +106,8 @@ function update() {
width: "90%",
height: "90%",
callbackName: windowCallback
});}
});
}
function remove() {
let rows = resultGrid.getCheckedRows()
......@@ -203,7 +204,7 @@ function commit() {
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
resultGrid.dataSource.query();
// 关闭弹窗
JSColorbox.close();
}
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