Commit bee2e13e by liuyang

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

parents 90bec985 d54ce917
......@@ -107,6 +107,8 @@ public class HGConstant {
public static final String BLUEPRINT_CODE = "BLUEPRINT_CODE";
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;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author yukang
......@@ -262,15 +259,34 @@ public class ServiceHGCW002 extends ServiceBase {
public EiInfo projectComboBox(EiInfo inInfo){
Map<String, Object> map = new HashMap<>();
List<String> contractTypArray = new ArrayList<>();
if (StringUtils.isNotEmpty(inInfo.getString("reviewStatus"))) {
map.put("reviewStatus", inInfo.getString("reviewStatus"));
}
if (StringUtils.isNotEmpty(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);
inInfo.addBlock("projcet_combo_box").setRows(HGCW002List);
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 {
// * 上传附件
// * @param inInfo
// * @return
// */
// @OperationLogAnnotation(operModul = "账期维护",operType = "上传附件",operDesc = "上传附件")
// public EiInfo form(EiInfo inInfo) {
// return inInfo;
// *
// }
@OperationLogAnnotation(operModul = "账期维护",operType = "上传附件",operDesc = "上传附件操作")
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 @@
<isNotEmpty prepend=" AND " property="contractType">
CONTRACT_TYPE = #contractType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractTyps">
CONTRACT_TYPE IN <iterate close=")" open="(" conjunction="," property="contractTyps">#contractTyps[]#</iterate>
</isNotEmpty>
ORDER BY CONTRACT_NUMBER
</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 ${hggpSchema}.HGCW002
SET
......@@ -524,4 +539,28 @@
ID = #id#
</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>
......@@ -94,6 +94,9 @@
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID NOT IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......
......@@ -92,6 +92,9 @@
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dids">
ID NOT IN <iterate close=")" open="(" conjunction="," property="dids">#dids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......
......@@ -45,6 +45,15 @@ public class HGCWTools {
});
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{
......@@ -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 void batchUpdate(List<Map> rows, Long id) {
......
......@@ -63,6 +63,7 @@ public class HGKC003 extends DaoEPBase {
public static final String FIELD_PART_WIDTH = "partWidth"; /* 零件-宽*/
public static final String FIELD_PART_THICK = "partThick"; /* 零件-厚*/
public static final String FIELD_PART_SPEC = "partSpec"; /* 零件规格*/
public static final String FIELD_SUBMIT_STATUS = "submitStatus"; /* 提交状态 0未提交,1已提交*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -104,6 +105,7 @@ public class HGKC003 extends DaoEPBase {
public static final String COL_PART_WIDTH = "PART_WIDTH"; /* 零件-宽*/
public static final String COL_PART_THICK = "PART_THICK"; /* 零件-厚*/
public static final String COL_PART_SPEC = "PART_SPEC"; /* 零件规格*/
public static final String COL_SUBMIT_STATUS = "SUBMIT_STATUS"; /* 提交状态 0未提交,1已提交*/
public static final String QUERY = "HGKC003.query";
public static final String COUNT = "HGKC003.count";
......@@ -151,6 +153,7 @@ public class HGKC003 extends DaoEPBase {
private BigDecimal partWidth = new BigDecimal(0.000); /* 零件-宽*/
private BigDecimal partThick = new BigDecimal(0.000); /* 零件-厚*/
private String partSpec = " "; /* 零件规格*/
private Integer submitStatus; /* 提交状态 0未提交,1已提交*/
/**
* initialize the metadata.
......@@ -346,6 +349,10 @@ public class HGKC003 extends DaoEPBase {
eiColumn.setDescName("零件规格");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUBMIT_STATUS);
eiColumn.setDescName("提交状态");
eiMetadata.addMeta(eiColumn);
}
......@@ -996,6 +1003,15 @@ public class HGKC003 extends DaoEPBase {
public void setPartSpec(String partSpec) {
this.partSpec = partSpec;
}
public Integer getSubmitStatus() {
return submitStatus;
}
public void setSubmitStatus(Integer submitStatus) {
this.submitStatus = submitStatus;
}
/**
* get the value from Map.
*
......@@ -1044,6 +1060,7 @@ public class HGKC003 extends DaoEPBase {
setPartWidth(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_WIDTH)), partWidth));
setPartThick(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PART_THICK)), partThick));
setPartSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_SPEC)), partSpec));
setSubmitStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SUBMIT_STATUS)), submitStatus));
}
/**
......@@ -1093,6 +1110,7 @@ public class HGKC003 extends DaoEPBase {
map.put(FIELD_PART_WIDTH, StringUtils.toString(partWidth, eiMetadata.getMeta(FIELD_PART_WIDTH)));
map.put(FIELD_PART_THICK, StringUtils.toString(partThick, eiMetadata.getMeta(FIELD_PART_THICK)));
map.put(FIELD_PART_SPEC, StringUtils.toString(partSpec, eiMetadata.getMeta(FIELD_PART_SPEC)));
map.put(FIELD_SUBMIT_STATUS, StringUtils.toString(submitStatus, eiMetadata.getMeta(FIELD_SUBMIT_STATUS)));
return map;
}
......
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC003A;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.*;
/**
* 生产入库明细
*
* @author:jhs
* @date:2024/5/24,11:08
*/
public class ServiceHGKC003B extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC003A.QUERY, new HGKC003A());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC003A.QUERY, new HGKC003A());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 蓝图ids
List<Long> ids = ObjectUtils.listKey(resultRows, HGKC003A.FIELD_ID);
DaoUtils.update(HGKC003A.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo save(EiInfo inInfo){
try {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGKC003A hgkc003a = new HGKC003A();
hgkc003a.fromMap(resultMap);
//查询蓝图
HGKC003 hgkc003 = (HGKC003) super.dao.get(HGKC003.QUERY,HGKC003.FIELD_ID,hgkc003a.getPrimaryId());
//复制蓝图基本信息
hgkc003a.setCompanyCode(hgkc003.getCompanyCode());
hgkc003a.setCompanyName(hgkc003.getCompanyName());
hgkc003a.setDepCode(hgkc003.getDepCode());
// hgkc003a.setDepName(hgkc003.getDepName());
hgkc003a.setProjCode(hgkc003.getProjCode());
hgkc003a.setProjName(hgkc003.getProjName());
this.checkSaveData(hgkc003a,hgkc003);
if(Objects.nonNull(hgkc003a.getId())&&hgkc003a.getId()!=0){
DaoUtils.update(HGKC003A.UPDATE, hgkc003a);
}else {
DaoUtils.insert(HGKC003A.INSERT, hgkc003a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param hgkc003a
*/
private void checkSaveData(HGKC003A hgkc003a, HGKC003 hgkc003) {
if(Objects.nonNull(hgkc003a.getId())&&hgkc003a.getId()>0){
AssertUtils.isTrue(hgkc003.getSubmitStatus().compareTo(HGConstant.ProductStatus.YTJ) == 0,"入库单已提交,不能修改!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(hgkc003a.getCompanyCode(), "请选择公司!");
AssertUtils.isEmpty(hgkc003a.getProjCode(), "请填写项目编号!");
AssertUtils.isEmpty(hgkc003a.getProjName(), "请填写项目名称!");
}
}
......@@ -42,7 +42,8 @@
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec" <!-- 零件规格 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
SUBMIT_STATUS as "submitStatus" <!-- 提交状态 -->
</sql>
<sql id="condition">
......@@ -60,13 +61,13 @@
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
COMPANY_NAME like '%' || #companyName#|| '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositDate">
DEPOSIT_DATE = #depositDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositNo">
DEPOSIT_NO = #depositNo#
DEPOSIT_NO like '%' || #depositNo# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
......@@ -93,7 +94,7 @@
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
PROJ_NAME like '%' || #projName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtType">
PRDT_TYPE = #prdtType#
......@@ -137,6 +138,9 @@
<isNotEmpty prepend=" AND " property="partSpec">
PART_SPEC = #partSpec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty>
</sql>
<sql id="idCondition">
......@@ -224,13 +228,14 @@
PART_LENGTH, <!-- 零件-长 -->
PART_WIDTH, <!-- 零件-宽 -->
PART_THICK, <!-- 零件-厚 -->
PART_SPEC <!-- 零件规格 -->
PART_SPEC, <!-- 零件规格 -->
SUBMIT_STATUS <!-- 提交状态 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #depositDate#, #depositNo#, #whCode#, #whName#,
#invQty#, #invUnitWeight#, #invWeight#, #depositNoOld#, #remark#, #factoryCode#, #prodOrderNo#, #prodTaskNo#,
#projCode#, #projName#, #prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#, #prdtSpec#,
#partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#
#partType#, #partCode#, #partName#, #partLength#, #partWidth#, #partThick#, #partSpec#, #submitStatus#
)
</insert>
......@@ -280,7 +285,8 @@
PART_LENGTH = #partLength#, <!-- 零件-长 -->
PART_WIDTH = #partWidth#, <!-- 零件-宽 -->
PART_THICK = #partThick#, <!-- 零件-厚 -->
PART_SPEC = #partSpec# <!-- 零件规格 -->
PART_SPEC = #partSpec#, <!-- 零件规格 -->
SUBMIT_STATUS = #submitStatus# <!-- 提交状态 -->
WHERE
ID = #id#
</update>
......
......@@ -63,6 +63,7 @@ public class HGSC001A extends DaoEPBase {
public static final String DELETE = "HGSC001A.delete";
public static final String DELETE_BY_PROJID = "HGSC001A.deleteByProjId";
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 projId = new Long(0); /* 项目ID*/
......
......@@ -72,6 +72,7 @@ public class HGSC004 extends DaoEPBase {
public static final String BATCH_DELETE = "HGSC004.batchDelete";
public static final String UPDATE_DEL = "HGSC004.updateDel";
public static final String UPDATE_MATERIAL_STATUS = "HGSC004.updateMaterialStatus";
public static final String MAX_ID = "HGSC004.maxId";
private Long id = new Long(0); /* 主键*/
private Long blueprintId = new Long(0); /* 蓝图id*/
......
......@@ -156,7 +156,7 @@ public class ServiceHGSC001 extends ServiceBase {
AssertUtils.isEmpty(hgsc001.getStartDate(), "请选择开工日期!");
AssertUtils.isEmpty(hgsc001.getEndDate(), "请选择完工日期!");
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.isEmpty(hgsc001.getContractWorkTxt(), "请填写合同工作量!");
......
......@@ -113,6 +113,8 @@ public class ServiceHGSC004 extends ServiceBase {
});
DaoUtils.updateBatch(HGSC004A.UPDATE, hgsc004AList);
}else {
Long maxId = (Long) super.dao.get(HGSC004.MAX_ID,null,null);
hgsc004.setId(maxId+1);
hgsc004.setMaterialStatus(HGConstant.MaterialStatus.WTJ);
DaoUtils.insert(HGSC004.INSERT, hgsc004);
......
......@@ -109,10 +109,7 @@ public class ServiceHGSC004A extends ServiceBase {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC004A hgsc004a = new HGSC004A();
hgsc004a.fromMap(resultMap);
//蓝图信息,用于蓝图状态校验
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004A.FIELD_id,hgsc004a.getId());
//主表信息,用于取值
Long materialId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id));
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC004A.FIELD_id,materialId);
if(Objects.nonNull(hgsc004)){
......@@ -130,7 +127,7 @@ public class ServiceHGSC004A extends ServiceBase {
}else{
hgsc004a.setLeaf(1);
}
this.checkSaveData(hgsc004a,hgsc003);
this.checkSaveData(hgsc004a,hgsc004);
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()!=0){
if(hgsc004a.getLv().intValue() == 3){
......@@ -177,8 +174,10 @@ public class ServiceHGSC004A extends ServiceBase {
*
* @param hgsc004a
*/
private void checkSaveData(HGSC004A hgsc004a,HGSC003 hgsc003) {
private void checkSaveData(HGSC004A hgsc004a,HGSC004 hgsc004) {
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()>0){
//蓝图信息,用于蓝图状态校验
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004A.FIELD_id,hgsc004.getBlueprintId());
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
......@@ -196,9 +195,11 @@ public class ServiceHGSC004A extends ServiceBase {
//获取物料详情数据
String projCode = StringUtils.toString(inInfo.get("projCode"));
String companyCode = StringUtils.toString(inInfo.get("companyCode"));
String materialId = StringUtils.toString(inInfo.get("materialId"));
Map queryMap = new HashMap();
queryMap.put("companyCode", com.baosight.hggp.util.StringUtils.isNotBlank(companyCode) ? companyCode : "null");
queryMap.put("projCode", com.baosight.hggp.util.StringUtils.isNotBlank(projCode) ? projCode : "null");
queryMap.put("materialId", com.baosight.hggp.util.StringUtils.isNotBlank(materialId) ? materialId : "null");
queryMap.put("pEname", "$".equals(node) ? "root" : node);
//2 查询节点
......@@ -241,15 +242,18 @@ public class ServiceHGSC004A extends ServiceBase {
HGSC004A hgsc004a = new HGSC004A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
String materialId = eiBlock.getCellStr(ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id);
//获取主表信息
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC004.FIELD_id,materialId);
//校验计划父单据是否提交,提交了不让新增
HGSCTools.THGSC004A.checkFatherSubmitStatus(hgsc004.getId());
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
//前端传参不完成
hgsc004a.fromMap(map);
if(Objects.nonNull(hgsc004)){
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a = (HGSC004A) super.dao.get(HGSC004A.QUERY_BY_MATERIAL_ID,HGSC004A.FIELD_id,hgsc004a.getId());
//校验计划父单据是否提交,提交了不让新增
HGSCTools.THGSC004A.checkFatherSubmitStatus(hgsc004.getId());
//子表
HGSC005A hgsc005a = new HGSC005A();
BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType");
......@@ -266,7 +270,7 @@ public class ServiceHGSC004A extends ServiceBase {
mapA.put("materialId",hgsc004a.getMaterialId());
mapA.put("productStatus",HGConstant.ProductStatus.WTJ);
mapA.put("notId",hgsc004a.getId());
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY_ALL,mapA, 0, -999999);
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY,mapA, 0, -999999);
if(!CollectionUtils.isEmpty(hgsc004AList)){
//如果存在就是部分提交
......@@ -281,6 +285,7 @@ public class ServiceHGSC004A extends ServiceBase {
}
}
hgsc004a.setProductStatus(HGConstant.ProductStatus.YTJ);
DaoUtils.update(HGSC004A.UPDATE_PRODUCT_STATUS, hgsc004a);
}
......
......@@ -71,9 +71,18 @@ public class ServiceHGSC005A extends ServiceBase {
}
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) {
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()));
}
}
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.domain.HGSC006;
import com.baosight.hggp.hg.sc.domain.HGSC006A;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
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 java.math.BigDecimal;
/**
......@@ -19,7 +30,6 @@ public class ServiceHGSC006A extends ServiceBase {
@OperationLogAnnotation(operModul = "生产订单详情", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
String planCode = inInfo.getCellStr(EiConstant.queryBlock,0,HGSC006A.FIELD_order_code);
inInfo = super.query(inInfo, HGSC006A.QUERY, new HGSC006A());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......@@ -38,15 +48,72 @@ public class ServiceHGSC006A extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "生产订单详情", operType = "派工", operDesc = "派工")
@OperationLogAnnotation(operModul = "生产订单详情", operType = "批量派工", operDesc = "批量派工")
public EiInfo assign(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
String orderCode = inInfo.getString("orderCode");
String[] orderDetailIds = inInfo.getString("ids").split(",");
String factoryCode = inInfo.getString("factoryCode");
String factoryName = inInfo.getString("factoryName");
String groupCode = inInfo.getString("groupCode");
String groupName = inInfo.getString("groupName");
HGSC006 hgsc006 = HGSCTools.THGSC006.getByOrderCode(orderCode);
for (String orderDetailId : orderDetailIds) {
// 校验主订单是否已分派
HGSC006A hgsc006A = HGSCTools.THGSC006A.getById(Long.parseLong(orderDetailId));
// 锁主单号
HGSCTools.THGSC006A.lock(hgsc006A.getId());
AssignStatusEnum assignStatusEnum = AssignStatusEnum.getEnumByCode(hgsc006A.getAssignStatus());
Integer assignQuantity = new Integer(0);
switch (assignStatusEnum){
case UNASSIGN:
assignQuantity = hgsc006A.getQuantity();
HGSCTools.checkAssignedNum(hgsc006A.getId(), hgsc006A.getQuantity());
break;
case PARTIAL_ASSIGN:
assignQuantity = hgsc006A.getUnassignQuantity();
HGSCTools.checkAssignedNum(hgsc006A.getId(), hgsc006A.getUnassignQuantity());
break;
case ASSIGNED:
AssertUtils.isTrue(true,String.format("生产订单[%s]%s已全部分派,不能在进行批量分派,请检查!",hgsc006A.getProcessName(), hgsc006A.getProductName()));
break;
default:
throw new PlatException(String.format("生产订单[%s]%s状态异常,请联系管理员!",hgsc006A.getProcessName(), hgsc006A.getProductName()));
}
// 写入子表数据
HGSC007 hgsc007 = new HGSC007();
BeanUtils.copyProperties(hgsc006A,hgsc007);
cleanBaseInfo(hgsc007);
hgsc007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASCK_CODE));
hgsc007.setOrderId(hgsc006.getId());
hgsc007.setOrderDetailId(hgsc006A.getId());
hgsc007.setQuantity(assignQuantity);
hgsc007.setTotalWeight(hgsc006A.getSingleWeight().multiply(new BigDecimal(assignQuantity)));
hgsc007.setGroupCode(groupCode);
hgsc007.setGroupName(groupName);
hgsc007.setFactoryCode(factoryCode);
hgsc007.setFactoryName(factoryName);
DaoUtils.insert(HGSC007.INSERT, hgsc007);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
inInfo.setMsg("操作成功!本次对[" + orderDetailIds.length + "]条数据分派成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "分派失败");
}
return inInfo;
}
private void cleanBaseInfo(HGSC007 hgsc007){
hgsc007.setCreatedBy(null);
hgsc007.setCreatedName(null);
hgsc007.setCreatedTime(null);
hgsc007.setUpdatedBy(null);
hgsc007.setUpdatedName(null);
hgsc007.setUpdatedTime(null);
hgsc007.setDepCode(null);
hgsc007.setDepName(null);
hgsc007.setId(null);
HGSC006A a = new HGSC006A();
}
}
......@@ -20,6 +20,7 @@ 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 org.springframework.beans.BeanUtils;
import java.math.BigDecimal;
import java.util.*;
......@@ -29,7 +30,7 @@ import java.util.stream.Collectors;
* 拆单派工
*
*/
public class ServiceHGSC006C extends ServiceBase {
public class ServiceHGSC006B extends ServiceBase {
/**
* 画面初始化.
......@@ -180,12 +181,32 @@ public class ServiceHGSC006C extends ServiceBase {
AssertUtils.isEmpty(hgsc007.getGroupCode(), "请选择生产组");
// 更新订单主表数量
HGSCTools.checkAssignedNum(orderDetailId, hgsc007.getQuantity());
hgsc007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASCK_CODE));
hgsc007.setOrderId(hgsc006.getId());
hgsc007.setMatId(hgsc006.getMatId());
hgsc007.setOrderDetailId(hgsc006A.getId());
hgsc007.setTotalWeight(hgsc007.getSingleWeight().multiply(new BigDecimal(hgsc007.getQuantity())));
DaoUtils.insert(HGSC007.INSERT, hgsc007);
HGSC007 add007 = new HGSC007();
BeanUtils.copyProperties(hgsc006A,add007);
cleanBaseInfo(add007);
add007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASCK_CODE));
add007.setOrderId(hgsc006.getId());
add007.setOrderDetailId(hgsc006A.getId());
add007.setQuantity(hgsc007.getQuantity());
add007.setTotalWeight(hgsc006A.getSingleWeight().multiply(new BigDecimal(hgsc007.getQuantity())));
add007.setGroupCode(hgsc007.getGroupCode());
add007.setGroupName(hgsc007.getGroupName());
add007.setFactoryCode(hgsc007.getFactoryCode());
add007.setFactoryName(hgsc007.getFactoryName());
DaoUtils.insert(HGSC007.INSERT, add007);
}
private void cleanBaseInfo(HGSC007 hgsc007){
hgsc007.setCreatedBy(null);
hgsc007.setCreatedName(null);
hgsc007.setCreatedTime(null);
hgsc007.setUpdatedBy(null);
hgsc007.setUpdatedName(null);
hgsc007.setUpdatedTime(null);
hgsc007.setDepCode(null);
hgsc007.setDepName(null);
hgsc007.setId(null);
}
/**
......
......@@ -200,6 +200,15 @@
proj_id IN <iterate close=")" open="(" conjunction="," property="projIds">#projIds[]#</iterate>
</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 ${hggpSchema}.HGSC001A
SET
......
......@@ -224,4 +224,8 @@
WHERE
ID = #id#
</update>
<select id="maxId" resultClass="long">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC004
</select>
</sqlMap>
......@@ -214,10 +214,13 @@
FROM ${hggpSchema}.HGSC004A a
left join ${hggpSchema}.hgpz005 b on a.product_id = b.id
left join ${hggpSchema}.hgsc001 c on a.proj_code = c.proj_code and c.approval_status = 2
WHERE 1=1
WHERE 1=1 and a.lv NOT IN (1,2)
<isNotEmpty prepend=" AND " property="materialId">
a.material_id = #materialId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="id">
a.id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
a.id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
......@@ -356,38 +359,37 @@
<select id="queryTree" resultClass="java.util.HashMap">
SELECT
PRODUCT_CODE as "nodeId",
product_id as "productId", <!-- 产品id -->
invent_type as "inventType", <!-- 档案类型 -->
product_type as "productType", <!-- 产品类别 -->
PRODUCT_CODE as "productCode", <!-- 产品编码 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName",<!-- 项目名称 -->
PRODUCT_NAME as "productName", <!-- 产品名称 -->
PRODUCT_CODE as "label", <!-- 名部件编码-->
case when lv = 3 then concat(PRODUCT_CODE,' ',PRODUCT_NAME) else PRODUCT_NAME end as "text", <!-- 部件名称 -->
PARENT_PROD_CODE as "pId", <!-- 父节点编码 -->
PARENT_PROD_NAME as "pName", <!-- 父节点名称 -->
LEAF as "leaf", <!-- 是否有叶子节点 -->
SORT as "sort", <!-- 排序字段 -->
lv as "lv"
a.PRODUCT_CODE as "nodeId",
a.product_id as "productId", <!-- 产品id -->
a.invent_type as "inventType", <!-- 档案类型 -->
a.product_type as "productType", <!-- 产品类别 -->
a.PRODUCT_CODE as "productCode", <!-- 产品编码 -->
a.PROJ_CODE as "projCode", <!-- 项目编码 -->
a.PROJ_NAME as "projName",<!-- 项目名称 -->
a.PRODUCT_NAME as "productName", <!-- 产品名称 -->
a.PRODUCT_CODE as "label", <!-- 名部件编码-->
case when a.lv = 3 then concat(a.PRODUCT_CODE,' ',a.PRODUCT_NAME) else a.PRODUCT_NAME end as "text", <!-- 部件名称 -->
a.PARENT_PROD_CODE as "pId", <!-- 父节点编码 -->
a.PARENT_PROD_NAME as "pName", <!-- 父节点名称 -->
a.LEAF as "leaf", <!-- 是否有叶子节点 -->
a.SORT as "sort", <!-- 排序字段 -->
a.lv as "lv"
FROM
${hggpSchema}.HGSC004A
WHERE 1=1
${hggpSchema}.HGSC004A a left join ${hggpSchema}.HGSC004 b on a.material_id = b.id
WHERE 1=1 and b.del_status = 0
<isNotEmpty prepend=" AND " property="pEname">
PARENT_PROD_CODE = #pEname#
a.PARENT_PROD_CODE = #pEname#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
a.PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialId">
MATERIAL_ID = #materialId#
a.MATERIAL_ID = #materialId#
</isNotEmpty>
ORDER BY CREATED_TIME DESC
ORDER BY a.CREATED_TIME DESC
</select>
......
......@@ -199,7 +199,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
product_type asc ,process_order desc
product_type asc , product_name, process_order desc
</isEmpty>
</dynamic>
......
......@@ -239,8 +239,6 @@
UPDATE ${hggpSchema}.HGSC006
SET
assign_status = #assignStatus#, <!-- 派工状态 0待派工;1部分派工;2已派工 -->
assign_quantity = #assignQuantity#, <!-- 派工数量 -->
unassign_quantity = #unassignQuantity#, <!-- 未派工数量 -->
<include refid="updateRevise"/>
WHERE order_code = #orderCode#
</update>
......
......@@ -245,7 +245,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
product_type asc ,process_order desc
product_type asc, product_name, process_order desc
</isEmpty>
</dynamic>
......@@ -480,6 +480,12 @@
assign_status = #assignStatus#, <!-- 派工状态 0待派工;1部分派工;2已派工 -->
assign_quantity = #assignQuantity#, <!-- 派工数量 -->
unassign_quantity = #unassignQuantity#, <!-- 未派工数量 -->
<isNotEmpty property="assignWeight">
assign_weight = #assignWeight#,
</isNotEmpty>
<isNotEmpty property="unassignWeight">
unassign_weight = #unassignWeight#,
</isNotEmpty>
<include refid="updateRevise"/>
WHERE id = #id#
</update>
......
......@@ -224,7 +224,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc, product_type asc ,process_order desc
id desc, product_type asc, product_name, process_order desc
</isEmpty>
</dynamic>
......
......@@ -64,8 +64,13 @@ public class HGSCTools {
AssertUtils.isGt(new BigDecimal(totalNum), new BigDecimal(jhNum), "拆单的分派数量不能大于生产订单数量!");
Map updateMap = new HashMap();
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);
if(Objects.nonNull(hgsc006A.getSingleWeight())&&hgsc006A.getSingleWeight().compareTo(BigDecimal.ZERO)>0) {
BigDecimal assignWeight = hgsc006A.getSingleWeight().multiply(new BigDecimal(totalNum));
updateMap.put(HGSC006A.FIELD_assign_weight, assignWeight);
updateMap.put(HGSC006A.FIELD_unassign_weight, hgsc006A.getTotalWeight().subtract(assignWeight));
}
// 0.未派工,1.部分派工,2.全部派工
AssignStatusEnum orderDetailAssignStatus ;
if (jhNum - totalNum==0) {
......@@ -157,6 +162,9 @@ public class HGSCTools {
}
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)) {
hgsc001AList.forEach(obj -> {
if(Objects.nonNull(obj.getId())&&obj.getId()>0){
......@@ -176,6 +184,22 @@ public class HGSCTools {
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 void checkFatherSubmitStatus(Long matId) {
......@@ -463,7 +487,7 @@ public class HGSCTools {
public static int schedule(String 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<HGSJ001> hgsj001List = HGSJTools.Hgsj001.queryByProcessCodes(processCodes);
......@@ -519,7 +543,7 @@ public class HGSCTools {
ComputeTypeEnum computeType = ComputeTypeEnum.getEnumByCode(sj.getComputeType());
switch (computeType){
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)
.multiply(baseWorkHour).add(finalRemainder));
break;
......@@ -540,7 +564,7 @@ public class HGSCTools {
BigDecimal day = workHour.get().divide(baseWorkHour, 0, ROUND_DOWN);
remainder = workHour.get().remainder(baseWorkHour);
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);
return remainder;
......
......@@ -37,8 +37,11 @@
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW004.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/HGCW008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW009.xml"/>
<!--配置-->
......
......@@ -24,8 +24,8 @@ $(function() {
let auditStatus = item.status;
let template = '';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="uploadFile(' + item.id + ')" >附件上传</a>';
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
}
return template;
......@@ -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) {
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 fileDetailFunc(id) {
JSColorbox.open({
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=QZ&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW004",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
......@@ -23,7 +23,7 @@ $(function() {
let template = '';
if (item.id) {
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;
......@@ -35,7 +35,7 @@ $(function() {
query: function (container, params) {
var queryInfo = new EiInfo();
// info.set("reviewStatus","3")
queryInfo.set("contractType","2")
queryInfo.set("contractTyps","2,4")
return queryInfo;
},
init: function (e, options) {
......@@ -104,39 +104,7 @@ function saveFunc() {
return;
}
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) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
......@@ -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() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
......@@ -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>
......@@ -8,48 +8,36 @@
<EF:EFPage title="生产入库单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker cname="单据日期" ename="documentDate" blockId="inqu_status" row="0" colWidth="3"
<EF:EFInput cname="公司名称" ename="companyName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDatePicker cname="单据日期" ename="depositDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="生产入库单号" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFSelect cname="仓库名称" ename="whCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="是否删除" ename="deleteFlag" blockId="inqu_status" row="0" colWidth="3" defaultValue="0">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpjx.deleteFlag"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" readonly="true">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="prodNo" cname="生产单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="depositDate" cname="单据日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
<EF:EFColumn ename="depositDate" cname="单据日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="depositNo" cname="生产入库单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="prodOrderNo" cname="生产任务单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="whName" cname="仓库名称" enable="false" width="120" align="center"/>
<EF:EFComboColumn cname="提交状态" ename="submitStatus" width="90" align="center" required="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="invQty" cname="数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invQeight" cname="总重(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
......
<!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="查询条件">
<div class="row">
<EF:EFDatePicker cname="单据日期" ename="documentDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect cname="仓库名称" ename="whCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="存货编码" ename="prdtCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="存货名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="prodNo" cname="生产单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="depositDate" cname="单据日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="prdtName" cname="部件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partName" cname="零件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="partSpec" cname="零件规格" enable="false" width="150" align="center"/>
<EF:EFColumn ename="invQty" cname="数量" enable="false" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invQeight" cname="总重(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="remark" cname="备注" enable="false" width="150"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -57,6 +57,10 @@ $(function () {
return;
}
},
onDelete: function(e) {
detailGrid.removeRows(detailGrid.getCheckedRowsIndex())
e.preventDefault();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
......
......@@ -57,6 +57,10 @@ $(function () {
return;
}
},
onDelete: function(e) {
detailGrid.removeRows(detailGrid.getCheckedRowsIndex())
e.preventDefault();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
......
......@@ -68,6 +68,7 @@
<EF:EFRegion id="detail" title="部门负责人信息">
<EF:EFGrid blockId="detail" autoDraw="no" isFloat="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="userDepCode" cname="负责人部门编码" required="true" hidden="true"/>
<EF:EFColumn ename="userCode" cname="负责人名称" required="true" align="center"/>
......
......@@ -32,6 +32,7 @@ $(function () {
query: function (postEiInfo, model) {
postEiInfo.set("companyCode",companyCode ? companyCode : null);
postEiInfo.set("projCode",projCode ? projCode : null);
postEiInfo.set("materialId",$("#inqu_status-0-materialId").val());
return postEiInfo;
},
loadComplete: function (options) {
......@@ -59,6 +60,7 @@ $(function () {
refreshTree();
} else {
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-materialId", $("#inqu_status-0-materialId").val());
if (nodeData.lv == 2) {
eiInfo.set("inqu_status-0-parInventType", "root");
//3级节点选择只能是构建
......
......@@ -60,7 +60,7 @@
<EF:EFColumn ename="quantity" required="true" cname="数量"/>
<EF:EFColumn ename="singleWeight" required="true" format="{0:N3}" cname="单重(kg)"/>
<EF:EFColumn enable="true" required="true" format="{0:N3}" ename="totalWeight" cname="总重(kg)"/>
<EF:EFComboColumn cname="提交状态" ename="productStatus" width="90" align="center" required="false">
<EF:EFComboColumn cname="提交状态" ename="productStatus" width="90" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFComboColumn>
</EF:EFGrid>
......
......@@ -6,6 +6,7 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="变更详情">
<EF:EFInput ename="inqu_status-0-materialDetailId" type="hidden"/>
<EF:EFRegion id="result" title="变更详情信息">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
......@@ -15,15 +16,17 @@
<EF:EFColumn enable="false" ename="productId" hidden="true" cname="产品id"/>
<EF:EFColumn enable="false" ename="productType" hidden="true" cname="产品类型"/>
<EF:EFColumn enable="false" ename="inventType" hidden="true" cname="库存类型"/>
<EF:EFColumn ename="operator" cname="操作" width="140" enable="false" readonly="false"/>
<EF:EFComboColumn cname="变更类型" ename="changeType" width="90" align="center" enable="false" required="false">
<EF:EFCodeOption codeName="hggp.sc.changeType" />
</EF:EFComboColumn>
<EF:EFColumn ename="productCode" required="true" cname="产品编号" enable="false"/>
<EF:EFColumn ename="productName" cname="产品名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="quantity" required="true" cname="数量" enable="false" enable="false"/>
<EF:EFColumn ename="length" cname="长(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="quantity" required="true" cname="数量" enable="false" />
<EF:EFColumn ename="singleWeight" required="true" format="{0:N3}" cname="单重(kg)" enable="false"/>
<EF:EFColumn enable="true" required="true" format="{0:N3}" ename="totalWeight" cname="总重(kg)" enable="false"/>
<EF:EFColumn enable="true" required="true" format="{0:N3}" ename="totalWeight" cname="总重(kg)"/>
<EF:EFComboColumn cname="提交状态" ename="productStatus" width="90" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.sc.productStatus" />
</EF:EFComboColumn>
......
......@@ -37,10 +37,10 @@
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date"
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="totalWeight" cname="计划重量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishWeight" cname="完成重量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unfinishWeight" 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="计划重量(kg)" format="{0:0.00}" editType="text" 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="未完成重量(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="finishQuantity" 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 () {
let template = "";
if(item.unassignQuantity > 0 ){
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" ' +
'onclick="showTaskInfo(' + item.id + ')" >任务详情</a>';
......@@ -49,7 +49,8 @@ function assign() {
message("请至少选择一条需要分派的数据");
return;
}
let productType= rows[0].get("productType");
let productType = rows[0].get("productType");
let orderCode = rows[0].get("orderCode");
let flag = true;
$.each(rows, function(index, item) {
let compareProductType = item.get("productType");
......@@ -74,6 +75,7 @@ function assign() {
callbackName: function (row) {
var info = new EiInfo()
info.set("ids", ids.join(','));
info.set("orderCode",orderCode);
info.set("factoryCode", row.factoryCode);
info.set("factoryName", row.factoryName);
info.set("groupCode", row.groupCode);
......@@ -100,11 +102,11 @@ function assign() {
}
function separateAssign(id){
function separateAssign(orderDetailId){
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>",
width: "80%",
width: "90%",
height: "90%",
callbackName: separateAssignCallback
});
......
......@@ -18,8 +18,6 @@
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" colWidth="3"/>
<EF:EFDatePicker cname="生产订单" ename="inqu_status-0-createdTime" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
<EF:EFDatePicker cname="派工日期" ename="inqu_status-0-assignDate" colWidth="3"
format="yyyy-MM-dd" readonly="false"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
......@@ -36,10 +34,10 @@
<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"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" />
<EF:EFColumn ename="singleWeight" cname="单重" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="totalWeight" cname="订单重量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="assignWeight" cname="派工重量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unassignWeight" 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="订单重量(kg)" format="{0:0.00}" editType="text" 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="待派工重量(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="assignQuantity" 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 () {
let factoryGlobalData = __eiInfo.getBlock("factory_record_block_id").getMappedRows();
let groupGlobalData = __eiInfo.getBlock("group_record_block_id").getMappedRows();
IPLATUI.EFGrid = {
IPLATUI.EFGrid = {
"result" : {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "orgName",
field: "groupName",
attributes: {
class: "i-input-readonly"
}
}, {
field: "orgNo",
field: "factoryCode",
template: function (dataItem) {
for (let i = 0; i < factoryGlobalData.length; i++) {
if (factoryGlobalData[i]['factoryCode'] === dataItem['factoryCode']) {
dataItem['factoryName'] = factoryGlobalData[i]['factoryName'];
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 < factoryGroupGlobalData.length; i++) {
if (factoryGroupGlobalData[i]['valueField'] === dataItem['orgNo']) {
return factoryGroupGlobalData[i]['textField'];
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) {
editor: function (container, options) {
let dataSource;
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-factoryCode", options.model["factoryCode"]);
// 1:生产组
inInfo.set("inqu_status-0-groupType", 1);
inInfo.set("serviceName", "HPPZ011");
inInfo.set("methodName", "queryGroupComboBox");
inInfo.set("blockId", "group_record_block_id");
inInfo.set("inqu_status-0-productType", $("#detail-0-productType").val());
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) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
......@@ -43,13 +98,74 @@ $(function () {
// 阻止后台删除请求,使用自定义删除
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", "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 @@
<EF:EFPage 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">
<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-projName" cname="项目名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-orderCode" cname="生产订单号" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtName" cname="部件名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtLength" cname="部件长(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-prdtWidth" cname="部件宽(MM)" 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"/>
<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-remark" cname="部件备注" colWidth="4" readonly="true"/>
<EF:EFSelect ename="detail-0-partType" cname="零件类型" colWidth="4" readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType"/>
</EF:EFSelect>
<EF:EFInput ename="detail-0-partName" cname="零件名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-planEndDate" cname="计划完成日期" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-singleWeight" cname="单量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-totalWeight" cname="订单重量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-partLength" cname="零件长(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partWidth" cname="零件宽(MM)" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-partThick" 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-unassignWeight" cname="待派工重量(kg)" format="{0:0.00}" colWidth="4" readonly="true"/>
<EF:EFInput ename="detail-0-quantity" cname="订单数量" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="detail-0-remark1" cname="零件备注" 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 class="row">
<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" />
<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" 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>
$(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