Commit 1e7d9205 by YG6494

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

parents 051a6d1c 073808df
...@@ -70,7 +70,7 @@ public class HGConstant { ...@@ -70,7 +70,7 @@ public class HGConstant {
//生产订单 //生产订单
public static final String HGSC006_ORDER_CODE = "HGSC006_ORDER_CODE"; public static final String HGSC006_ORDER_CODE = "HGSC006_ORDER_CODE";
//生产任务 //生产任务
public static final String HGSC007_TASCK_CODE = "HGSC007_TASCK_CODE"; public static final String HGSC007_TASK_CODE = "HGSC007_TASK_CODE";
//生产任务订单 //生产任务订单
public static final String PROD_TASK_NO = "PROD_TASK_NO"; public static final String PROD_TASK_NO = "PROD_TASK_NO";
//售后维修单号 //售后维修单号
...@@ -107,6 +107,8 @@ public class HGConstant { ...@@ -107,6 +107,8 @@ public class HGConstant {
public static final String BLUEPRINT_CODE = "BLUEPRINT_CODE"; public static final String BLUEPRINT_CODE = "BLUEPRINT_CODE";
public static final String CW_CONTRACT_NO = "CW_CONTRACT_NO"; public static final String CW_CONTRACT_NO = "CW_CONTRACT_NO";
public static final String CW_SETTLEMENT_NO = "CW_SETTLEMENT_NO";
} }
/** /**
......
...@@ -22,10 +22,7 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -22,10 +22,7 @@ import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.Arrays; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author yukang * @author yukang
...@@ -262,15 +259,34 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -262,15 +259,34 @@ public class ServiceHGCW002 extends ServiceBase {
public EiInfo projectComboBox(EiInfo inInfo){ public EiInfo projectComboBox(EiInfo inInfo){
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<String> contractTypArray = new ArrayList<>();
if (StringUtils.isNotEmpty(inInfo.getString("reviewStatus"))) { if (StringUtils.isNotEmpty(inInfo.getString("reviewStatus"))) {
map.put("reviewStatus", inInfo.getString("reviewStatus")); map.put("reviewStatus", inInfo.getString("reviewStatus"));
} }
if (StringUtils.isNotEmpty(inInfo.getString("contractType"))) { if (StringUtils.isNotEmpty(inInfo.getString("contractType"))) {
map.put("contractType", inInfo.getString("contractType")); map.put("contractType", inInfo.getString("contractType"));
} }
if (StringUtils.isNotEmpty(inInfo.getString("contractTyps"))) {
String[] contractTyps = inInfo.getString("contractTyps").split(",");
for (String c : contractTyps) {
contractTypArray.add(c);
}
map.put("contractTyps", contractTypArray);
}
List<HGCW002> HGCW002List = dao.query("HGCW002.queryProjectComboBox", map); List<HGCW002> HGCW002List = dao.query("HGCW002.queryProjectComboBox", map);
inInfo.addBlock("projcet_combo_box").setRows(HGCW002List); inInfo.addBlock("projcet_combo_box").setRows(HGCW002List);
return inInfo; return inInfo;
} }
public EiInfo queryContractByType(EiInfo inInfo){
Map<String, Object> map = new HashMap<>();
if (StringUtils.isNotEmpty(inInfo.getString("reviewStatus"))) {
map.put("reviewStatus", "3");
}
List<HGCW002> HGCW002List = dao.query("HGCW002.queryContractByType",map);
inInfo.addBlock("contract_combo_box").setRows(HGCW002List);
return inInfo;
}
} }
...@@ -193,10 +193,7 @@ public class ServiceHGCW004 extends ServiceBase { ...@@ -193,10 +193,7 @@ public class ServiceHGCW004 extends ServiceBase {
// * 上传附件 // * 上传附件
// * @param inInfo // * @param inInfo
// * @return // * @return
// */ // *
// @OperationLogAnnotation(operModul = "账期维护",operType = "上传附件",operDesc = "上传附件")
// public EiInfo form(EiInfo inInfo) {
// return inInfo;
// } // }
@OperationLogAnnotation(operModul = "账期维护",operType = "上传附件",operDesc = "上传附件操作") @OperationLogAnnotation(operModul = "账期维护",operType = "上传附件",operDesc = "上传附件操作")
public EiInfo updateDocId(EiInfo inInfo){ public EiInfo updateDocId(EiInfo 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.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW008;
import com.baosight.hggp.hg.cw.domain.HGCW007;
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;
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.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW008 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "租赁合同",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW008().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, HGCW008.QUERY, new HGCW008());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "租赁合同",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map> detail1Rows = inInfo.getBlock("detail1").getRows();
if (CollectionUtils.isNotEmpty(resultRows)) {
HGCW008 HGCW008 = new HGCW008();
HGCW008.fromMap(resultRows.get(0));
if (HGCW008.getId() == null || HGCW008.getId() == 0) {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
String settlementNumber = SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_SETTLEMENT_NO);
HGCW008.setCompanyCode(userVO.getUsercode());
HGCW008.setCompanyName(userVO.getUsername());
HGCW008.setSettlementNumber(settlementNumber);
HGCW008.setReviewStatus(0);
HGCW008.setContractDate(DateUtils.formatShort(HGCW008.getContractDate()));
this.add(HGCW008);
// 写入其他数据
HGCWTools.HgCw009.save(detail1Rows,settlementNumber,userVO);
// 更新合同结算状态
HGCWTools.HgCw002.updateBalanceStatus(HGCW008.getContractNumber(),HGCW008.getSettlementType() + 1);
} else {
BigDecimal totalContractPriceExcluding = new BigDecimal(0);
BigDecimal totalContractPriceIncluding = new BigDecimal(0);
BigDecimal valueAddedTax = new BigDecimal(0);
BigDecimal totalQuantity = new BigDecimal(0);
//计算合同清单金额
for (int i = 0; i < detail1Rows.size(); i++) {
HGCW007 hgcw007 = new HGCW007();
hgcw007.fromMap(detail1Rows.get(i));
totalContractPriceExcluding = totalContractPriceExcluding.add(hgcw007.getTotalPrice());
totalQuantity = totalQuantity.add(hgcw007.getDeviceNumber());
}
BigDecimal taxPoints = new BigDecimal(HGCW008.getTaxPoints() / 100);
totalContractPriceIncluding = totalContractPriceExcluding.multiply(taxPoints.add(new BigDecimal(1)));
valueAddedTax = totalContractPriceIncluding.subtract(totalContractPriceExcluding);
DecimalFormat decimalFormat = new DecimalFormat("#.000");
this.modify(HGCW008);
// 更新合同结算状态
HGCWTools.HgCw002.updateBalanceStatus(HGCW008.getContractNumber(),HGCW008.getSettlementType() + 1);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW008
* @return
*/
public void add(HGCW008 HGCW008) {
DaoUtils.insert("HGCW008.insert", HGCW008);
}
/**
* 修改操作
*
* @param HGCW008
* @return
*/
public void modify(HGCW008 HGCW008) {
DaoUtils.update("HGCW008.update", HGCW008);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "租赁合同",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW008.delete", resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 提交操作
* @param inInfo
* @return
*/
public EiInfo submit(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW008 HGCW008 = new HGCW008();
HGCW008.fromMap(resultRows.get(i));
HGCW008.setReviewStatus(3);
DaoUtils.update("HGCW008.submit", HGCW008);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
public EiInfo queryCalculateAmount(EiInfo inInfo) {
try {
Map map = new HashMap();
String contractNumber = inInfo.getString("contractNumber");
map.put("contractNumber", contractNumber);
List result = dao.query("HGCW008.queryCalculateAmount", map);
inInfo.set("result", result);
} 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.hggp.common.DdynamicEnum;
import com.baosight.hggp.hg.cw.domain.HGCW008;
import com.baosight.hggp.hg.cw.vo.UserVO;
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.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;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW008A 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 HGCW008().eiMetadata);
} 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.HGCW008;
import com.baosight.hggp.hg.cw.domain.HGCW007;
import com.baosight.hggp.hg.cw.domain.HGCW009;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
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 java.util.Arrays;
import java.util.List;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW008B extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "修改合同",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
String id = inInfo.getString("id");
HGCW008 HGCW008 = HGCWTools.HgCw008.getId(id);
inInfo.addBlock(EiConstant.resultBlock).addRow(HGCW008);
//获取清单
List<HGCW009> hgcw009List = HGCWTools.HgCw009.queryBySettlementNumber(HGCW008.getSettlementNumber());
inInfo.addBlock("detail1").addRows(hgcw009List);
} 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.hg.cw.domain.HGCW006;
import com.baosight.hggp.hg.cw.domain.HGCW007;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
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 java.util.List;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW008C 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");
HGCW006 HGCW006 = HGCWTools.HgCw006.getId(id);
inInfo.addBlock(EiConstant.resultBlock).addRow(HGCW006);
//获取清单
List<HGCW007> hgcw007List = HGCWTools.HgCw007.queryByContractNumber(HGCW006.getContractNumber());
inInfo.addBlock("detail1").addRows(hgcw007List);
List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(HGCW006.getId(),"ZL");
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.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW006;
import com.baosight.hggp.hg.cw.domain.HGCW007;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtils;
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 java.util.ArrayList;
import java.util.List;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW008D 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 {
List<String> ids = new ArrayList<>();
String inventoryIds = inInfo.getString("inqu_status-0-inventoryIds");
if (StringUtils.isNotEmpty(inventoryIds)) {
String[] inventoryIdsArr = inventoryIds.split(",");
for (String id : inventoryIdsArr) {
ids.add(id);
}
inInfo.set("inqu_status-0-ids", ids);
}
inInfo = super.query(inInfo, HGCW003.QUERY, new HGCW003());
} 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.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW005;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtils;
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 java.util.ArrayList;
import java.util.List;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW008E extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock("result1").addBlockMeta(new HGCW003().eiMetadata);
inInfo.addBlock("result2").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 {
List<String> ids = new ArrayList<>();
List<String> dids = new ArrayList<>();
String inventoryIds = inInfo.getString("inqu_status-0-inventoryIds");
String deductionIds = inInfo.getString("inqu_status-0-deductionIds");
if (StringUtils.isNotEmpty(inventoryIds)) {
String[] inventoryIdsArr = inventoryIds.split(",");
for (String id : inventoryIdsArr) {
ids.add(id);
}
inInfo.set("inqu_status-0-ids", ids);
}
inInfo = super.query(inInfo, HGCW003.QUERY, new HGCW003(),new HGCW003().eiMetadata,"","","result1",false);
if (StringUtils.isNotEmpty(deductionIds)) {
String[] deductionIdsArr = deductionIds.split(",");
for (String id : deductionIdsArr) {
dids.add(id);
}
inInfo.set("inqu_status-0-dids", dids);
}
inInfo = super.query(inInfo, HGCW005.QUERY, new HGCW005(),new HGCW005().eiMetadata,"","","result2",false);
} 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.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW007;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
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 java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW009 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW007().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, HGCW007.QUERY, new HGCW007());
} 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++) {
HGCW007 HGCW007 = new HGCW007();
HGCW007.fromMap(resultRows.get(i));
contractNumber = HGCW007.getContractNumber();
if (HGCW007.getId() == null || HGCW007.getId() == 0) {
this.add(HGCW007);
} else {
this.modify(HGCW007);
}
}
List<HGCW007> HGCW007List = HGCWTools.HgCw007.queryByContractNumber(contractNumber);
eiInfo.addBlock("detail1").addRows(HGCW007List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return eiInfo;
}
/**
* 新增操作
*
* @param HGCW007
* @return
*/
public void add(HGCW007 HGCW007) {
DaoUtils.insert("HGCW007.insert", HGCW007);
}
/**
* 修改操作
*
* @param HGCW007
* @return
*/
public void modify(HGCW007 HGCW007) {
DaoUtils.update("HGCW007.update", HGCW007);
}
public void deleteEntity(HGCW007 HGCW007) {
DaoUtils.update("HGCW007.delete", HGCW007);
}
/**
* 删除操作
*
* @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++) {
HGCW007 HGCW007 = new HGCW007();
HGCW007.fromMap(resultRows.get(i));
contractNumber = HGCW007.getContractNumber();
this.deleteEntity(HGCW007);
}
List<HGCW007> HGCW007List = HGCWTools.HgCw007.queryByContractNumber(contractNumber);
eiInfo.addBlock("detail1").addRows(HGCW007List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return eiInfo;
}
public EiInfo queryEngineeringQuantity(EiInfo inInfo) {
try {
Map map = new HashMap();
String inventoryId = inInfo.getString("inventoryId");
map.put("inventoryId", inventoryId);
List result = dao.query("HGCW009.queryEngineeringQuantity", map);
inInfo.set("result", result.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
...@@ -510,9 +510,24 @@ ...@@ -510,9 +510,24 @@
<isNotEmpty prepend=" AND " property="contractType"> <isNotEmpty prepend=" AND " property="contractType">
CONTRACT_TYPE = #contractType# CONTRACT_TYPE = #contractType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="contractTyps">
CONTRACT_TYPE IN <iterate close=")" open="(" conjunction="," property="contractTyps">#contractTyps[]#</iterate>
</isNotEmpty>
ORDER BY CONTRACT_NUMBER ORDER BY CONTRACT_NUMBER
</select> </select>
<update id="updateBalanceStatus">
UPDATE ${hggpSchema}.HGCW002
SET
BALANCE_STATUS = #balanceStatus#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
CONTRACT_NUMBER = #contractNumber#
</update>
<update id="submit"> <update id="submit">
UPDATE ${hggpSchema}.HGCW002 UPDATE ${hggpSchema}.HGCW002
SET SET
...@@ -524,4 +539,28 @@ ...@@ -524,4 +539,28 @@
ID = #id# ID = #id#
</update> </update>
<select id="queryContractByType" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW002">
SELECT DISTINCT
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 合同号 -->
CONTRACT_NAME as "contractName", <!-- 合同名称 -->
TOTAL_CONTRACT_PRICE_EXCLUDING as "totalContractPriceExcluding", <!-- 合同总价(不含税) -->
CONTRACT_TYPE as contractType, <!-- 合同类型;1销售合同2劳务合同3补充协议4合同外用工 -->
PARTY_A as "partyA", <!-- 甲方名称 -->
PARTY_B as "partyB" <!-- 乙方名称 -->
FROM ${hggpSchema}.HGCW002
WHERE 1=1 AND REVIEW_STATUS= 3 AND CONTRACT_TYPE IN (1,2)
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
ORDER BY CONTRACT_NUMBER
</select>
</sqlMap> </sqlMap>
...@@ -94,6 +94,9 @@ ...@@ -94,6 +94,9 @@
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID NOT IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
......
...@@ -92,6 +92,9 @@ ...@@ -92,6 +92,9 @@
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="dids">
ID NOT IN <iterate close=")" open="(" conjunction="," property="dids">#dids[]#</iterate>
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
......
...@@ -45,6 +45,15 @@ public class HGCWTools { ...@@ -45,6 +45,15 @@ public class HGCWTools {
}); });
return results.get(0); return results.get(0);
} }
public static void updateBalanceStatus(String contractNumber, Integer balanceStatus ) {
AssertUtils.isNull(contractNumber, "合同号不能为空!");
AssertUtils.isNull(balanceStatus, "结算状态不能为空!");
DaoUtils.update("HGCW002.updateBalanceStatus", new HashMap<String,Object>(){
{put("contractNumber",contractNumber);}
{put("balanceStatus",balanceStatus);}
});
}
} }
public static class HgCw003{ public static class HgCw003{
...@@ -112,6 +121,44 @@ public class HGCWTools { ...@@ -112,6 +121,44 @@ public class HGCWTools {
} }
} }
public static class HgCw008 {
public static HGCW008 getId(String id) {
AssertUtils.isNull(id, "结算单ID不能为空!");
List<HGCW008> results = DaoBase.getInstance().query(HGCW008.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
return results.get(0);
}
}
public static class HgCw009 {
public static void save(List<Map> rows, String settlementNumber, UserVO userVO) {
AssertUtils.isNull(settlementNumber, "结算单号不能为空!");
rows.forEach(row -> {
HGCW009 hgcw009 = new HGCW009();
hgcw009.fromMap(row);
hgcw009.setCompanyCode(userVO.getUsercode());
hgcw009.setCompanyName(userVO.getUsername());
hgcw009.setSettlementNumber(settlementNumber);
DaoUtils.insert(HGCW009.INSERT, hgcw009);
});
}
/**
* 根据合同号获取合同清单
* @param settlementNumber
* @return
*/
public static List<HGCW009> queryBySettlementNumber(String settlementNumber) {
AssertUtils.isNull(settlementNumber, "结算单号不能为空!");
List<HGCW009> results = DaoBase.getInstance().query(HGCW009.QUERY,new HashMap<String,Object>(){
{put("contractNumber",settlementNumber);}
});
return results;
}
}
public static class HgCw999 { public static class HgCw999 {
public static void batchUpdate(List<Map> rows, Long id) { public static void batchUpdate(List<Map> rows, Long id) {
......
...@@ -32,6 +32,7 @@ public class HGSB007 extends DaoEPBase { ...@@ -32,6 +32,7 @@ public class HGSB007 extends DaoEPBase {
public static final String FIELD_UPKEEP_CODE = "upkeepCode"; /* 保养单号*/ public static final String FIELD_UPKEEP_CODE = "upkeepCode"; /* 保养单号*/
public static final String FIELD_GROUP_CODE = "groupCode"; /* 设备区域编码*/ public static final String FIELD_GROUP_CODE = "groupCode"; /* 设备区域编码*/
public static final String FIELD_GROUP_NAME = "groupName"; /* 设备区域名称*/ public static final String FIELD_GROUP_NAME = "groupName"; /* 设备区域名称*/
public static final String FIELD_PLAN_CODE = "planCode"; /* 计划单号*/
public static final String FIELD_PLAN_START_DATE = "planStartDate"; /* 计划开始日期*/ public static final String FIELD_PLAN_START_DATE = "planStartDate"; /* 计划开始日期*/
public static final String FIELD_PLAN_END_DATE = "planEndDate"; /* 计划结束日期*/ public static final String FIELD_PLAN_END_DATE = "planEndDate"; /* 计划结束日期*/
public static final String FIELD_DEVICE_TYPE = "deviceType"; /* 设备类型*/ public static final String FIELD_DEVICE_TYPE = "deviceType"; /* 设备类型*/
...@@ -90,6 +91,7 @@ public class HGSB007 extends DaoEPBase { ...@@ -90,6 +91,7 @@ public class HGSB007 extends DaoEPBase {
private String upkeepCode = " "; /* 保养单号*/ private String upkeepCode = " "; /* 保养单号*/
private String groupCode = " "; /* 设备区域编码*/ private String groupCode = " "; /* 设备区域编码*/
private String groupName = " "; /* 设备区域名称*/ private String groupName = " "; /* 设备区域名称*/
private String planCode = " "; /* 计划单号*/
private String planStartDate = " "; /* 计划开始日期*/ private String planStartDate = " "; /* 计划开始日期*/
private String planEndDate = " "; /* 计划结束日期*/ private String planEndDate = " "; /* 计划结束日期*/
private String deviceType = " "; /* 设备类型*/ private String deviceType = " "; /* 设备类型*/
...@@ -170,6 +172,10 @@ public class HGSB007 extends DaoEPBase { ...@@ -170,6 +172,10 @@ public class HGSB007 extends DaoEPBase {
eiColumn.setDescName("保养单号"); eiColumn.setDescName("保养单号");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_CODE);
eiColumn.setDescName("计划单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_START_DATE); eiColumn = new EiColumn(FIELD_PLAN_START_DATE);
eiColumn.setDescName("计划开始日期"); eiColumn.setDescName("计划开始日期");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -634,6 +640,14 @@ public class HGSB007 extends DaoEPBase { ...@@ -634,6 +640,14 @@ public class HGSB007 extends DaoEPBase {
this.planEndDate = planEndDate; this.planEndDate = planEndDate;
} }
public String getPlanCode() {
return planCode;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -671,6 +685,7 @@ public class HGSB007 extends DaoEPBase { ...@@ -671,6 +685,7 @@ public class HGSB007 extends DaoEPBase {
setRemainderDays(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REMAINDER_DAYS)), remainderDays)); setRemainderDays(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REMAINDER_DAYS)), remainderDays));
setPlanStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_START_DATE)), planStartDate)); setPlanStartDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_START_DATE)), planStartDate));
setPlanEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_END_DATE)), planEndDate)); setPlanEndDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_END_DATE)), planEndDate));
setPlanCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_CODE)), planCode));
} }
/** /**
...@@ -709,6 +724,7 @@ public class HGSB007 extends DaoEPBase { ...@@ -709,6 +724,7 @@ public class HGSB007 extends DaoEPBase {
map.put(FIELD_REMAINDER_DAYS, StringUtils.toString(remainderDays, eiMetadata.getMeta(FIELD_REMAINDER_DAYS))); map.put(FIELD_REMAINDER_DAYS, StringUtils.toString(remainderDays, eiMetadata.getMeta(FIELD_REMAINDER_DAYS)));
map.put(FIELD_PLAN_START_DATE, StringUtils.toString(planStartDate, eiMetadata.getMeta(FIELD_PLAN_START_DATE))); map.put(FIELD_PLAN_START_DATE, StringUtils.toString(planStartDate, eiMetadata.getMeta(FIELD_PLAN_START_DATE)));
map.put(FIELD_PLAN_END_DATE, StringUtils.toString(planEndDate, eiMetadata.getMeta(FIELD_PLAN_END_DATE))); map.put(FIELD_PLAN_END_DATE, StringUtils.toString(planEndDate, eiMetadata.getMeta(FIELD_PLAN_END_DATE)));
map.put(FIELD_PLAN_CODE, StringUtils.toString(planCode, eiMetadata.getMeta(FIELD_PLAN_CODE)));
return map; return map;
} }
......
...@@ -91,6 +91,7 @@ public class ServiceHGSB004 extends ServiceEPBase { ...@@ -91,6 +91,7 @@ public class ServiceHGSB004 extends ServiceEPBase {
map1.put(HGSB002.FIELD_PLAN_CODE,hgsb004.getPlanCode()); map1.put(HGSB002.FIELD_PLAN_CODE,hgsb004.getPlanCode());
map1.put(HGSB002.FIELD_PLAN_START_DATE,hgsb004.getPlanStartDate()); map1.put(HGSB002.FIELD_PLAN_START_DATE,hgsb004.getPlanStartDate());
map1.put(HGSB002.FIELD_PLAN_END_DATE,hgsb004.getPlanEndDate()); map1.put(HGSB002.FIELD_PLAN_END_DATE,hgsb004.getPlanEndDate());
map1.put(HGSB002.FIELD_PLAN_TYPE,1);
List<HGSB002> list = DaoBase.getInstance().query(HGSB002.QUERY, map1); List<HGSB002> list = DaoBase.getInstance().query(HGSB002.QUERY, map1);
for (HGSB002 hgsb002 : list){ for (HGSB002 hgsb002 : list){
hgsb002.setTaskStatus(0); hgsb002.setTaskStatus(0);
......
...@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.sb.service; ...@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.sb.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; 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.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
...@@ -77,26 +78,32 @@ public class ServiceHGSB005 extends ServiceEPBase { ...@@ -77,26 +78,32 @@ public class ServiceHGSB005 extends ServiceEPBase {
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
int i = 0; int i = 0;
try { try {
HGSB005 hgsb005 = new HGSB005();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) { for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HGSB005 hgsb005 = new HGSB005();
hgsb005.fromMap(map); hgsb005.fromMap(map);
hgsb005.setDeleteFlag(CommonConstant.YesNo.YES_1); hgsb005.setDeleteFlag(CommonConstant.YesNo.YES_1);
if (hgsb005.getCheckStatus()==1) { if (hgsb005.getCheckStatus()==1) {
String str = "设备保养已审批完成,无法删除!"; throw new PlatException("设备保养已审批完成,无法删除!");
throw new PlatException(str); }
Map map1 = new HashMap<>();
map1.put(HGSB002.FIELD_COMPANY_CODE,hgsb005.getCompanyCode());
map1.put(HGSB002.FIELD_PLAN_CODE,hgsb005.getPlanCode());
map1.put(HGSB002.FIELD_PLAN_START_DATE,hgsb005.getPlanStartDate());
map1.put(HGSB002.FIELD_PLAN_END_DATE,hgsb005.getPlanEndDate());
map1.put(HGSB002.FIELD_PLAN_TYPE,2);
List<HGSB002> list = DaoBase.getInstance().query(HGSB002.QUERY, map1);
for (HGSB002 hgsb002 : list){
hgsb002.setTaskStatus(0);
DaoUtils.update(HGSB002.UPDATE, hgsb002);
} }
DaoUtils.update(HGSB005.DELETE_FLAG, hgsb005.toMap()); DaoUtils.update(HGSB005.DELETE_FLAG, hgsb005.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) { } catch (PlatException e) {
e.printStackTrace(); LogUtils.setDetailMsg(inInfo, e, "删除失败");
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
} }
return inInfo; return inInfo;
} }
...@@ -157,11 +164,7 @@ public class ServiceHGSB005 extends ServiceEPBase { ...@@ -157,11 +164,7 @@ public class ServiceHGSB005 extends ServiceEPBase {
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) { } catch (PlatException e) {
e.printStackTrace(); LogUtils.setDetailMsg(inInfo, e, "修改失败");
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
} }
return inInfo; return inInfo;
} }
......
...@@ -4,9 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; ...@@ -4,9 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002; import com.baosight.hggp.hg.sb.domain.*;
import com.baosight.hggp.hg.sb.domain.HGSB005A;
import com.baosight.hggp.hg.sb.domain.HGSB005;
import com.baosight.hggp.hg.sb.tools.HGSBTools; import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
...@@ -63,10 +61,16 @@ public class ServiceHGSB005A extends ServiceEPBase { ...@@ -63,10 +61,16 @@ public class ServiceHGSB005A extends ServiceEPBase {
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
int i = 0; int i = 0;
try { try {
HGSB005A hgsb005a = new HGSB005A(); Long parentId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005A.FIELD_PARENT_ID));
HGSB005 hgsb005 = HGSBTools.Hgsb005.getId(parentId);
if (hgsb005.getCheckStatus().equals(CommonConstant.PlanStatus.UN_PLAN)){
throw new PlatException("设备保养审批完成,无法删除");
}
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) { for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HGSB005A hgsb005a = new HGSB005A();
hgsb005a.fromMap(map); hgsb005a.fromMap(map);
hgsb005a.setDeleteFlag(CommonConstant.YesNo.YES_1); hgsb005a.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSB005A.DELETE_FLAG, hgsb005a.toMap()); DaoUtils.update(HGSB005A.DELETE_FLAG, hgsb005a.toMap());
...@@ -74,11 +78,7 @@ public class ServiceHGSB005A extends ServiceEPBase { ...@@ -74,11 +78,7 @@ public class ServiceHGSB005A extends ServiceEPBase {
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) { } catch (PlatException e) {
e.printStackTrace(); LogUtils.setDetailMsg(inInfo, e, "删除失败");
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
} }
return inInfo; return inInfo;
} }
...@@ -88,9 +88,9 @@ public class ServiceHGSB005A extends ServiceEPBase { ...@@ -88,9 +88,9 @@ public class ServiceHGSB005A extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据 // 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (Map resultRow : resultRows) {
HGSB005A hgsb005a = new HGSB005A(); HGSB005A hgsb005a = new HGSB005A();
hgsb005a.fromMap(resultRows.get(i)); hgsb005a.fromMap(resultRow);
if (hgsb005a.getId() == null || hgsb005a.getId() == 0) { if (hgsb005a.getId() == null || hgsb005a.getId() == 0) {
hgsb005a.setParentId(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005A.FIELD_PARENT_ID))); hgsb005a.setParentId(Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005A.FIELD_PARENT_ID)));
this.add(hgsb005a); this.add(hgsb005a);
......
...@@ -31,7 +31,7 @@ public class ServiceHGSB007 extends ServiceEPBase { ...@@ -31,7 +31,7 @@ public class ServiceHGSB007 extends ServiceEPBase {
EiInfo outInfo = super.initLoad(inInfo,new HGSB007()); EiInfo outInfo = super.initLoad(inInfo,new HGSB007());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB007.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB007.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_CHECK_STATUS, CommonConstant.YesNo.YES_1); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSB005.FIELD_CHECK_STATUS, CommonConstant.YesNo.YES_1);
outInfo = super.query(inInfo, HGSB007.QUERY, new HGSB007(),false, new EiBlockMeta(), EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL); outInfo = super.query(inInfo, HGSB007.QUERY, new HGSB007(),false, new HGSB007().eiMetadata, EiConstant.queryBlock, CommonConstant.Field.DETAIL, CommonConstant.Field.DETAIL);
Map qarma = new HashMap(); Map qarma = new HashMap();
if (!HGSBTools.getRoleDataAuth()){ if (!HGSBTools.getRoleDataAuth()){
String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId(); String userId = "admin".equals(UserSessionUtils.getUserId())?"":UserSessionUtils.getUserId();
......
...@@ -5,36 +5,52 @@ ...@@ -5,36 +5,52 @@
<typeAlias alias="HGSB006" type="com.baosight.hggp.hg.sb.domain.HGSB006"/> <typeAlias alias="HGSB006" type="com.baosight.hggp.hg.sb.domain.HGSB006"/>
<typeAlias alias="HashMap" type="java.util.HashMap"/> <typeAlias alias="HashMap" type="java.util.HashMap"/>
<sql id="column"> <sql id="column">
A.ID as "id", <!-- ID -->
A.ACCOUNT_CODE as "accountCode", <!-- 账套 --> A.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
A.DEP_CODE as "depCode", <!-- 部门编码 --> A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 创建人 --> A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 --> A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
A.PARENT_ID as "parentId", <!-- 父级ID -->
B.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
B.COMPANY_NAME as "companyName", <!-- 公司名称 -->
B.INSPEC_DATE as "inspecDate", <!-- 点检日期 -->
B.INSPEC_CODE as "inspecCode", <!-- 点检单号 -->
A.GROUP_CODE as "groupCode", <!-- 设备区域编码 --> A.GROUP_CODE as "groupCode", <!-- 设备区域编码 -->
A.GROUP_NAME as "groupName", <!-- 设备区域名称 --> A.GROUP_NAME as "groupName", <!-- 设备区域名称 -->
B.PLAN_CODE as "planCode", <!-- 计划单号 --> A.PLAN_CODE as "planCode", <!-- 计划单号 -->
B.PLAN_START_DATE as "planStartDate", <!-- 计划开始日期 --> A.PLAN_START_DATE as "planStartDate", <!-- 计划开始日期 -->
B.PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 --> A.PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 -->
A.DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
A.DEVICE_CODE as "deviceCode", <!-- 设备编码 --> A.DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
A.DEVICE_NAME as "deviceName", <!-- 设备名称 --> A.DEVICE_NAME as "deviceName", <!-- 设备名称 -->
A.DEVICE_MODEL as "deviceModel", <!-- 设备型号 -->
A.CHECK_ITEM as "checkItem", <!-- 检查项 -->
A.CHECK_DESCRIP as "checkDescrip", <!-- 检查描述 -->
A.CHECK_RESULT as "checkResult", <!-- 检查描述结果 --> A.CHECK_RESULT as "checkResult", <!-- 检查描述结果 -->
DATEDIFF(DATE_FORMAT(B.PLAN_END_DATE, '%Y-%m-%d'), CURDATE()) as "remainderDays", DATEDIFF(DATE_FORMAT(A.PLAN_END_DATE, '%Y-%m-%d'), CURDATE()) as "remainderDays",
A.DOC_ID as "docId", <!-- 附件ID --> A.DOC_ID as "docId" <!-- 附件ID -->
A.DOC_NAME as "docName" </sql>
<sql id="column001">
A.ACCOUNT_CODE, <!-- 账套 -->
A.DEP_CODE, <!-- 部门编码 -->
B.COMPANY_CODE, <!-- 公司编码 -->
B.COMPANY_NAME, <!-- 公司名称 -->
A.GROUP_CODE, <!-- 设备区域编码 -->
A.GROUP_NAME, <!-- 设备区域名称 -->
B.PLAN_CODE, <!-- 计划单号 -->
B.PLAN_START_DATE, <!-- 计划开始日期 -->
B.PLAN_END_DATE, <!-- 计划结束日期 -->
A.DEVICE_CODE, <!-- 设备编码 -->
A.DEVICE_NAME, <!-- 设备名称 -->
A.CHECK_RESULT, <!-- 检查描述结果 -->
A.DOC_ID <!-- 附件ID -->
</sql>
<sql id="column002">
A.ACCOUNT_CODE, <!-- 账套 -->
A.DEP_CODE, <!-- 部门编码 -->
B.COMPANY_CODE, <!-- 公司编码 -->
B.COMPANY_NAME, <!-- 公司名称 -->
A.GROUP_CODE, <!-- 设备区域编码 -->
A.GROUP_NAME, <!-- 设备区域名称 -->
B.PLAN_CODE, <!-- 计划单号 -->
B.PLAN_START_DATE, <!-- 计划开始日期 -->
B.PLAN_END_DATE, <!-- 计划结束日期 -->
A.DEVICE_CODE, <!-- 设备编码 -->
A.DEVICE_NAME, <!-- 设备名称 -->
'' as CHECK_RESULT, <!-- 检查描述结果 -->
'' as DOC_ID <!-- 附件ID -->
</sql> </sql>
<sql id="authCondition"> <sql id="authCondition">
...@@ -142,23 +158,83 @@ ...@@ -142,23 +158,83 @@
<select id="query" parameterClass="HashMap" resultClass="HGSB006"> <select id="query" parameterClass="HashMap" resultClass="HGSB006">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
from (
SELECT
<include refid="column001"/>
FROM ${hggpSchema}.HGSB004A A FROM ${hggpSchema}.HGSB004A A
LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID WHERE 1=1 LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" /> <include refid="condition" />
UNION ALL
SELECT
<include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND TASK_STATUS = '0' AND B.PLAN_TYPE = '1'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
) A
where 1=1
<isEqual prepend=" AND " property="checkStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="checkStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
B.PLAN_START_DATE desc,B.PLAN_END_DATE desc, A.ID asc A.PLAN_START_DATE desc,A.PLAN_END_DATE desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSB004A A SELECT
COUNT(*)
from (
SELECT
<include refid="column001"/>
FROM ${hggpSchema}.HGSB004A A
LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID WHERE 1=1 LEFT JOIN ${hggpSchema}.HGSB004 B ON A.PARENT_ID = B.ID WHERE 1=1
<include refid="condition" /> <include refid="condition" />
UNION ALL
SELECT
<include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND TASK_STATUS = '0' AND B.PLAN_TYPE = '1'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
) A
where 1=1
<isEqual prepend=" AND " property="checkStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="checkStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
</select> </select>
</sqlMap> </sqlMap>
\ No newline at end of file
...@@ -6,35 +6,52 @@ ...@@ -6,35 +6,52 @@
<typeAlias alias="HashMap" type="java.util.HashMap"/> <typeAlias alias="HashMap" type="java.util.HashMap"/>
<sql id="column"> <sql id="column">
A.ID as "id", <!-- ID -->
A.ACCOUNT_CODE as "accountCode", <!-- 账套 --> A.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
A.DEP_CODE as "depCode", <!-- 部门编码 --> A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 创建人 --> A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 --> A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
A.PARENT_ID as "parentId", <!-- 父级ID -->
B.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
B.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.GROUP_CODE as "groupCode", <!-- 设备区域编码 --> A.GROUP_CODE as "groupCode", <!-- 设备区域编码 -->
A.GROUP_NAME as "groupName", <!-- 设备区域名称 --> A.GROUP_NAME as "groupName", <!-- 设备区域名称 -->
B.UPKEEP_DATE as "upkeepDate", <!-- 保养日期 --> A.PLAN_CODE as "planCode", <!-- 计划单号 -->
B.UPKEEP_CODE as "upkeepCode", <!-- 保养单号 --> A.PLAN_START_DATE as "planStartDate", <!-- 计划开始日期 -->
B.PLAN_START_DATE as "planStartDate", <!-- 计划开始日期 --> A.PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 -->
B.PLAN_END_DATE as "planEndDate", <!-- 计划结束日期 -->
A.DEVICE_TYPE as "deviceType", <!-- 设备类型 -->
A.DEVICE_CODE as "deviceCode", <!-- 设备编码 --> A.DEVICE_CODE as "deviceCode", <!-- 设备编码 -->
A.DEVICE_NAME as "deviceName", <!-- 设备名称 --> A.DEVICE_NAME as "deviceName", <!-- 设备名称 -->
A.DEVICE_MODEL as "deviceModel", <!-- 设备型号 -->
A.CHECK_ITEM as "checkItem", <!-- 检查项 -->
A.CHECK_DESCRIP as "checkDescrip", <!-- 检查描述 -->
A.CHECK_RESULT as "checkResult", <!-- 检查描述结果 --> A.CHECK_RESULT as "checkResult", <!-- 检查描述结果 -->
A.DOC_ID as "docId", <!-- 附件ID --> A.DOC_ID as "docId", <!-- 附件ID -->
A.DOC_NAME as "docName", DATEDIFF(DATE_FORMAT(A.PLAN_END_DATE, '%Y-%m-%d'), CURDATE()) as "remainderDays"
DATEDIFF(DATE_FORMAT(B.PLAN_END_DATE, '%Y-%m-%d'), CURDATE()) as "remainderDays" </sql>
<sql id="column001">
A.ACCOUNT_CODE,
A.DEP_CODE,
B.COMPANY_CODE,
B.COMPANY_NAME,
A.GROUP_CODE,
A.GROUP_NAME,
B.PLAN_CODE,
B.PLAN_START_DATE,
B.PLAN_END_DATE,
A.DEVICE_CODE,
A.DEVICE_NAME,
A.CHECK_RESULT,
A.DOC_ID
</sql>
<sql id="column002">
A.ACCOUNT_CODE,
A.DEP_CODE,
B.COMPANY_CODE,
B.COMPANY_NAME,
A.GROUP_CODE,
A.GROUP_NAME,
B.PLAN_CODE,
B.PLAN_START_DATE,
B.PLAN_END_DATE,
A.DEVICE_CODE,
A.DEVICE_NAME,
'' as CHECK_RESULT,
'' as DOC_ID
</sql> </sql>
<sql id="authCondition"> <sql id="authCondition">
...@@ -58,7 +75,6 @@ ...@@ -58,7 +75,6 @@
</sql> </sql>
<sql id="condition"> <sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
...@@ -148,23 +164,85 @@ ...@@ -148,23 +164,85 @@
<select id="query" parameterClass="HashMap" resultClass="HGSB007"> <select id="query" parameterClass="HashMap" resultClass="HGSB007">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM (
SELECT
<include refid="column001"/>
FROM ${hggpSchema}.HGSB005A A FROM ${hggpSchema}.HGSB005A A
LEFT JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID WHERE 1=1 JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0' WHERE 1=1
<include refid="authCondition"/>
<include refid="condition" /> <include refid="condition" />
UNION ALL
SELECT
<include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND TASK_STATUS = '0' AND B.PLAN_TYPE = '2'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
) A
WHERE 1=1
<isEqual prepend=" AND " property="upkeepStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="upkeepStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
B.UPKEEP_DATE desc, A.CREATED_TIME desc, A.ID asc A.PLAN_START_DATE desc, A.PLAN_END_DATE desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSB005A A SELECT
LEFT JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID WHERE 1=1 COUNT(*)
FROM (
SELECT
<include refid="column001"/>
FROM ${hggpSchema}.HGSB005A A
JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0' WHERE 1=1
<include refid="authCondition"/>
<include refid="condition" /> <include refid="condition" />
UNION ALL
SELECT
<include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND TASK_STATUS = '0' AND B.PLAN_TYPE = '2'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
) A
WHERE 1=1
<isEqual prepend=" AND " property="upkeepStatus" compareValue="1">
trim(A.DOC_ID) ='' and trim(A.CHECK_RESULT) = ''
</isEqual>
<isEqual prepend=" AND " property="upkeepStatus" compareValue="2">
(trim(A.DOC_ID) !='' or trim(A.CHECK_RESULT) != '')
</isEqual>
</select> </select>
</sqlMap> </sqlMap>
\ No newline at end of file
...@@ -5,10 +5,7 @@ import com.baosight.hggp.core.constant.CommonConstant; ...@@ -5,10 +5,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002; import com.baosight.hggp.hg.sb.domain.*;
import com.baosight.hggp.hg.sb.domain.HGSB002A;
import com.baosight.hggp.hg.sb.domain.HGSB004;
import com.baosight.hggp.hg.sb.domain.HGSB004A;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.UserGroup; import com.baosight.hggp.hg.xs.domain.UserGroup;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
...@@ -168,4 +165,26 @@ public class HGSBTools { ...@@ -168,4 +165,26 @@ public class HGSBTools {
return results; return results;
} }
} }
public static class Hgsb005 {
public static HGSB005 getId(Long id) {
AssertUtils.isNull(id, "设备保养不能为空");
Map queryMap = new HashMap();
queryMap.put(HGSB005.FIELD_ID, id);
queryMap.put(HGSB005.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
List<HGSB005> results = DaoBase.getInstance().query(HGSB005.QUERY, queryMap);
AssertUtils.isEmpty(results, "设备保养不存在");
return results.get(0);
}
public static List<HGSB005A> getDetails(Long parentId) {
AssertUtils.isNull(parentId, "设备保养不能为空");
Map queryMap = new HashMap();
queryMap.put(HGSB005A.FIELD_PARENT_ID, parentId);
queryMap.put(HGSB005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
List<HGSB005A> results = DaoBase.getInstance().query(HGSB005A.QUERY, queryMap);
return results;
}
}
} }
...@@ -63,6 +63,7 @@ public class HGSC001A extends DaoEPBase { ...@@ -63,6 +63,7 @@ public class HGSC001A extends DaoEPBase {
public static final String DELETE = "HGSC001A.delete"; public static final String DELETE = "HGSC001A.delete";
public static final String DELETE_BY_PROJID = "HGSC001A.deleteByProjId"; public static final String DELETE_BY_PROJID = "HGSC001A.deleteByProjId";
public static final String DELETE_BY_PROJIDS = "HGSC001A.deleteByProjIds"; public static final String DELETE_BY_PROJIDS = "HGSC001A.deleteByProjIds";
public static final String DELETE_NOT_IDS = "HGSC001A.deleteNotIds";
private Long id = new Long(0); private Long id = new Long(0);
private Long projId = new Long(0); /* 项目ID*/ private Long projId = new Long(0); /* 项目ID*/
......
...@@ -156,7 +156,7 @@ public class ServiceHGSC001 extends ServiceBase { ...@@ -156,7 +156,7 @@ public class ServiceHGSC001 extends ServiceBase {
AssertUtils.isEmpty(hgsc001.getStartDate(), "请选择开工日期!"); AssertUtils.isEmpty(hgsc001.getStartDate(), "请选择开工日期!");
AssertUtils.isEmpty(hgsc001.getEndDate(), "请选择完工日期!"); AssertUtils.isEmpty(hgsc001.getEndDate(), "请选择完工日期!");
AssertUtils.isTrue(DateUtil.toDate(hgsc001.getEndDate(),DateUtil.DATE10_PATTERN).compareTo( AssertUtils.isTrue(DateUtil.toDate(hgsc001.getEndDate(),DateUtil.DATE10_PATTERN).compareTo(
DateUtil.toDate(hgsc001.getStartDate(),DateUtil.DATE10_PATTERN))>0,"完工日期不能大于开工日期!"); DateUtil.toDate(hgsc001.getStartDate(),DateUtil.DATE10_PATTERN))<0,"完工日期不能大于开工日期!");
AssertUtils.isNull(hgsc001.getProjStatus(), "请选择项目状态!"); AssertUtils.isNull(hgsc001.getProjStatus(), "请选择项目状态!");
AssertUtils.isEmpty(hgsc001.getContractWorkTxt(), "请填写合同工作量!"); AssertUtils.isEmpty(hgsc001.getContractWorkTxt(), "请填写合同工作量!");
......
...@@ -71,9 +71,18 @@ public class ServiceHGSC005A extends ServiceBase { ...@@ -71,9 +71,18 @@ public class ServiceHGSC005A extends ServiceBase {
} }
private void checkSaveData(List<HGSC005A> hgsc005AList) { private void checkSaveData(List<HGSC005A> hgsc005AList) {
AssertUtils.isEmpty(hgsc005AList,"保存数据为空,请勾选后修改保存!");
AssertUtils.isEmpty(hgsc005AList.get(0).getPlanCode(),"生产计划详情数据异常,请联系管理员!");
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(hgsc005AList.get(0).getPlanCode());
AssertUtils.isTrue(Objects.isNull(hgsc005.getCommitStatus()),"生产计划状态异常,请联系管理员!");
AssertUtils.isTrue(hgsc005.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)>0,"生产计划已提交,不可修改!");
for (HGSC005A hgsc005a : hgsc005AList) { for (HGSC005A hgsc005a : hgsc005AList) {
AssertUtils.isEmpty(hgsc005a.getPlanStartDate(), String.format("产品[%s]计划开工日期为空!", hgsc005a.getProductName())); AssertUtils.isEmpty(hgsc005a.getPlanStartDate(), String.format("产品[%s]计划开工日期为空!", hgsc005a.getProductName()));
AssertUtils.isEmpty(hgsc005a.getPlanEndDate(), String.format("产品[%s]计划开始完工日期为空!", hgsc005a.getProductName())); AssertUtils.isEmpty(hgsc005a.getPlanEndDate(), String.format("产品[%s]计划完工日期为空!", hgsc005a.getProductName()));
AssertUtils.isTrue(DateUtil.toDate(hgsc005a.getPlanEndDate(),DateUtil.DATE10_PATTERN).compareTo(
DateUtil.toDate(hgsc005a.getPlanStartDate(),DateUtil.DATE10_PATTERN))<0,String.format("产品[%s]计划完工日期不能大于开工日期!", hgsc005a.getProductName()));
} }
} }
......
...@@ -84,7 +84,8 @@ public class ServiceHGSC006A extends ServiceBase { ...@@ -84,7 +84,8 @@ public class ServiceHGSC006A extends ServiceBase {
HGSC007 hgsc007 = new HGSC007(); HGSC007 hgsc007 = new HGSC007();
BeanUtils.copyProperties(hgsc006A,hgsc007); BeanUtils.copyProperties(hgsc006A,hgsc007);
cleanBaseInfo(hgsc007); cleanBaseInfo(hgsc007);
hgsc007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASCK_CODE)); hgsc007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASK_CODE));
hgsc007.setMatId(hgsc006.getMatId());
hgsc007.setOrderId(hgsc006.getId()); hgsc007.setOrderId(hgsc006.getId());
hgsc007.setOrderDetailId(hgsc006A.getId()); hgsc007.setOrderDetailId(hgsc006A.getId());
hgsc007.setQuantity(assignQuantity); hgsc007.setQuantity(assignQuantity);
......
...@@ -30,7 +30,7 @@ import java.util.stream.Collectors; ...@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
* 拆单派工 * 拆单派工
* *
*/ */
public class ServiceHGSC006C extends ServiceBase { public class ServiceHGSC006B extends ServiceBase {
/** /**
* 画面初始化. * 画面初始化.
...@@ -185,7 +185,8 @@ public class ServiceHGSC006C extends ServiceBase { ...@@ -185,7 +185,8 @@ public class ServiceHGSC006C extends ServiceBase {
HGSC007 add007 = new HGSC007(); HGSC007 add007 = new HGSC007();
BeanUtils.copyProperties(hgsc006A,add007); BeanUtils.copyProperties(hgsc006A,add007);
cleanBaseInfo(add007); cleanBaseInfo(add007);
add007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASCK_CODE)); add007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASK_CODE));
add007.setMatId(hgsc006.getMatId());
add007.setOrderId(hgsc006.getId()); add007.setOrderId(hgsc006.getId());
add007.setOrderDetailId(hgsc006A.getId()); add007.setOrderDetailId(hgsc006A.getId());
add007.setQuantity(hgsc007.getQuantity()); add007.setQuantity(hgsc007.getQuantity());
......
...@@ -200,6 +200,15 @@ ...@@ -200,6 +200,15 @@
proj_id IN <iterate close=")" open="(" conjunction="," property="projIds">#projIds[]#</iterate> proj_id IN <iterate close=")" open="(" conjunction="," property="projIds">#projIds[]#</iterate>
</delete> </delete>
<delete id="deleteNotIds">
DELETE FROM ${hggpSchema}.HGSC001A WHERE
proj_id = #projId#
<isNotEmpty prepend=" AND " property="notIds">
id NOT IN <iterate close=")" open="(" conjunction="," property="notIds">#notIds[]#</iterate>
</isNotEmpty>
</delete>
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGSC001A UPDATE ${hggpSchema}.HGSC001A
SET SET
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
product_type asc ,process_order desc product_type asc , product_name, process_order desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -239,8 +239,6 @@ ...@@ -239,8 +239,6 @@
UPDATE ${hggpSchema}.HGSC006 UPDATE ${hggpSchema}.HGSC006
SET SET
assign_status = #assignStatus#, <!-- 派工状态 0待派工;1部分派工;2已派工 --> assign_status = #assignStatus#, <!-- 派工状态 0待派工;1部分派工;2已派工 -->
assign_quantity = #assignQuantity#, <!-- 派工数量 -->
unassign_quantity = #unassignQuantity#, <!-- 未派工数量 -->
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE order_code = #orderCode# WHERE order_code = #orderCode#
</update> </update>
......
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
product_type asc ,process_order desc product_type asc, product_name, process_order desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -481,10 +481,10 @@ ...@@ -481,10 +481,10 @@
assign_quantity = #assignQuantity#, <!-- 派工数量 --> assign_quantity = #assignQuantity#, <!-- 派工数量 -->
unassign_quantity = #unassignQuantity#, <!-- 未派工数量 --> unassign_quantity = #unassignQuantity#, <!-- 未派工数量 -->
<isNotEmpty property="assignWeight"> <isNotEmpty property="assignWeight">
assign_weight = #assignWeight# assign_weight = #assignWeight#,
</isNotEmpty> </isNotEmpty>
<isNotEmpty property="unassignWeight"> <isNotEmpty property="unassignWeight">
unassign_weight = #unassignWeight# unassign_weight = #unassignWeight#,
</isNotEmpty> </isNotEmpty>
<include refid="updateRevise"/> <include refid="updateRevise"/>
WHERE id = #id# WHERE id = #id#
......
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
id desc, product_type asc ,process_order desc id desc, product_type asc, product_name, process_order desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -64,7 +64,7 @@ public class HGSCTools { ...@@ -64,7 +64,7 @@ public class HGSCTools {
AssertUtils.isGt(new BigDecimal(totalNum), new BigDecimal(jhNum), "拆单的分派数量不能大于生产订单数量!"); AssertUtils.isGt(new BigDecimal(totalNum), new BigDecimal(jhNum), "拆单的分派数量不能大于生产订单数量!");
Map updateMap = new HashMap(); Map updateMap = new HashMap();
updateMap.put(hgsc006A.FIELD_id, hgsc006A.getId()); updateMap.put(hgsc006A.FIELD_id, hgsc006A.getId());
updateMap.put(HGSC006A.FIELD_quantity, totalNum); updateMap.put(HGSC006A.FIELD_assign_quantity, totalNum);
updateMap.put(HGSC006A.FIELD_unassign_quantity, jhNum - totalNum); updateMap.put(HGSC006A.FIELD_unassign_quantity, jhNum - totalNum);
if(Objects.nonNull(hgsc006A.getSingleWeight())&&hgsc006A.getSingleWeight().compareTo(BigDecimal.ZERO)>0) { if(Objects.nonNull(hgsc006A.getSingleWeight())&&hgsc006A.getSingleWeight().compareTo(BigDecimal.ZERO)>0) {
BigDecimal assignWeight = hgsc006A.getSingleWeight().multiply(new BigDecimal(totalNum)); BigDecimal assignWeight = hgsc006A.getSingleWeight().multiply(new BigDecimal(totalNum));
...@@ -162,6 +162,9 @@ public class HGSCTools { ...@@ -162,6 +162,9 @@ public class HGSCTools {
} }
public static List<HGSC001A> save(List<HGSC001A> hgsc001AList, Long projId){ public static List<HGSC001A> save(List<HGSC001A> hgsc001AList, Long projId){
THGSC001A.deleteNotIds(Optional.ofNullable(hgsc001AList).orElse(new ArrayList<>())
.stream().filter(o -> Objects.nonNull(o.getId())&&o.getId()>0)
.map(HGSC001A::getId).collect(Collectors.toList()),projId);
if(CollectionUtils.isNotEmpty(hgsc001AList)&&Objects.nonNull(projId)) { if(CollectionUtils.isNotEmpty(hgsc001AList)&&Objects.nonNull(projId)) {
hgsc001AList.forEach(obj -> { hgsc001AList.forEach(obj -> {
if(Objects.nonNull(obj.getId())&&obj.getId()>0){ if(Objects.nonNull(obj.getId())&&obj.getId()>0){
...@@ -181,6 +184,22 @@ public class HGSCTools { ...@@ -181,6 +184,22 @@ public class HGSCTools {
DaoUtils.update(HGSC001A.DELETE_BY_PROJIDS, new HashMap<String,Object>(){{put("projIds",projIds);}}); DaoUtils.update(HGSC001A.DELETE_BY_PROJIDS, new HashMap<String,Object>(){{put("projIds",projIds);}});
} }
} }
public static void deleteNotIds(List<Long> notIds, Long projId){
if(CollectionUtils.isNotEmpty(notIds)) {
//删除历史数据
DaoUtils.update(HGSC001A.DELETE_NOT_IDS, new HashMap<String,Object>(){{
put(HGSC001A.FIELD_proj_id,projId);
put("notIds",notIds);
}});
}
}
public static void deleteByProId(Long projId){
AssertUtils.isTrue(Objects.isNull(projId)||projId<=0, "项目ID不能为空!");
//删除历史数据
DaoUtils.update(HGSC001A.DELETE_BY_PROJID, new HashMap<String,Object>(){{put(HGSC001A.FIELD_proj_id,projId);}});
}
} }
public static class THGSC004A{ public static class THGSC004A{
public static void checkFatherSubmitStatus(Long matId) { public static void checkFatherSubmitStatus(Long matId) {
...@@ -468,7 +487,7 @@ public class HGSCTools { ...@@ -468,7 +487,7 @@ public class HGSCTools {
public static int schedule(String planCode) { public static int schedule(String planCode) {
List<HGSC005A> hgsc005AList = queryByPlanCode(planCode); List<HGSC005A> hgsc005AList = queryByPlanCode(planCode);
hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder())); // hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder()));
//通过工序编码查询工序设置 //通过工序编码查询工序设置
List<String> processCodes = hgsc005AList.stream().map(HGSC005A::getProcessCode).collect(Collectors.toList()); List<String> processCodes = hgsc005AList.stream().map(HGSC005A::getProcessCode).collect(Collectors.toList());
List<HGSJ001> hgsj001List = HGSJTools.Hgsj001.queryByProcessCodes(processCodes); List<HGSJ001> hgsj001List = HGSJTools.Hgsj001.queryByProcessCodes(processCodes);
...@@ -524,7 +543,7 @@ public class HGSCTools { ...@@ -524,7 +543,7 @@ public class HGSCTools {
ComputeTypeEnum computeType = ComputeTypeEnum.getEnumByCode(sj.getComputeType()); ComputeTypeEnum computeType = ComputeTypeEnum.getEnumByCode(sj.getComputeType());
switch (computeType){ switch (computeType){
case CD: case CD:
workHour.set(product.getLength().multiply(new BigDecimal(planInfo.getQuantity())).multiply(unitConver).multiply(composingCoeff) workHour.set(product.getLength().multiply(new BigDecimal(planInfo.getQuantity())).divide(unitConver, 2, ROUND_DOWN).multiply(composingCoeff)
.divide(timing,2, ROUND_DOWN) .divide(timing,2, ROUND_DOWN)
.multiply(baseWorkHour).add(finalRemainder)); .multiply(baseWorkHour).add(finalRemainder));
break; break;
...@@ -545,7 +564,7 @@ public class HGSCTools { ...@@ -545,7 +564,7 @@ public class HGSCTools {
BigDecimal day = workHour.get().divide(baseWorkHour, 0, ROUND_DOWN); BigDecimal day = workHour.get().divide(baseWorkHour, 0, ROUND_DOWN);
remainder = workHour.get().remainder(baseWorkHour); remainder = workHour.get().remainder(baseWorkHour);
if(day.compareTo(new BigDecimal(0))>0) { if(day.compareTo(new BigDecimal(0))>0) {
endDate = DateUtil.toDateStr(DateUtils.addDays(DateUtil.toDate(endDate,DateUtil.DATE10_PATTERN),day.intValue()),DateUtil.DATE10_PATTERN); endDate = DateUtil.toDateStr(DateUtils.addDays(DateUtil.toDate(endDate,DateUtil.DATE10_PATTERN),day.negate().intValue()),DateUtil.DATE10_PATTERN);
} }
planInfo.setPlanStartDate(endDate); planInfo.setPlanStartDate(endDate);
return remainder; return remainder;
...@@ -663,7 +682,7 @@ public class HGSCTools { ...@@ -663,7 +682,7 @@ public class HGSCTools {
public static class THGSC007{ public static class THGSC007{
public static HGSC007 getById(Long taskId){ public static HGSC007 getById(Long taskId){
AssertUtils.isTrue(Objects.isNull(taskId)||taskId<=0, "生产任务ID不能为空!"); AssertUtils.isTrue(Objects.isNull(taskId)||taskId<=0, "生产任务ID不能为空!");
HGSC007 results = (HGSC007)DaoBase.getInstance().get(HGSC006A.QUERY, HGSC007.FIELD_id, taskId); HGSC007 results = (HGSC007)DaoBase.getInstance().get(HGSC007.QUERY, HGSC007.FIELD_id, taskId);
return results; return results;
} }
/** /**
......
...@@ -37,8 +37,11 @@ ...@@ -37,8 +37,11 @@
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW001.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/HGCW002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW003.xml"/> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW004.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW006.xml"/> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW006.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW007.xml"/> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW007.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW009.xml"/>
<!--配置--> <!--配置-->
......
...@@ -24,8 +24,8 @@ $(function() { ...@@ -24,8 +24,8 @@ $(function() {
let auditStatus = item.status; let auditStatus = item.status;
let template = ''; let template = '';
if (item.id) { if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="uploadFile(' + item.id + ')" >附件上传</a>'; + 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
} }
return template; return template;
...@@ -254,67 +254,13 @@ function updateStatus(id,deviceStatus) { ...@@ -254,67 +254,13 @@ function updateStatus(id,deviceStatus) {
} }
); );
} }
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGCW004A?methodName=initLoad&inqu_status-0-id="+id,
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(result) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", result.id);
inEiInfo.set("result-0-docId", result.docId);
inEiInfo.set("result-0-docName", result.docName);
EiCommunicator.send('HGCW004', 'updateDocId', inEiInfo, {
onSuccess(ei) {
if (ei.status == "-1") {
NotificationUtil({msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
query();
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
function loadChange(grid,e,field) { function fileDetailFunc(id) {
var cell_label = field,that = grid; JSColorbox.open({
// locked 表示是否为固定列 href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=QZ&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW004",
var locked = that.isCellLocked(cell_label); title: "<div style='text-align: center;'>附件清单</div>",
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列 width: "80%",
var tr,index; height: "80%",
// 获取此 model 元素信息 });
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
} }
...@@ -23,7 +23,7 @@ $(function() { ...@@ -23,7 +23,7 @@ $(function() {
let template = ''; let template = '';
if (item.id) { if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="uploadFile(' + item.id + ')" >附件上传</a>'; + 'onclick="fileDetailFunc(' + item.id + ')" >附件上传</a>';
} }
return template; return template;
...@@ -35,7 +35,7 @@ $(function() { ...@@ -35,7 +35,7 @@ $(function() {
query: function (container, params) { query: function (container, params) {
var queryInfo = new EiInfo(); var queryInfo = new EiInfo();
// info.set("reviewStatus","3") // info.set("reviewStatus","3")
queryInfo.set("contractType","2") queryInfo.set("contractTyps","2,4")
return queryInfo; return queryInfo;
}, },
init: function (e, options) { init: function (e, options) {
...@@ -104,39 +104,7 @@ function saveFunc() { ...@@ -104,39 +104,7 @@ function saveFunc() {
return; return;
} }
let flag = true; let flag = true;
// $.each(rows, function(index, item) {
// let companyCode= item.get("companyCode");
// let accountYear= item.get("accountYear");
// let accountPeriod= item.get("accountPeriod");
// let accountPeriodDateStart= item.get("accountPeriodStatus");
// let accountPeriodDateEnd= item.get("accountPeriodStatus");
//
// if(isBlank(companyCode)){
// message("选中的第"+(index+1)+"行\"公司名称\",不能为空!");
// flag = false;
// return false;
// }
// if(isBlank(accountYear)){
// message("选中的第"+(index+1)+"行\"会计年度\",不能为空!");
// flag = false;
// return false;
// }
// if(isBlank(accountPeriod)){
// message("选中的第"+(index+1)+"行\"会计期\",不能为空!");
// flag = false;
// return false;
// }
// if(isBlank(accountPeriodDateStart)){
// message("选中的第"+(index+1)+"行\"账期开始日期\",不能为空!");
// flag = false;
// return false;
// }
// if(isBlank(accountPeriodDateEnd)){
// message("选中的第"+(index+1)+"行\"账期结束日期\",不能为空!");
// flag = false;
// return false;
// }
// });
if(flag) { if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
...@@ -220,70 +188,6 @@ function updateStatus(id,deviceStatus) { ...@@ -220,70 +188,6 @@ function updateStatus(id,deviceStatus) {
} }
); );
} }
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGCW005A?methodName=initLoad&inqu_status-0-id="+id,
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(result) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", result.id);
inEiInfo.set("result-0-docId", result.docId);
inEiInfo.set("result-0-docName", result.docName);
EiCommunicator.send('HGCW005', 'updateDocId', inEiInfo, {
onSuccess(ei) {
if (ei.status == "-1") {
NotificationUtil({msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
query();
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
function submitFunc() { function submitFunc() {
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
if (rows.length != 1) { if (rows.length != 1) {
...@@ -331,3 +235,11 @@ function submitFunc() { ...@@ -331,3 +235,11 @@ function submitFunc() {
} }
} }
function fileDetailFunc(id) {
JSColorbox.open({
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=KK&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW005",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
\ No newline at end of file
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">结算单详情</a>';
return template;
}
}
],
loadComplete: function (e) {
$("#BTN_INSERT").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc);
$("#BTN_SUBMIT").on("click",submitFunc);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 新增
*/
function addFunc() {
JSColorbox.open({
href: "HGCW008A?methodName=initLoad&efParentFormEname=HGCW008",
title: "<div style='text-align: center;'>新增结算单</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
/**
* 修改
*/
function updateFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
JSColorbox.open({
href: "HGCW008B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW008",
title: "<div style='text-align: center;'>修改结算单</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW008C?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW008",
title: "<div style='text-align: center;'>结算单详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.reviewStatus == "3") {
message("勾选的数据中有已经提交的结算单!");
flag = false;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW008", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
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}"/>
<head>
</head>
<EF:EFPage title="合同管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="所属公司" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="合同号" ename="contractNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="合同名称" ename="contractName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFDateSpan startCname="结算日期(从)" endCname="至" blockId="inqu_status"
startName="contractDateFrom" endName="contractDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="结算编号" ename="settlementNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="结算类别" ename="inqu_status-0-settlementType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.settlementType"/>
</EF:EFSelect>
<EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<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="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"/>
<EF:EFColumn ename="contractNumber" cname="合同号" align="center" enable="false"/>
<EF:EFColumn ename="contractName" cname="合同名称" align="center" enable="false"/>
<EF:EFColumn ename="settlementNumber" cname="结算编号" align="center" enable="false"/>
<EF:EFComboColumn ename="settlementType" cname="结算类别" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.settlementType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="thisSettlementAmount" cname="本次结算金额" align="center" enable="false"/>
<EF:EFColumn ename="thisSettlementTax" cname="本次结算税金" align="center" enable="false"/>
<EF:EFColumn ename="contractDate" cname="结算日期" align="center" enable="false"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HG/CW/HGCW008.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:EFPopupInput ename="popupInputProjCode" cname="项目编号" colWidth="4"
serviceName="HGCW002" methodName="queryContractByType"
resultId="contract_combo_box"
save="false" popupType="ServiceGrid"
valueField="projCode" textField="projCode"
columnEnames="projCode,projName,contractNumber,contractName,totalContractPriceExcluding"
columnCnames="项目编码,项目名称,合同号,合同名称,合同总价"
backFillColumnIds="projCode,projName,contractNumber,contractName,totalContractPriceExcluding,contractType"
backFillFieldIds="result-0-projCode,result-0-projName,result-0-contractNumber,result-0-contractName,result-0-totalContractPrice,contractType"
readonly="true" required="true"
resizable="true" popupTitle="项目信息" popupWidth="800">
</EF:EFPopupInput>
<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" />
<EF:EFInput ename="contractType" cname="合同类型" type="hidden"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-settlementNumber" cname="结算编号" colWidth="4" readonly="true"/>
<EF:EFSelect cname="结算类别" ename="result-0-settlementType" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.settlementType"/>
</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:EFSelect cname="价税分离" ename="result-0-priceTaxSeparation" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.priceTaxSeparation"/>
</EF:EFSelect>
<EF:EFDatePicker cname="结算日期" ename="result-0-contractDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-thisSettlementAmount" cname="本次结算金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-thisSettlementTax" cname="本次结算税金(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-thisPriceTax" cname="本次结算价税合计金额(元)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-totalContractPrice" cname="合同金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-cumulativeSettlementAmount" cname="累计结算金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-cumulativeSettlementTax" cname="累计结算税金(元)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-cumulativePriceTax" cname="累计结算价税合计金额(元)" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="settlementBasis" cname="结算依据" align="center" />
<EF:EFColumn ename="taskName" cname="任务名称" align="center" />
<EF:EFColumn ename="engineeringContent" cname="工程内容" align="center" />
<EF:EFColumn ename="thisEngineeringQuantity" cname="本次结算工程量" format="{0:N3}" align="center"/>
<EF:EFColumn ename="cumulativeEngineeringQuantity" cname="至本次累计结算工程量" format="{0:N3}" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" align="center" />
<EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPrice" cname="合价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="remarks" cname="备注" align="center" />
<EF:EFColumn ename="inventoryId" cname="清单id" hidden="true"/>
</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/HGCW008A.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:EFPopupInput ename="popupInputProjCode" cname="项目编号" colWidth="4"
serviceName="HGCW002" methodName="queryContractByType"
resultId="contract_combo_box"
save="false" popupType="ServiceGrid"
valueField="projCode" textField="projCode"
columnEnames="projCode,projName,contractNumber,contractName,totalContractPriceExcluding"
columnCnames="项目编码,项目名称,合同号,合同名称,合同总价"
backFillColumnIds="projCode,projName,contractNumber,contractName,totalContractPriceExcluding,contractType"
backFillFieldIds="result-0-projCode,result-0-projName,result-0-contractNumber,result-0-contractName,result-0-totalContractPrice,contractType"
readonly="true" required="true"
resizable="true" popupTitle="项目信息" popupWidth="800">
</EF:EFPopupInput>
<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" />
<EF:EFInput ename="contractType" cname="合同类型" type="hidden"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-settlementNumber" cname="结算编号" colWidth="4" readonly="true"/>
<EF:EFSelect cname="结算类别" ename="result-0-settlementType" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.settlementType"/>
</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:EFSelect cname="价税分离" ename="result-0-priceTaxSeparation" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.priceTaxSeparation"/>
</EF:EFSelect>
<EF:EFDatePicker cname="结算日期" ename="result-0-contractDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-thisSettlementAmount" cname="本次结算金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-thisSettlementTax" cname="本次结算税金(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-thisPriceTax" cname="本次结算价税合计金额(元)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-totalContractPrice" cname="合同金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-cumulativeSettlementAmount" cname="累计结算金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-cumulativeSettlementTax" cname="累计结算税金(元)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-cumulativePriceTax" cname="累计结算价税合计金额(元)" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="settlementBasis" cname="结算依据" align="center" />
<EF:EFColumn ename="taskName" cname="任务名称" align="center" />
<EF:EFColumn ename="engineeringContent" cname="工程内容" align="center" />
<EF:EFColumn ename="thisEngineeringQuantity" cname="本次结算工程量" format="{0:N3}" align="center"/>
<EF:EFColumn ename="cumulativeEngineeringQuantity" cname="至本次累计结算工程量" format="{0:N3}" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" align="center" />
<EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPrice" cname="合价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="remarks" cname="备注" align="center" />
<EF:EFColumn ename="inventoryId" cname="清单id" hidden="true"/>
</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/HGCW008B.js"></script>
\ No newline at end of file
$(function () {
IPLATUI.EFGrid = {
"result": {
toolbarConfig: {
hidden: true, // true时,不显示功能按钮,但保留setting导出按钮
},
columns: []
}
}
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
})
/**
* 确认
*/
$('#confirm').on('click', function () {
let allRows = new Array();
allRows = resultGrid.getCheckedRows();
if (allRows.length > 0) {
parent.JSColorbox.setValueCallback(allRows);
} else {
message("请选择至少一条合同清单!");
return;
}
})
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
$(window).load(function () {
// 查
query();
});
<!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="合同号" ename="contractNumber" blockId="inqu_status" row="0" type="hidden" />
<EF:EFInput cname="IDS" ename="inventoryIds" blockId="inqu_status" row="0" type="hidden" />
<EF:EFRegion id="result" title="合同清单">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="inventory" cname="清单" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" align="center" enable="false"/>
<EF:EFColumn ename="provisionalQuantity" cname="暂定工程量" format="{0:N3}" align="center" enable="false"/>
<EF:EFColumn ename="measurementMethod" cname="计量方式" align="center" enable="false"/>
<EF:EFColumn ename="supplyMethod" cname="材料供应方式" align="center" enable="false"/>
<EF:EFColumn ename="unitPriceExcludingTax" cname="除税单价/元" format="{0:N3}" align="center" enable="false"/>
<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" enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-align-right"/>
<EF:EFButton ename="confirm" cname="确认" type="button" class="btn-align-right"/>
</div>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
toolbarConfig: {
hidden: true, // true时,不显示功能按钮,但保留setting导出按钮
},
columns: []
}
}
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
})
/**
* 确认
*/
$('#confirm').on('click', function () {
let allRows = new Array();
allRows = resultGrid.getCheckedRows();
if (allRows.length > 0) {
parent.JSColorbox.setValueCallback(allRows);
} else {
message("请选择至少一条合同清单!");
return;
}
})
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
$(window).load(function () {
// 查
query();
});
<!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="合同号" ename="contractNumber" blockId="inqu_status" row="0" type="hidden" />
<EF:EFInput cname="IDS" ename="inventoryIds" blockId="inqu_status" row="0" type="hidden" />
<EF:EFInput cname="DIDS" ename="deductionIds" blockId="inqu_status" row="0" type="hidden" />
<EF:EFRegion id="result1" title="合同清单">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="inventory" cname="清单" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" align="center" enable="false"/>
<EF:EFColumn ename="provisionalQuantity" cname="暂定工程量" format="{0:N3}" align="center" enable="false"/>
<EF:EFColumn ename="measurementMethod" cname="计量方式" align="center" enable="false"/>
<EF:EFColumn ename="supplyMethod" cname="材料供应方式" align="center" enable="false"/>
<EF:EFColumn ename="unitPriceExcludingTax" cname="除税单价/元" format="{0:N3}" align="center" enable="false"/>
<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" enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="result2" title="扣款单">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编号" align="center" enable="false"/>
<EF:EFColumn ename="projName" cname="项目名称" align="center" enable="false"/>
<EF:EFColumn ename="contractNumber" cname="主合同号" format="{0:N3}" align="center" enable="false"/>
<EF:EFColumn ename="contractName" cname="主合同名称" align="center" enable="false"/>
<EF:EFColumn ename="partyA" cname="甲方名称" align="center" enable="false"/>
<EF:EFColumn ename="partyB" cname="乙方名称" align="center" enable="false"/>
<EF:EFColumn ename="contractContent" cname="扣款事由" enable="false" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="扣款金额" enable="false" align="center"/>
<EF:EFColumn ename="signingDate" cname="扣款日期" align="center" enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
<div class="row">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-align-right"/>
<EF:EFButton ename="confirm" cname="确认" type="button" class="btn-align-right"/>
</div>
</EF:EFPage>
...@@ -30,10 +30,8 @@ $(function () { ...@@ -30,10 +30,8 @@ $(function () {
let auditStatus = item["checkStatus"]; let auditStatus = item["checkStatus"];
let template = ''; let template = '';
if (item.companyCode) { if (item.companyCode) {
if (auditStatus == 1){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\',\''+item.companyName+'\')" >点检详情</a>'; + 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\',\''+item.companyName+'\')" >点检详情</a>';
}
if (auditStatus == 0) { if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >审批完成</a>'; 'onclick="updateStatus(' + item.id + ',1)" >审批完成</a>';
......
...@@ -30,10 +30,8 @@ $(function () { ...@@ -30,10 +30,8 @@ $(function () {
let auditStatus = item["checkStatus"]; let auditStatus = item["checkStatus"];
let template = ''; let template = '';
if (item.companyCode) { if (item.companyCode) {
if (auditStatus == 1){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\',\''+item.companyName+'\')" >保养详情</a>'; + 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\',\''+item.companyName+'\')" >保养详情</a>';
}
if (auditStatus == 0) { if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >审批完成</a>'; 'onclick="updateStatus(' + item.id + ',1)" >审批完成</a>';
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="planCode" cname="计划单号" width="120" align="center" readonly="true" required="true"/>
<EF:EFComboColumn ename="deviceCode" cname="设备名称" <EF:EFComboColumn ename="deviceCode" cname="设备名称"
columnTemplate="#=textField#" itemTemplate="#=textField#" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" textField="textField" valueField="valueField"
...@@ -46,8 +47,6 @@ ...@@ -46,8 +47,6 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="upkeepDate" cname="保养日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFColumn ename="planStartDate" cname="计划开始日期" width="120" align="center" editType="date" <EF:EFColumn ename="planStartDate" cname="计划开始日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划结束日期" width="120" align="center" editType="date" <EF:EFColumn ename="planEndDate" cname="计划结束日期" width="120" align="center" editType="date"
......
...@@ -57,6 +57,10 @@ $(function () { ...@@ -57,6 +57,10 @@ $(function () {
return; return;
} }
}, },
onDelete: function(e) {
detailGrid.removeRows(detailGrid.getCheckedRowsIndex())
e.preventDefault();
},
onSuccess: function (e) { onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){ if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query(); query();
......
...@@ -57,6 +57,10 @@ $(function () { ...@@ -57,6 +57,10 @@ $(function () {
return; return;
} }
}, },
onDelete: function(e) {
detailGrid.removeRows(detailGrid.getCheckedRowsIndex())
e.preventDefault();
},
onSuccess: function (e) { onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){ if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query(); query();
......
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
<EF:EFRegion id="detail" title="部门负责人信息"> <EF:EFRegion id="detail" title="部门负责人信息">
<EF:EFGrid blockId="detail" autoDraw="no" isFloat="true"> <EF:EFGrid blockId="detail" autoDraw="no" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projId" cname="项目ID" hidden="true"/>
<EF:EFColumn ename="userName" cname="负责人名称" required="true" hidden="true"/> <EF:EFColumn ename="userName" cname="负责人名称" required="true" hidden="true"/>
<EF:EFColumn ename="userDepCode" cname="负责人部门编码" required="true" hidden="true"/> <EF:EFColumn ename="userDepCode" cname="负责人部门编码" required="true" hidden="true"/>
<EF:EFColumn ename="userCode" cname="负责人名称" required="true" align="center"/> <EF:EFColumn ename="userCode" cname="负责人名称" required="true" align="center"/>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="变更详情"> <EF:EFPage title="变更详情">
<EF:EFInput ename="inqu_status-0-materialDetailId" type="hidden"/>
<EF:EFRegion id="result" title="变更详情信息"> <EF:EFRegion id="result" title="变更详情信息">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
......
...@@ -37,10 +37,10 @@ ...@@ -37,10 +37,10 @@
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date" <EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="singleWeight" cname="单重" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="singleWeight" cname="单重(kg)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="totalWeight" cname="计划重量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="totalWeight" cname="计划重量(kg)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishWeight" cname="完成重量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="finishWeight" cname="完成重量(kg)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unfinishWeight" cname="未完成重量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="unfinishWeight" cname="未完成重量(kg)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="quantity" cname="计划数量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="quantity" cname="计划数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishQuantity" cname="完成数量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="finishQuantity" cname="完成数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unfinishQuantity" cname="未完成数量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="unfinishQuantity" cname="未完成数量" width="120" enable="true" align="center" readOnly="true"/>
......
...@@ -16,7 +16,7 @@ $(function () { ...@@ -16,7 +16,7 @@ $(function () {
let template = ""; let template = "";
if(item.unassignQuantity > 0 ){ if(item.unassignQuantity > 0 ){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="separateAssign(\'' + item.orderCode + '\')" >拆单派工</a>'; + 'onclick="separateAssign(' + item.id + ')" >拆单派工</a>';
} }
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="showTaskInfo(' + item.id + ')" >任务详情</a>'; 'onclick="showTaskInfo(' + item.id + ')" >任务详情</a>';
...@@ -102,11 +102,11 @@ function assign() { ...@@ -102,11 +102,11 @@ function assign() {
} }
function separateAssign(id){ function separateAssign(orderDetailId){
JSColorbox.open({ JSColorbox.open({
href: "HGSC006B?methodName=initLoad&inqu_status-0-orderCode=" + orderCode, href: "HGSC006B?methodName=initLoad&inqu_status-0-id=" + orderDetailId,
title: "<div style='text-align: center;'>拆单派工</div>", title: "<div style='text-align: center;'>拆单派工</div>",
width: "80%", width: "90%",
height: "90%", height: "90%",
callbackName: separateAssignCallback callbackName: separateAssignCallback
}); });
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/> <EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFDatePicker cname="生产订单" ename="inqu_status-0-createdTime" colWidth="3" <EF:EFDatePicker cname="生产订单" ename="inqu_status-0-createdTime" colWidth="3"
format="yyyy-MM-dd" readonly="false"/> format="yyyy-MM-dd" readonly="false"/>
<EF:EFDatePicker cname="派工日期" ename="inqu_status-0-assignDate" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
...@@ -36,10 +34,10 @@ ...@@ -36,10 +34,10 @@
<EF:EFColumn ename="processName" cname="工序" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="processName" cname="工序" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date" <EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" /> dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" />
<EF:EFColumn ename="singleWeight" cname="单重" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="singleWeight" cname="单重(kg)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="totalWeight" cname="订单重量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="totalWeight" cname="订单重量(kg)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="assignWeight" cname="派工重量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="assignWeight" cname="派工重量(kg)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unassignWeight" cname="待派工重量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="unassignWeight" cname="待派工重量(kg)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="quantity" cname="订单数量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="quantity" cname="订单数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="assignQuantity" cname="派工数量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="assignQuantity" cname="派工数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unassignQuantity" cname="待派工数量" width="120" enable="true" align="center" readOnly="true"/> <EF:EFColumn ename="unassignQuantity" cname="待派工数量" width="120" enable="true" align="center" readOnly="true"/>
......
let factoryGroupGlobalData = [];
$(function () { $(function () {
let factoryGlobalData = __eiInfo.getBlock("factory_record_block_id").getMappedRows();
let groupGlobalData = __eiInfo.getBlock("group_record_block_id").getMappedRows();
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result" : { "result" : {
...@@ -8,30 +9,84 @@ $(function () { ...@@ -8,30 +9,84 @@ $(function () {
pageSizes: [10, 20, 50, 70, 100], pageSizes: [10, 20, 50, 70, 100],
}, },
columns: [{ columns: [{
field: "orgName", field: "groupName",
attributes: { attributes: {
class: "i-input-readonly" class: "i-input-readonly"
} }
}, { }, {
field: "orgNo", field: "factoryCode",
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < factoryGroupGlobalData.length; i++) { for (let i = 0; i < factoryGlobalData.length; i++) {
if (factoryGroupGlobalData[i]['valueField'] === dataItem['orgNo']) { if (factoryGlobalData[i]['factoryCode'] === dataItem['factoryCode']) {
return factoryGroupGlobalData[i]['textField']; dataItem['factoryName'] = factoryGlobalData[i]['factoryName'];
return factoryGlobalData[i]['factoryName'];
} }
} }
return ""; return "";
}, },
editor: function (container, options) { editor: function (container, options) {
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: factoryGlobalData,
minLength: 0,
dataTextField: "factoryName",
dataValueField: "factoryCode",
optionLabelTemplate: "#:factoryName#",
valueTemplate: "#:factoryName#",
template: "#:factoryName#",
filter: "contains"
});
}
}, {
field: "groupCode",
template: function (dataItem) {
for (let i = 0; i < groupGlobalData.length; i++) {
if (groupGlobalData[i]['groupCode'] === dataItem['groupCode']) {
dataItem['groupName'] = groupGlobalData[i]['groupName'];
return groupGlobalData[i]['groupName'];
}
}
return "";
},
editor: function (container, options) {
let dataSource;
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]); inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]);
// 1:生产组 inInfo.set("inqu_status-0-productType", $("#detail-0-productType").val());
inInfo.set("inqu_status-0-groupType", 1);
inInfo.set("serviceName", "HPPZ011");
inInfo.set("methodName", "queryGroupComboBox");
inInfo.set("blockId", "group_record_block_id");
inInfo.set("field", options.field); inInfo.set("field", options.field);
refreshSelect(container, inInfo); EiCommunicator.send("HGSC006B", "groupRecordComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("group_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
let grid = container.closest(".k-grid").data("kendoGrid");
let cellIndex = grid.cellIndex(container);
let input = $('<input />');
let field = inInfo.get("field");
input.attr("name", field);
input.attr("id", field);
input.appendTo(container);
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "groupName",
dataValueField: "groupCode",
dataSource: dataSource,
template: "#=groupName#",
filter: "contains"
});
}
},{
field: "createdTime",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
} }
}], }],
onSave: function (e) { onSave: function (e) {
...@@ -43,13 +98,82 @@ $(function () { ...@@ -43,13 +98,82 @@ $(function () {
// 阻止后台删除请求,使用自定义删除 // 阻止后台删除请求,使用自定义删除
e.preventDefault(); e.preventDefault();
deleteFunc(); deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
} }
} }
} }
// $("#QUERY").on("click", query);
downKeyUp();
}); });
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
})
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
if (isBlank(rows[i]['factoryCode'])) {
message("勾选的第" + (i + 1) + "行\"厂区\",不能为空");
return;
}
if (isBlank(rows[i]['groupCode'])) {
message("勾选的第" + (i + 1) + "行\"生产组\",不能为空");
return;
}
if (isBlank(rows[i]['quantity'])) {
message("勾选的第" + (i + 1) + "行\"分派数量\",不能为空");
return;
}
if (!isPositiveInteger(rows[i]['quantity'])) {
message("勾选的第" + (i + 1) + "行\"分派数量\"必须是大于0的整数");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC006B", "save", true);
}
});
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC006B", "delete", true);
}
});
}
...@@ -7,54 +7,61 @@ ...@@ -7,54 +7,61 @@
<EF:EFPage title="拆单派工"> <EF:EFPage title="拆单派工">
<EF:EFRegion id="inqu" title="订单详情"> <EF:EFRegion id="inqu" title="订单详情">
<EF:EFInput ename="inqu_status-0-prodOrderNo" cname="项目号" type="hidden"/> <EF:EFInput ename="detail-0-projCode" cname="项目号" type="hidden"/>
<EF:EFInput ename="detail-0-productType" cname="产品类型" type="hidden"/>
<EF:EFInput ename="detail-0-id" cname="订单明细ID" type="hidden"/>
<EF:EFInput ename="detail-0-companyCode" cname="公司编码" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-productionOrderNo" cname="生产订单号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-projCode" cname="项目号" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-projCode" cname="项目号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-projName" cname="项目名称" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-projName" cname="项目名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-orderCode" cname="生产订单号" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-prdtName" cname="部件名称" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-productCode" cname="产品编码" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtLength" cname="部件长(MM)" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-productName" cname="产品名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtWidth" cname="部件宽(MM)" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-processName" cname="工序" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtThick" cname="部件厚(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="部件数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unitWt" cname="部件重量(T)" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-remark" cname="部件备注" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-planEndDate" cname="计划完成日期" colWidth="4" readonly="true"/>
<EF:EFSelect ename="detail-0-partType" cname="零件类型" colWidth="4" readonly="true"> <EF:EFInput ename="detail-0-singleWeight" cname="单量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/>
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/> <EF:EFInput ename="detail-0-totalWeight" cname="订单重量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/>
</EF:EFSelect>
<EF:EFInput ename="detail-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-partLength" cname="零件长(MM)" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-assignWeight" cname="派工重量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partWidth" cname="零件宽(MM)" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-unassignWeight" cname="待派工重量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partThick" cname="零件厚(MM)" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-quantity" cname="订单数量" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="detail-0-remark1" cname="零件备注" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-assignQuantity" cname="已派工数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-num" cname="零件数量" colWidth="4" readonly="true"/> <EF:EFInput ename="detail-0-unassignQuantity" cname="待派工数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unitWt" cname="零件重量(T)" colWidth="4" readonly="true"/> <EF:EFSelect ename="detail-0-assignStatus" cname="状态" colWidth="4" readonly="true">
</div> <EF:EFCodeOption codeName="hggp.assignStatus"/>
<div class="row"> </EF:EFSelect>
<EF:EFDatePicker ename="detail-0-workDate" cname="派工时间" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
<EF:EFInput ename="detail-0-assignedNum" cname="派工数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-totalWt" cname="派工重量(T)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-unassignedNum" cname="剩余数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unTotalWt" cname="剩余重量(T)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-completeNum" cname="完成数量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-actualCompletionTotalWt" cname="完成重量(T)" colWidth="4" readonly="true"/>
<EF:EFDatePicker ename="detail-0-deliveryDate" cname="交货日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
<EF:EFDatePicker ename="detail-0-planCompletionDate" cname="计划完成日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
<EF:EFDatePicker ename="detail-0-actualCompletionDate" cname="实际完成时间" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="4" readonly="true" />
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="任务ID" hidden="true"/>
<EF:EFColumn ename="taskCode" cname="任务单号" enable="false" hidden="true"/>
<%-- <EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true"--%>
<%-- filter="contains" readonly="true">--%>
<%-- <EF:EFOptions blockId="factory_record_block_id" valueField="factoryCode" textField="factoryName"/>--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="factoryCode" cname="厂区" width="100" align="center" />
<EF:EFColumn ename="factoryName" cname="工厂名称" enable="false" align="center" hidden="true"/>
<%-- <EF:EFComboColumn ename="groupCode" cname="生产组" width="110" align="center" defaultValue="" required="true"--%>
<%-- filter="contains" readonly="true">--%>
<%-- <EF:EFOptions blockId="group_record_block_id" valueField="groupCode" textField="groupName"/>--%>
<%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="groupCode" cname="生产组" width="100" align="center" />
<EF:EFColumn ename="groupName" cname="生产组名称" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="createdTime" cname="派工时间" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="quantity" cname="分派数量" format="{0:N0}" required="true"/>
</EF:EFGrid>
<br/>
<span style='color: red;font-size: 13px;'>说明:厂区和生产组仅新增的时候可以编辑</span>
</EF:EFRegion>
</EF:EFPage> </EF:EFPage>
$(function () {
var factoryGlobalData = __eiInfo.getBlock("factory_record_block_id").getMappedRows();
let groupGlobalData = __eiInfo.getBlock("group_record_block_id").getMappedRows();
IPLATUI.EFGrid = {
"result" : {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "groupName",
attributes: {
class: "i-input-readonly"
}
}, {
field: "factoryCode",
template: function (dataItem) {
for (let i = 0; i < factoryGlobalData.length; i++) {
if (factoryGlobalData[i]['factoryCode'] === dataItem['factoryCode']) {
return factoryGlobalData[i]['factoryName'];
}
}
return "";
},
editor: function (container, options) {
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: factoryGlobalData,
minLength: 0,
dataTextField: "factoryName",
dataValueField: "factoryCode",
optionLabelTemplate: "#:factoryName#",
valueTemplate: "#:factoryName#",
template: "#:factoryName#",
filter: "contains"
});
}
}, {
field: "groupCode",
template: function (dataItem) {
for (let i = 0; i < groupGlobalData.length; i++) {
if (groupGlobalData[i]['groupCode'] === dataItem['groupCode']) {
return groupGlobalData[i]['groupName'];
}
}
return "";
},
editor: function (container, options) {
let dataSource;
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]);
inInfo.set("inqu_status-0-productType", $("#detail-0-productType").val());
inInfo.set("field", options.field);
EiCommunicator.send(HGSC006C, groupRecordComboBox, inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("group_record_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
let grid = container.closest(".k-grid").data("kendoGrid");
let cellIndex = grid.cellIndex(container);
let input = $('<input />');
let field = inInfo.get("field");
input.attr("name", field);
input.attr("id", field);
input.appendTo(container);
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "groupName",
dataValueField: "groupCode",
dataSource: dataSource,
template: "#=groupName#",
filter: "contains"
});
}
},{
field: "createdTime",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}],
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止后台删除请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
}
$("#QUERY").on("click", query);
downKeyUp();
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
if (isBlank(rows[i]['factoryCode'])) {
message("勾选的第" + (i + 1) + "行\"厂区\",不能为空");
return;
}
if (isBlank(rows[i]['groupCode'])) {
message("勾选的第" + (i + 1) + "行\"生产组\",不能为空");
return;
}
if (isBlank(rows[i]['quantity'])) {
message("勾选的第" + (i + 1) + "行\"分派数量\",不能为空");
return;
}
if (!isPositiveInteger(rows[i]['quantity'])) {
message("勾选的第" + (i + 1) + "行\"分派数量\"必须是大于0的整数");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC006C", "save", true);
}
});
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC006C", "delete", true);
}
});
}
<!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:EFRegion id="inqu" title="订单详情">
<EF:EFInput ename="detail-0-projCode" cname="项目号" type="hidden"/>
<EF:EFInput ename="detail-0-productType" cname="产品类型" type="hidden"/>
<EF:EFInput ename="detail-0-id" cname="订单明细ID" type="hidden"/>
<EF:EFInput ename="detail-0-companyCode" cname="公司编码" type="hidden"/>
<div class="row">
<EF:EFInput ename="detail-0-projCode" cname="项目号" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-projName" cname="项目名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-orderNo" cname="生产订单号" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-productCode" cname="产品编码" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-productName" cname="产品名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-processName" cname="工序" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-planCompletionDate" cname="计划完成日期" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-quantity" cname="计划数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-totalWeight" cname="计划重量(kg)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-assignQuantity" cname="已派工数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-unassignQuantity" cname="待派工数量" colWidth="4" readonly="true"/>
<EF:EFSelect ename="detail-0-assignStatus" cname="状态" colWidth="4" readonly="true">
<EF:EFCodeOption codeName="hggp.assignStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="任务ID" enable="false" width="80" align="center"/>
<EF:EFColumn ename="taskCode" cname="任务单号" enable="false" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="factoryName" cname="工厂" enable="false" align="center" hidden="true"/>
<EF:EFComboColumn ename="groupCode" cname="生产组" width="110" align="center" defaultValue="" required="true"
filter="contains" readonly="true">
<EF:EFOptions blockId="group_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="groupName" cname="生产组名称" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="createdTime" cname="派工时间" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="quantity" cname="分派数量" format="{0:N0}" required="true"/>
</EF:EFGrid>
<br/>
<span style='color: red;font-size: 13px;'>说明:厂区和生产组仅新增的时候可以编辑</span>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment