Commit 54d46607 by 宋祥
parents ddb8ce7d 764c5731
package com.baosight.hpjx.common;
/**
* @author LiuYang
* @version 1.0 2024/8/23
* @description 核销状态
*/
public enum CancelStatusEnum {
/**
* 0:未审核
*/
UNCANCEL(0, "未核销"),
/**
* 1:已审核
*/
CANCEL(1, "已核销"),
;
private Integer code;
private String desc;
CancelStatusEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static String getDesc(Integer code) {
for (CancelStatusEnum cancelStatusEnum : CancelStatusEnum.values()) {
if (cancelStatusEnum.getCode().equals(code)) {
return cancelStatusEnum.getDesc();
}
}
return null;
}
public static Integer getCode(String desc) {
for (CancelStatusEnum cancelStatusEnum : CancelStatusEnum.values()) {
if (cancelStatusEnum.getDesc().equals(desc)) {
return cancelStatusEnum.getCode();
}
}
return null;
}
}
......@@ -169,7 +169,7 @@ public enum DdynamicEnum {
* 用途:项目档案下拉框
* 编写:wwl
*/
PROJ_RECORD_BLOCK_ID("proj_record_block_id","projCode","projName","HPSC001.queryComboBox"),
PROJ_RECORD_BLOCK_ID("proj_record_block_id","projCode","projName","princ2","HPSC001.queryComboBox"),
/**
* 模块:部件档案
......@@ -394,6 +394,20 @@ public enum DdynamicEnum {
DEVICE_CODE_BLOCK_ID("deviceCode_block_id","deviceCode","deviceName","HPSB003.queryDeviceCode"),
DEVICE_CODE_BOX_BLOCK_ID("deviceCodeBox_block_id","deviceCode","deviceName", "deviceType", "companyCode", "factoryCode", "groupCode","deviceStatus","HPSB003.queryDeviceCodeBox"),
/**
* 模块:生产入库
* 用途:销售开票项目下拉框
* 编写:ly
*/
PROJ_CODE_BOX_BLOCK_ID("projCodeBox_block_id","projCode","projName","factoryCode","HPKC003.queryProjCodeBox"),
/**
* 模块:销售管理
* 用途:客户档案下拉框
* 编写:ly
*/
CUST_CODE_BLOCK_ID("custCode_block_id","custCode","custName","HPSC001.queryCustCodeBox"),
;
......
package com.baosight.hpjx.common;
/**
* @author LiuYang
* @version 1.0 2024/8/16
* @description
*/
public enum ReviewStatusEnum {
/**
* 0:未审核
*/
UNREVIEWED(0, "未审核"),
/**
* 1:已审核
*/
REVIEWED(1, "已审核"),
/**
* 2:未提交
*/
UNSUBMITTED(2, "未提交"),
/**
* 3:已提交
*/
SUBMITTED(3, "已提交"),
;
private Integer code;
private String desc;
ReviewStatusEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static String getDesc(Integer code) {
for (ReviewStatusEnum reviewStatusEnum : ReviewStatusEnum.values()) {
if (reviewStatusEnum.getCode().equals(code)) {
return reviewStatusEnum.getDesc();
}
}
return null;
}
public static Integer getCode(String desc) {
for (ReviewStatusEnum reviewStatusEnum : ReviewStatusEnum.values()) {
if (reviewStatusEnum.getDesc().equals(desc)) {
return reviewStatusEnum.getCode();
}
}
return null;
}
}
......@@ -87,8 +87,14 @@ public class HPConstant {
// 整改通知单号
public static final String RECTIFY_ID = "RECTIFY_ID";
//收款单
//收款单
public static final String CW_COLLECTION_NO = "CW_COLLECTION_NO";
//付款单号
public static final String CW_INCOME_NUMBER = "CW_INCOME_NUMBER";
//开票单号
public static final String HPCW001_BILL_NUMBER = "HPCW001_BILL_NUMBER";
//发票单号
public static final String HPCW002_BILL_NUMBER = "HPCW002_BILL_NUMBER";
}
/**
......
package com.baosight.hpjx.hp.cw.service;
import com.baosight.eplat.utils.StringUtils;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.ReviewStatusEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.cw.domain.HPCW001;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.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.ServiceEPBase;
import com.baosight.iplat4j.core.util.NumberUtils;
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 LiuYang
* @version 1.0 2024/8/16
* @description 销售开票
*/
public class ServiceHPCW001 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "销售开票",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.CUST_CODE_BLOCK_ID,
DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID,
DdynamicEnum.PROJ_CODE_BOX_BLOCK_ID,
DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
//inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPCW001().eiMetadata);
} catch (Exception 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, HPCW001.QUERY, new HPCW001());
} 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();
// 写入数据
for (Map resultRow : resultRows) {
HPCW001 hpcw001 = new HPCW001();
hpcw001.fromMap(resultRow);
if (hpcw001.getReviewStatus().equals(ReviewStatusEnum.REVIEWED.getCode())){
throw new PlatException("该数据已审核,不能保存!");
}
hpcw001.setRemainingAmount(hpcw001.getTotalContractPriceIncluding());
if (hpcw001.getId() == null || hpcw001.getId() == 0) {
this.add(hpcw001);
} else {
this.modify(hpcw001);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param hpcw001
* @return
*/
public void add(HPCW001 hpcw001) {
hpcw001.setSettlementNumber(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPCW001_BILL_NUMBER));
DaoUtils.insert(HPCW001.INSERT, hpcw001);
}
/**
* 修改操作
*
* @param hpcw001
* @return
*/
public void modify(HPCW001 hpcw001) {
DaoUtils.update(HPCW001.UPDATE, hpcw001);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "销售开票",operType = "删除",operDesc = "删除")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPCW001 hpcw001 = new HPCW001();
hpcw001.fromMap(resultRows.get(i));
if (hpcw001.getReviewStatus().equals(ReviewStatusEnum.REVIEWED.getCode())) {
throw new PlatException("该数据已审核,不能删除!");
}
DaoUtils.update(HPCW001.DELETE, hpcw001);
}
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
*/
@OperationLogAnnotation(operModul = "销售开票",operType = "修改",operDesc = "修改审核状态")
public EiInfo submit(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPCW001 hpcw001 = new HPCW001();
hpcw001.fromMap(resultRow);
hpcw001.setReviewStatus(ReviewStatusEnum.REVIEWED.getCode()); //0未审核 1已审核
DaoUtils.update(HPCW001.SUBMIT, hpcw001);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据审核成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "销售开票",operType = "修改",operDesc = "修改开票状态")
public EiInfo billing(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPCW001 hpcw001 = new HPCW001();
hpcw001.fromMap(resultRow);
hpcw001.setBillState(2); //1未开票2已开票
DaoUtils.update(HPCW001.BILLING, hpcw001);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.cw.service;
import com.baosight.eplat.utils.StringUtils;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.ReviewStatusEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.cw.domain.HPCW002;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.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.ServiceEPBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/8/16
* @description 采购开票
*/
public class ServiceHPCW002 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "采购收票",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.SUPPLIER_RECORD_BLOCK_ID,
DdynamicEnum.PROJ_CODE_BOX_BLOCK_ID,
DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
} catch (Exception 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, HPCW002.QUERY, new HPCW002());
} 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();
// 写入数据
for (Map resultRow : resultRows) {
HPCW002 hpcw002 = new HPCW002();
hpcw002.fromMap(resultRow);
if (hpcw002.getReviewStatus().equals(ReviewStatusEnum.REVIEWED.getCode())){
throw new PlatException("该数据已审核,不能保存!");
}
hpcw002.setRemainingAmount(hpcw002.getTotalContractPriceIncluding());
if (hpcw002.getId() == null || hpcw002.getId() == 0) {
this.add(hpcw002);
} else {
this.modify(hpcw002);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param hpcw002
* @return
*/
public void add(HPCW002 hpcw002) {
hpcw002.setSettlementNumber(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPCW002_BILL_NUMBER));
DaoUtils.insert(HPCW002.INSERT, hpcw002);
}
/**
* 修改操作
*
* @param hpcw002
* @return
*/
public void modify(HPCW002 hpcw002) {
DaoUtils.update(HPCW002.UPDATE, hpcw002);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购收票",operType = "删除",operDesc = "删除")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPCW002 hpcw002 = new HPCW002();
hpcw002.fromMap(resultRow);
if (hpcw002.getReviewStatus().equals(ReviewStatusEnum.REVIEWED.getCode())) {
throw new PlatException("该数据已审核,不能删除!");
}
DaoUtils.update(HPCW002.DELETE, hpcw002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 提交操作
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "采购收票",operType = "删除",operDesc = "修改审核状态")
public EiInfo submit(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPCW002 hpcw002 = new HPCW002();
hpcw002.fromMap(resultRow);
/*if (hpcw002.getReviewStatus() == 0) {
throw new PlatException("数据未审批,请先审批!");
}*/
hpcw002.setReviewStatus(ReviewStatusEnum.REVIEWED.getCode());
DaoUtils.update(HPCW002.SUBMIT, hpcw002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据审核成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "审核失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.cw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.hp.cw.domain.HPCW001;
import com.baosight.hpjx.hp.cw.domain.HPCW003A;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/8/16
* @description 收款单详情
*/
public class ServiceHPCW003A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "收款单",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID,
DdynamicEnum.PROJ_CODE_BOX_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPCW003A().eiMetadata);
} catch (Exception 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, HPCW003A.QUERY, new HPCW003A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.cw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.hp.cw.domain.HPCW001;
import com.baosight.hpjx.hp.cw.domain.HPCW003A;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/8/18
* @description 收款单
*/
public class ServiceHPCW003B extends ServiceEPBase {
@OperationLogAnnotation(operModul = "收款单",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID,
DdynamicEnum.PROJ_CODE_BOX_BLOCK_ID,
DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "收款单",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "isAmount", "0");
inInfo = super.query(inInfo, HPCW001.QUERY, new HPCW001());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.cw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.ReviewStatusEnum;
import com.baosight.hpjx.hp.cw.domain.HPCW002;
import com.baosight.hpjx.hp.cw.domain.HPCW004;
import com.baosight.hpjx.hp.cw.domain.HPCW004A;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/8/16
* @description 付款单详情
*/
public class ServiceHPCW004A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "付款单",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUPPLIER_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPCW004A().eiMetadata);
} catch (Exception 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, HPCW004A.QUERY, new HPCW004A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.cw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.hp.cw.domain.HPCW002;
import com.baosight.hpjx.hp.cw.domain.HPCW004A;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/8/18
* @description 付款单
*/
public class ServiceHPCW004B extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "付款单",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.SUPPLIER_RECORD_BLOCK_ID,
DdynamicEnum.PROJ_CODE_BOX_BLOCK_ID,
DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPCW002().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.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "isAmount", "0");
inInfo = super.query(inInfo, HPCW002.QUERY, new HPCW002());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.cw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.constant.S3Constant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.cw.domain.HPCW099;
import com.baosight.hpjx.hp.cw.tools.HPCWTools;
import com.baosight.hpjx.hp.dm.domain.HPDM099;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.util.FileUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.MapUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import org.apache.commons.collections.CollectionUtils;
import javax.xml.ws.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/8/19
* @description 附件清单
*/
public class ServiceHPCW099 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "物料清单-附件清单A-初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPCW099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "物料清单-附件清单A-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
//String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
inInfo = super.query(inInfo, "HPCW099.queryRun", new HPCW099());
} else {
inInfo = super.query(inInfo, "HPCW099.queryDev", new HPCW099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
public EiInfo queryDoc(EiInfo inInfo) {
try {
String docId = inInfo.getString("docId");
HPCW099 HPCW099 = new HPCW099();
List<HPCW099> list = new ArrayList<>();
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
// 项目环境
//String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
list = this.dao.query("HPCW099.queryRun",map);
} else {
list = this.dao.query("HPCW099.queryDev",map);
}
if (CollectionUtils.isNotEmpty(list)) {
HPCW099 = list.get(0);
inInfo.set("data",HPCW099);
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
public void add(HPCW099 HPCW099) {
DaoUtils.insert("HPCW099.insert", HPCW099);
}
public void deleteEntity(HPCW099 hpcw099) {
DaoUtils.update(HPCW099.DELETE, hpcw099);
if (!hpcw099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(hpcw099.getDocId());
}
//List<HPDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HPDM099.class);
//List<HPCW099> hpcw099List = HPCWTools.HpCw099.queryByBiz(hpcw099.getMatId(), "HJ");
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "新增",operDesc = "物料清单-附件清单A-新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try {
Long matId = null;
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPCW099 fSc002A = new HPCW099();
fSc002A.fromMap(resultRows.get(i));
matId = fSc002A.getMatId();
this.add(fSc002A);
}
/*List<HPCW099> hgcw999List = HPCWTools.HpCw099.queryByBiz(matId,"HT");
eiInfo.addBlock("detail2").addRows(hgcw999List);*/
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(eiInfo, e, "新增失败");
}
return eiInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "物料清单-附件清单A-删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
Long matId = null;
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HPCW099 fSc002A = new HPCW099();
fSc002A.fromMap(resultRows.get(i));
matId = fSc002A.getMatId();
this.deleteEntity(fSc002A);
}
/*List<HPCW099> hgcw999List = HPCWTools.HpCw099.queryByBiz(matId,"HT");
inInfo.addBlock(EiConstant.resultBlock).addRows(hgcw999List);*/
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HPDS002> list = this.dao.query(HPDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.ProjectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HPCW099.FIELD_DOC_ID,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HPDS002.DELETE,map);
}
}
}
package com.baosight.hpjx.hp.cw.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* @author LiuYang
* @version 1.0 2024/8/19
* @description 附件上传
*/
public class ServiceHPCW099A extends ServiceEPBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "上传",operDesc = "附件上传")
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-08-16 14:55:29
Version : 1.0
schema : hpjx
tableName : HPCW003A
ID BIGINT NOT NULL primarykey,
PARENT_ID BIGINT NOT NULL,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_NAME VARCHAR,
PROJ_CODE VARCHAR,
CONTRACT_NUMBER VARCHAR,
PARTY_A VARCHAR,
TOTAL_CONTRACT_PRICE_INCLUDING DECIMAL
-->
<sqlMap namespace="HPCW003A">
<typeAlias alias="HPCW003A" type="com.baosight.hpjx.hp.cw.domain.HPCW003A"/>
<sql id="column">
ID as "id",
PARENT_ID as "parentId", <!-- 上级ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
FACTORY_CODE as "factoryCode", <!-- 工厂编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PROJ_CODE as "projCode", <!-- 项目编号 -->
CONTRACT_NUMBER as "contractNumber", <!-- 来源单号 -->
PARTY_A as "partyA", <!-- 客户名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding" <!-- 收款总额 -->
</sql>
<sql id="condition">
<include refid="SqlBase.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HPCW003A">
SELECT
<include refid="column" />
FROM ${hpjxSchema}.T_HPCW003A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCW003A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPCW003A (ID,
PARENT_ID, <!-- 上级ID -->
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
FACTORY_CODE, <!-- 工厂编码 -->
FACTORY_NAME, <!-- 工厂名称 -->
PROJ_NAME, <!-- 项目名称 -->
PROJ_CODE, <!-- 项目编号 -->
CONTRACT_NUMBER, <!-- 来源单号 -->
PARTY_A, <!-- 客户名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING <!-- 收款总额 -->
)
VALUES (#id#, #parentId#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #factoryCode#, #factoryName#, #projName#, #projCode#, #contractNumber#, #partyA#, #totalContractPriceIncluding#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPCW003A WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPCW003A
SET
PARENT_ID = #parentId#, <!-- 上级ID -->
COMPANY_CODE = #companyCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
FACTORY_CODE = #factoryCode#, <!-- 工厂编码 -->
FACTORY_NAME = #factoryName#, <!-- 工厂名称 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
PROJ_CODE = #projCode#, <!-- 项目编号 -->
CONTRACT_NUMBER = #contractNumber#, <!-- 来源单号 -->
PARTY_A = #partyA#, <!-- 客户名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding# <!-- 收款总额 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-08-16 14:55:29
Version : 1.0
schema : hpjx
tableName : HPCW004
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
CONTRACT_NUMBER VARCHAR,
INCOME_NUMBER VARCHAR,
SIGNING_DATE VARCHAR,
PARTY_A VARCHAR,
CANCEL_STATUS TINYINT,
REVIEW_STATUS TINYINT,
TOTAL_CONTRACT_PRICE_INCLUDING DECIMAL
-->
<sqlMap namespace="HPCW004">
<typeAlias alias="HPCW004" type="com.baosight.hpjx.hp.cw.domain.HPCW004"/>
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
FACTORY_CODE as "factoryCode", <!-- 工厂编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 来源单号 -->
INCOME_NUMBER as "incomeNumber", <!-- 单号 -->
SIGNING_DATE as "signingDate", <!-- 付款日期 -->
PARTY_A as "partyA", <!-- 供应商名称 -->
CANCEL_STATUS as "cancelStatus", <!-- 核销状态 -->
REVIEW_STATUS as "reviewStatus", <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding" <!-- 付款总额 -->
</sql>
<sql id="condition">
<include refid="SqlBase.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
</sql>
<sql id="rangeCondition">
<isNotEmpty prepend=" AND " property="signingDateFrom">
SIGNING_DATE &gt;= replace(#signingDateFrom#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateTo">
SIGNING_DATE &lt;= replace(#signingDateTo#, '-', '')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HPCW004">
SELECT
<include refid="column" />
FROM ${hpjxSchema}.T_HPCW004 WHERE 1=1
<include refid="condition" />
<include refid="rangeCondition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCW004 WHERE 1=1
<include refid="condition" />
<include refid="rangeCondition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPCW004 (ID,
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
FACTORY_CODE, <!-- 工厂编码 -->
FACTORY_NAME, <!-- 工厂名称 -->
CONTRACT_NUMBER, <!-- 来源单号 -->
INCOME_NUMBER, <!-- 单号 -->
SIGNING_DATE, <!-- 付款日期 -->
PARTY_A, <!-- 供应商名称 -->
CANCEL_STATUS, <!-- 核销状态 -->
REVIEW_STATUS, <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING <!-- 付款总额 -->
)
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #factoryCode#, #factoryName#, #contractNumber#, #incomeNumber#, #signingDate#, #partyA#, #cancelStatus#, #reviewStatus#, #totalContractPriceIncluding#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hpjxSchema}.T_HPCW003
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPCW004 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPCW004
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
FACTORY_CODE = #factoryCode#, <!-- 工厂编码 -->
FACTORY_NAME = #factoryName#, <!-- 工厂名称 -->
CONTRACT_NUMBER = #contractNumber#, <!-- 来源单号 -->
INCOME_NUMBER = #incomeNumber#, <!-- 单号 -->
SIGNING_DATE = #signingDate#, <!-- 付款日期 -->
PARTY_A = #partyA#, <!-- 供应商名称 -->
CANCEL_STATUS = #cancelStatus#, <!-- 核销状态 -->
REVIEW_STATUS = #reviewStatus#, <!-- 审批状态 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding# <!-- 付款总额 -->
WHERE
ID = #id#
</update>
<update id="submit">
UPDATE ${hpjxSchema}.T_HPCW004
SET
REVIEW_STATUS = #reviewStatus#, <!-- 审核状态 -->
<include refid="SqlBase.updateRevise"/>
WHERE
ID = #id#
</update>
<update id="writeoff">
UPDATE ${hpjxSchema}.T_HPCW004
SET
CANCEL_STATUS = #cancelStatus#, <!-- 审核状态 -->
<include refid="SqlBase.updateRevise"/>
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-08-16 14:55:29
Version : 1.0
schema : hpjx
tableName : HPCW004A
ID BIGINT NOT NULL primarykey,
PARENT_ID BIGINT NOT NULL,
COMPANY_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
CONTRACT_NUMBER VARCHAR,
PARTY_A VARCHAR,
TOTAL_CONTRACT_PRICE_INCLUDING DECIMAL
-->
<sqlMap namespace="HPCW004A">
<typeAlias alias="HPCW004A" type="com.baosight.hpjx.hp.cw.domain.HPCW004A"/>
<sql id="column">
ID as "id",
PARENT_ID as "parentId", <!-- 主表ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
FACTORY_CODE as "factoryCode", <!-- 工厂编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 来源单号 -->
PARTY_A as "partyA", <!-- 供应商名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding" <!-- 收款总额 -->
</sql>
<sql id="condition">
<include refid="SqlBase.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="HPCW004A">
SELECT
<include refid="column" />
FROM ${hpjxSchema}.T_HPCW004A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCW004A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalContractPriceIncluding">
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPCW004A (ID,
PARENT_ID, <!-- 主表ID -->
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
FACTORY_CODE, <!-- 工厂编码 -->
FACTORY_NAME, <!-- 工厂名称 -->
CONTRACT_NUMBER, <!-- 来源单号 -->
PARTY_A, <!-- 供应商名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING <!-- 收款总额 -->
)
VALUES (#id#, #parentId#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #factoryCode#, #factoryName#, #contractNumber#, #partyA#, #totalContractPriceIncluding#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPCW004A WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPCW004A
SET
PARENT_ID = #parentId#, <!-- 主表ID -->
COMPANY_CODE = #companyCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
FACTORY_CODE = #factoryCode#, <!-- 工厂编码 -->
FACTORY_NAME = #factoryName#, <!-- 工厂名称 -->
CONTRACT_NUMBER = #contractNumber#, <!-- 来源单号 -->
PARTY_A = #partyA#, <!-- 供应商名称 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding# <!-- 收款总额 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HPCW099">
<typeAlias alias="HPCW099" type="com.baosight.hpjx.hp.cw.domain.HPCW099"/>
<sql id="column">
A.ID as "id", <!-- 主键ID -->
A.COMPANY_CODE as "companyCode", <!-- 企业编码 -->
A.FACTORY_CODE as "factoryCode", <!-- 公司编码 -->
A.FACTORY_NAME as "factoryName", <!-- 公司名称 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.MAT_ID as "matId", <!-- 物料ID -->
A.DOC_ID as "docId", <!-- 文件ID -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
A.BIZ_TYPE as "bizType" <!-- 业务类型 -->
</sql>
<sql id="columnDev">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnRun">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
MAT_ID = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCodes">
FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
</isNotEmpty>
</sql>
<!-- 开发环境 -->
<sql id="conditionDev">
AND A.DOC_ID = B.DOC_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<!-- 正式环境 -->
<sql id="conditionRun">
AND A.DOC_ID = B.RES_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="queryDev" resultClass="HPCW099">
SELECT
<include refid="columnDev"/>
FROM ${hpjxSchema}.T_HPCW099 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="countDev" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCW099 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
</select>
<select id="queryRun" resultClass="HPCW099">
SELECT
<include refid="columnRun"/>
FROM ${hpjxSchema}.T_HPCW099 A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="countRun" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPCW099 A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPCW099 (ID, <!-- 主键ID -->
COMPANY_CODE, <!-- 企业编码 -->
FACTORY_CODE, <!-- 公司编码 -->
FACTORY_NAME, <!-- 公司名称 -->
DEP_CODE, <!-- 部门编码 预留 -->
MAT_ID, <!-- 物料ID -->
DOC_ID, <!-- 文件ID -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
BIZ_TYPE <!-- 业务类型 -->
)
VALUES (#id#, #companyCode#, #factoryCode#, #factoryName#, #depCode#, #matId#, #docId#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #bizType#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPCW099 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hpjxSchema}.T_HPCW099
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 -->
FACTORY_CODE = #factoryCode#, <!-- 公司编码 -->
FACTORY_NAME = #factoryName#, <!-- 公司名称 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
MAT_ID = #matId#, <!-- 物料ID -->
DOC_ID = #docId#, <!-- 文件ID -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
BIZ_TYPE = #bizType# <!-- 业务类型 -->
WHERE
ID = #id#
</update>
<update id="batchUpdate">
UPDATE ${hpjxSchema}.T_HPCW099
SET
MAT_ID = #matId#, <!-- 物料ID -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE
DOC_ID IN <iterate close=")" open="(" conjunction="," property="docIds">#docIds[]#</iterate>
</update>
</sqlMap>
\ No newline at end of file
......@@ -105,6 +105,7 @@ public class HPKC003 extends DaoEPBase {
public static final String INSERT = "HPKC003.insert";
public static final String UPDATE = "HPKC003.update";
public static final String DELETE = "HPKC003.delete";
public static final String DELETE_PROJ_CODE = "HPKC003.deleteByProdNo";
private Long id; /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
......
......@@ -180,6 +180,10 @@
UPDATE ${hpjxSchema}.T_HPKC003 SET DELETE_FLAG = 1 WHERE ID = #id#
</update>
<update id="deleteByProdNo">
UPDATE ${hpjxSchema}.T_HPKC003 SET DELETE_FLAG = 1 WHERE PROD_NO = #prodNo#
</update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hpjxSchema}.T_HPKC003
......@@ -213,4 +217,14 @@
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, PROJ_CODE, PRDT_CODE, PART_CODE, FACTORY_CODE
</select>
<select id="queryProjCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT distinct
FACTORY_CODE as "factoryCode",
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName" <!-- 项目名称 -->
FROM ${hpjxSchema}.t_hpkc003
WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition"/>
</select>
</sqlMap>
......@@ -238,7 +238,7 @@ public class HPKCTools {
HPSC005B dbSc005b = dbSc005bMap.get(fSc005b.getProdTaskNo());
HPKC003 newKc003 = BeanUtils.copy(dbSc005b, HPKC003.class);
newKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
newKc003.setProdNo(hpsc106.getProdNo());
newKc003.setDocumentDate(DateUtils.shortDate());
newKc003.setWhCode(mapList.get(0).get("whCode"));
newKc003.setWhName(mapList.get(0).get("whName"));
......@@ -255,6 +255,40 @@ public class HPKCTools {
HPKCTools.updateProdStock(newKc003.getWhCode(), newKc003.getProdOrderNo(),
newKc003.getAmount(), newKc003.getWeight(),fSc005b.getFactoryCode());
}
public static void deleteHpKc003(List<Map> resultRows) {
//List<Map> resultRows = eiInfo.getBlock(EiConstant.resultBlock).getRows();
List<String> prodNos = ObjectUtils.listKey(resultRows, "prodNo"); //生产单号
List<String> prodOrderNos = ObjectUtils.listKey(resultRows, "prodOrderNo"); //生产订单号
// 锁库存
HPKCTools.HpKc003.lock(prodNos);
// 锁生产计划明细
HPSCTools.HpSc004.lock(prodOrderNos);
// 查询数据
Map<String, HPKC003> dbKc003Map = HPKCTools.HpKc003.map(prodNos);
for (Map resultRow : resultRows) {
HPSC106 hpsc106 = new HPSC106();
hpsc106.fromMap(resultRow);
DaoUtils.update(HPKC003.DELETE_PROJ_CODE, hpsc106);
// 生产一条负数量和产量的红冲记录
HPKC003 dbKc003 = dbKc003Map.get(hpsc106.getProdNo());
HPKC003 newKc003 = BeanUtils.copy(dbKc003, HPKC003.class);
newKc003.setAmount(dbKc003.getAmount().negate());
newKc003.setWeight(dbKc003.getWeight().negate());
newKc003.setDeleteFlag(1);
newKc003.setProdNoOld(hpsc106.getProdNo());
newKc003.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
DaoUtils.insert(HPKC003.INSERT, newKc003);
// 同步生产计划
//HPSCTools.syncPlan(newKc003.getProdOrderNo(), newKc003.getAmount());
HPSCTools.syncPlan(newKc003.getProdOrderNo(), newKc003.getAmount(), newKc003.getWeight());
// 更新生产任务已完成数量
HPSCTools.HpSc005a.updateCompleteNum(newKc003.getProdTaskNo(), newKc003.getAmount());
// 修改库存
HPKCTools.updateProdStock(newKc003.getWhCode(), newKc003.getProdOrderNo(),
newKc003.getAmount(), newKc003.getWeight(),newKc003.getFactoryCode());
}
}
}
/**
......
......@@ -2,7 +2,9 @@ package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.constant.S3Constant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.pz.domain.HPPZ009A;
import com.baosight.hpjx.util.DateUtils;
......@@ -54,7 +56,7 @@ public class ServiceHPPZ009A extends ServiceEPBase {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.ProjectEnv.RUN.equalsIgnoreCase(projectEnv)) {
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
inInfo = super.query(inInfo, "HPPZ009A.queryRun", new HPPZ009A());
} else {
inInfo = super.query(inInfo, "HPPZ009A.queryDev", new HPPZ009A());
......@@ -107,7 +109,8 @@ public class ServiceHPPZ009A extends ServiceEPBase {
hppz009A.fromMap(resultRows.get(i));
DaoUtils.update(HPPZ009A.DELETE, hppz009A);
if (!hppz009A.getDocId().isEmpty()) {
this.delectDoc(hppz009A.getDocId());
Iplat4jUtils.deleteFileByDocId(hppz009A.getDocId());
//this.delectDoc(hppz009A.getDocId());
}
}
inInfo = this.query(inInfo);
......
......@@ -2,7 +2,9 @@ package com.baosight.hpjx.hp.sb.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.constant.S3Constant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.utils.Iplat4jUtils;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.sb.domain.HPSB099;
import com.baosight.hpjx.util.FileUtils;
......@@ -40,7 +42,7 @@ public class ServiceHPSB099 extends ServiceEPBase {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.ProjectEnv.RUN.equalsIgnoreCase(projectEnv)) {
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
inInfo = super.query(inInfo, "HPSB099.queryRun", new HPSB099());
} else {
inInfo = super.query(inInfo, "HPSB099.queryDev", new HPSB099());
......@@ -61,7 +63,7 @@ public class ServiceHPSB099 extends ServiceEPBase {
hgsb099.fromMap(resultRow);
DaoUtils.update(HPSB099.DELETE, hgsb099);
if (!hgsb099.getDocId().isEmpty()) {
this.delectDoc(hgsb099.getDocId());
Iplat4jUtils.deleteFileByDocId(hgsb099.getDocId());
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
......@@ -68,6 +68,7 @@ public class HPSC002 extends DaoEPBase {
public static final String FIELD_CKNUM = "cknum"; /* 树的层级*/
public static final String FIELD_RKNUM = "rknum"; /* 树的层级*/
public static final String FIELD_QUANTITY = "quantity";
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -170,6 +171,7 @@ public class HPSC002 extends DaoEPBase {
private Integer rknum;/* 出库数量*/
private Integer projStatus;/* app项目状态*/
private BigDecimal quantity = new BigDecimal(0);
/**
* initialize the metadata.
*/
......@@ -363,6 +365,11 @@ public class HPSC002 extends DaoEPBase {
eiColumn.setDescName("APP项目状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_QUANTITY);
eiColumn.setType("N");
eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -1033,6 +1040,14 @@ public class HPSC002 extends DaoEPBase {
this.cknum = cknum;
}
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
/**
* get the value from Map.
*
......@@ -1084,6 +1099,7 @@ public class HPSC002 extends DaoEPBase {
setPgStatus(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PGSTATUS)), pgStatus));
setDeliveryDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DELIVERY_DATE)), deliveryDate));
setProjStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PROJ_STATUS)), projStatus));
setQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_QUANTITY)), quantity));
}
/**
......@@ -1135,6 +1151,7 @@ public class HPSC002 extends DaoEPBase {
map.put(FIELD_PGSTATUS, StringUtils.toString(pgStatus, eiMetadata.getMeta(FIELD_PGSTATUS)));
map.put(FIELD_DELIVERY_DATE,StringUtils.toString(deliveryDate,eiMetadata.getMeta(FIELD_DELIVERY_DATE)));
map.put(FIELD_PROJ_STATUS, StringUtils.toString(projStatus, eiMetadata.getMeta(FIELD_PROJ_STATUS)));
map.put(FIELD_QUANTITY, StringUtils.toString(quantity, eiMetadata.getMeta(FIELD_QUANTITY)));
return map;
}
}
......@@ -29,6 +29,7 @@ public class HPSC005B extends HPSC005 {
public static final String FIELD_COMPLETE_NUM = "completeNum"; /* 已完成数量*/
public static final String FIELD_UN_COMPLETE_NUM = "unCompleteNum"; /* 剩余数量*/
public static final String FIELD_ZL_PROD_TASK_NO = "zlprodTaskNo"; /* 质检单任务号*/
public static final String FIELD_IS_COMPLETE = "isComplete";
public static final String COL_CHILD_ID = "CHILD_ID";
public static final String COL_PROD_TASK_NO = "PROD_TASK_NO";
......@@ -49,6 +50,7 @@ public class HPSC005B extends HPSC005 {
private BigDecimal completeNum = new BigDecimal(0.000); /* 已完成数量*/
private BigDecimal unCompleteNum = new BigDecimal(0.000); /* 剩余数量*/
private String zlprodTaskNo = " ";
private Integer isComplete = 0;
/**
* the constructor.
......@@ -93,6 +95,10 @@ public class HPSC005B extends HPSC005 {
eiColumn = new EiColumn(FIELD_ZL_PROD_TASK_NO);
eiColumn.setDescName("质检单任务号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_IS_COMPLETE);
eiColumn.setDescName("状态");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -161,6 +167,13 @@ public class HPSC005B extends HPSC005 {
public void setZlProdTaskNo(String zlprodTaskNo) {
this.zlprodTaskNo = zlprodTaskNo;
}
public Integer getIsComplete() {
return isComplete;
}
public void setIsComplete(Integer isComplete) {
this.isComplete = isComplete;
}
/**
* get the value from Map.
*
......@@ -175,6 +188,7 @@ public class HPSC005B extends HPSC005 {
setCompleteNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COMPLETE_NUM)), completeNum));
setUnCompleteNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UN_COMPLETE_NUM)), unCompleteNum));
setZlProdTaskNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ZL_PROD_TASK_NO)), zlprodTaskNo));
setIsComplete(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_COMPLETE)), isComplete));
}
/**
......@@ -190,6 +204,7 @@ public class HPSC005B extends HPSC005 {
map.put(FIELD_COMPLETE_NUM, StringUtils.toString(completeNum, eiMetadata.getMeta(FIELD_COMPLETE_NUM)));
map.put(FIELD_UN_COMPLETE_NUM, StringUtils.toString(unCompleteNum, eiMetadata.getMeta(FIELD_UN_COMPLETE_NUM)));
map.put(FIELD_ZL_PROD_TASK_NO, StringUtils.toString(zlprodTaskNo, eiMetadata.getMeta(FIELD_ZL_PROD_TASK_NO)));
map.put(FIELD_IS_COMPLETE, StringUtils.toString(isComplete, eiMetadata.getMeta(FIELD_IS_COMPLETE)));
return map;
}
}
......@@ -47,6 +47,7 @@ public class HPSC106 extends DaoEPBase {
public static final String FIELD_updated_by = "updatedBy"; /* 更改人*/
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 修改时间*/
public static final String FIELD_PROD_NO = "prodNo"; /* 生产单号*/
//补充字段
public static final String FIELD_registered_quantity = "registeredQuantity";
......@@ -80,6 +81,7 @@ public class HPSC106 extends DaoEPBase {
public static final String COL_updated_by = "updated_by"; /* 更改人*/
public static final String COL_updated_name = "updated_name"; /* 修改人名称*/
public static final String COL_updated_time = "updated_time"; /* 修改时间*/
public static final String COL_PROD_NO = "PROD_NO"; /* 生产单号*/
public static final String QUERY = "HPSC106.query";
public static final String COUNT = "HPSC106.count";
......@@ -113,6 +115,7 @@ public class HPSC106 extends DaoEPBase {
private String updatedBy = " "; /* 更改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private String prodNo = " "; /* 生产单号*/
private BigDecimal registeredQuantity = new BigDecimal("0");
private BigDecimal registeredWeight = new BigDecimal(0);
......@@ -317,6 +320,10 @@ public class HPSC106 extends DaoEPBase {
eiColumn.setFieldLength(20);
eiColumn.setDescName("任务重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROD_NO);
eiColumn.setDescName("生产单号");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -719,6 +726,14 @@ public class HPSC106 extends DaoEPBase {
this.workCode = workCode;
}
public String getProdNo() {
return prodNo;
}
public void setProdNo(String prodNo) {
this.prodNo = prodNo;
}
/**
* get the value from Map.
*
......@@ -752,6 +767,7 @@ public class HPSC106 extends DaoEPBase {
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_by)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_name)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime));
setProdNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROD_NO)), prodNo));
setRegisteredQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_registered_quantity)), registeredQuantity));
setRegisteredWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_registered_weight)), registeredWeight));
......@@ -793,6 +809,7 @@ public class HPSC106 extends DaoEPBase {
map.put(FIELD_updated_by, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_updated_by)));
map.put(FIELD_updated_name, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_updated_name)));
map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time)));
map.put(FIELD_PROD_NO, StringUtils.toString(prodNo, eiMetadata.getMeta(FIELD_PROD_NO)));
map.put(FIELD_registered_quantity, StringUtils.toString(registeredQuantity, eiMetadata.getMeta(FIELD_registered_quantity)));
map.put(FIELD_registered_weight, StringUtils.toString(registeredWeight, eiMetadata.getMeta(FIELD_registered_weight)));
......
......@@ -314,4 +314,12 @@ public class ServiceHPSC001 extends ServiceBase {
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo));
return inInfo;
}
public EiInfo queryCustCodeBox(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.CUST_CODE_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo),MapUtils.getBoolean(queryRow, "isSplicingSymbol"));
return inInfo;
}
}
......@@ -140,7 +140,6 @@ public class ServiceHPSC101 extends ServiceEPBase {
this.modify(hpsc001);
}
}
inInfo = this.query(inInfo);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID), null);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
......
......@@ -209,7 +209,9 @@ public class ServiceHPSC102 extends ServiceEPBase {
// if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentId().equals("root")) {
// hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
// }
hpsc002.setSpec(HPPZTools.HpPz006.jointSpec(hpsc002.getLength(),hpsc002.getWidth(),hpsc002.getThick()));
if (hpsc002.getSpec().trim().isEmpty()){
hpsc002.setSpec(HPPZTools.HpPz006.jointSpec(hpsc002.getLength(),hpsc002.getWidth(),hpsc002.getThick()));
}
if(hpsc002.getParentId().equals("root")){
hpsc002.setLv(new Integer(1));
}else{
......@@ -221,7 +223,7 @@ public class ServiceHPSC102 extends ServiceEPBase {
//更新零件后,更新部件重量
if(hpsc002.getPrdtType()==3){
this.updatePrdtWt(hpsc002.getParentId());
//this.updatePrdtWt(hpsc002.getParentId());
}
if (!hpsc002.getParentId().equals("root")) {
this.checkTreeNodeLeaf(hpsc002.getParentId());
......@@ -505,11 +507,14 @@ public class ServiceHPSC102 extends ServiceEPBase {
//BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()/1000));
//hppz002.setDelStatus(CommonConstant.YesNo.NO_0.intValue());
//hppz002.setTotalWt(totalWt);
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
if (hppz002.getSpec().trim().isEmpty()){
hppz002.setSpec(HPPZTools.HpPz006.jointSpec(hppz002.getLength(),hppz002.getWidth(),hppz002.getThick()));
}
DaoUtils.update(HPSC002.UPDATE, hppz002.toMap());
//更新零件后,更新部件重量
if(hppz002.getPrdtType()==3){
this.updatePrdtWt(hppz002.getParentId());
//this.updatePrdtWt(hppz002.getParentId());
}
}
......
......@@ -102,6 +102,7 @@ public class ServiceHPSC105B extends ServiceEPBase {
hpsc106.setFactoryName(dbSc005b.getFactoryName());
hpsc106.setProdTaskNo(dbSc005b.getProdTaskNo());
hpsc106.setProdOrderNo(dbSc005b.getProdOrderNo());
hpsc106.setProdNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC003_PROD_NO));
hpsc106.setRegisterDate(StringUtil.removeHorizontalLine(resultMap.get(HPSC106.FIELD_register_date).toString()));
//hgsc008.setTotalWeight(hgsc007.getSingleWeight().multiply(new BigDecimal(hpsc106.getQuantity())));
checkAddDate(hpsc106);
......
......@@ -2,6 +2,7 @@ package com.baosight.hpjx.hp.sc.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.sc.domain.HPSC106;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
......@@ -53,8 +54,9 @@ public class ServiceHPSC106 extends ServiceEPBase {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 销售单号
List<Long> ids = ObjectUtils.listKey(resultRows, HPSC106.FIELD_ID);
//checkDeleteDate(ids);
DaoUtils.update(HPSC106.BATCH_DELETE, new HashMap<String,Object>(){{put("ids",ids);}});
HPKCTools.HpKc003.deleteHpKc003(resultRows);
//HGZLTools.THGZL002.deleteByWorkIds(ids);
/*ids.forEach( id -> {
HGSCTools.THGSC099.deleteByMatId(id, HGConstant.FileBizType.SCBG);
......
......@@ -205,16 +205,43 @@
<select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
PROJ_CODE as "projCode",
PROJ_NAME as "projName"
FROM ${hpjxSchema}.t_hpsc001 WHERE 1=1
A.PROJ_CODE as "projCode",
A.PROJ_NAME as "projName",
A.PRINC2 as "princ2",
B.CUST_NAME as "custName"
FROM ${hpjxSchema}.t_hpsc001 A
LEFT JOIN ${hpjxSchema}.T_HPPZ003 B ON A.PRINC2 = B.CUST_CODE
WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE LIKE ('%$projCode$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
A.STATUS = #status#
</isNotEmpty>
ORDER BY A.PROJ_CODE
</select>
<select id="queryCustCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
A.PRINC2 as "custCode",
B.CUST_NAME as "custName"
FROM ${hpjxSchema}.t_hpsc001 A
LEFT JOIN ${hpjxSchema}.T_HPPZ003 B ON A.PRINC2 = B.CUST_CODE
WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
A.PROJ_CODE LIKE ('%$projCode$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
A.STATUS = #status#
</isNotEmpty>
ORDER BY PROJ_CODE
ORDER BY A.PRINC2
</select>
<select id="queryProjCode" parameterClass="java.util.HashMap"
......
......@@ -38,7 +38,8 @@
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
DELIVERY_DATE as "deliveryDate"
DELIVERY_DATE as "deliveryDate",
QUANTITY as "quantity"
</sql>
<sql id="column1">
......@@ -78,7 +79,8 @@
A.WIDTH as "width", <!-- 宽 -->
A.THICK as "thick", <!-- 厚 -->
B.STATUS as "pgStatus", <!-- 派工状态 -->
A.DELIVERY_DATE as "deliveryDate"
A.DELIVERY_DATE as "deliveryDate",
A.QUANTITY as "quantity"
</sql>
<sql id="condition">
......@@ -281,12 +283,13 @@
LENGTH, <!-- 长 -->
WIDTH, <!-- 宽 -->
THICK, <!-- 厚 -->
DELIVERY_DATE )
DELIVERY_DATE,
QUANTITY )
VALUES (#id#, #companyCode#, #depCode#, #projCode#, #projName#, #parentId#, #parentPrdtName#,
#type#, #leaf#, #sort#, #icon#, #prdtType#, #prdtCode#, #prdtName#, #inventRecordId#, #num#,
#unitWt#, #totalWt#, #filePath1#, #filePath2#, #filePath3#, #filePath4#, #filePath5#, #status#,
#delStatus#, #createdBy#, #createdTime#, #updatedBy#, #updatedTime#, #remark#, #lv#, #spec#,
#length#, #width#, #thick#, #deliveryDate#)
#length#, #width#, #thick#, #deliveryDate#, #quantity#)
</insert>
<!-- 删除 -->
......@@ -336,7 +339,8 @@
LENGTH = #length#, <!-- 长 -->
WIDTH = #width#, <!-- 宽 -->
THICK = #thick#, <!-- 厚 -->
DELIVERY_DATE = #deliveryDate#
DELIVERY_DATE = #deliveryDate#,
QUANTITY = #quantity#
WHERE
ID = #id#
</update>
......
......@@ -40,7 +40,11 @@
B.ORG_NO as "orgNo",
B.ORG_NAME as "orgName",
C.PROD_TASK_NO as "zlprodTaskNo",
A.DELIVERY_DATE as "deliveryDate"
A.DELIVERY_DATE as "deliveryDate",
case when B.NUM - B.COMPLETE_NUM = 0 then 2
when B.COMPLETE_NUM &gt;0 and B.NUM - B.COMPLETE_NUM &gt; 0 then 1
else 0
end as "isComplete"
</sql>
<sql id="authCondition">
......@@ -121,10 +125,13 @@
A.STATUS IN <iterate close=")" open="(" conjunction="," property="statuses">#statuses[]#</iterate>
</isNotEmpty>
<isEqual prepend=" AND " property="isComplete" compareValue="0">
B.NUM - B.COMPLETE_NUM &gt; 0
B.COMPLETE_NUM = 0 AND B.NUM - B.COMPLETE_NUM = B.NUM
</isEqual>
<isEqual prepend=" AND " property="isComplete" compareValue="1">
B.NUM - B.COMPLETE_NUM = 0
B.COMPLETE_NUM >0 AND B.NUM - B.COMPLETE_NUM &gt; 0
</isEqual>
<isEqual prepend=" AND " property="isComplete" compareValue="2">
B.NUM &gt; 0 AND B.NUM - B.COMPLETE_NUM = 0
</isEqual>
</sql>
......
......@@ -58,7 +58,8 @@
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更改人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 修改时间 -->
updated_time as "updatedTime", <!-- 修改时间 -->
prod_no as "prodNo"
</sql>
<sql id="condition">
......@@ -137,6 +138,12 @@
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodNo">
prod_no = #prodNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodNos">
prod_no IN <iterate close=")" open="(" conjunction="," property="prodNos">#prodNos[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HPSC106">
......@@ -260,12 +267,13 @@
created_time, <!-- 创建时间 -->
updated_by, <!-- 更改人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 修改时间 -->
updated_time, <!-- 修改时间 -->
prod_no
)
VALUES (#id#, #companyCode#, #depCode#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #projCode#,
#projName#, #prodOrderNo#, #prodTaskNo#, #workCode#, #productType#, #productCode#, #productName#,
#registerDate#, #quantity#, #singleWeight#, #totalWeight#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#)
#updatedBy#, #updatedName#, #updatedTime#, #prodNo#)
<selectKey resultClass="java.lang.Long" keyProperty="id">
SELECT MAX(ID) FROM ${hpjxSchema}.T_HPSC106
</selectKey>
......@@ -306,7 +314,8 @@
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更改人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 修改时间 -->
updated_time = #updatedTime#, <!-- 修改时间 -->
prod_no = #prodNo#
WHERE
ID = #id#
</update>
......
......@@ -20,6 +20,7 @@
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......
package com.baosight.iplat4j.core.security;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.util.StringUtils;
import com.baosight.iplat4j.core.web.WebUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.util.matcher.OrRequestMatcher;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* @author:songx
* @date:2024/8/26,17:01
*/
public class PlatServiceValidateFilter implements Filter {
private final Logger logger = LogManager.getLogger(PlatServiceValidateFilter.class);
protected ITokenValidateFilter iTokenValidateFilter = null;
private AuthenticationEntryPoint entryPoint;
private String filterServiceId = null;
private OrRequestMatcher orRequestMatcher;
public PlatServiceValidateFilter() {
}
public void setFilterServiceId(String filterServiceId) {
this.filterServiceId = filterServiceId;
}
protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse,
FilterChain filterChain) throws ServletException, IOException {
String ip = WebUtils.getRemoteAddr(httpServletRequest);
this.logger.debug("******cached ip:" + ip + "**********");
boolean authed = false;
String uri = httpServletRequest.getServletPath();
SecurityContext context = SecurityContextHolder.getContext();
if (context != null && context.getAuthentication() != null) {
Collection<? extends GrantedAuthority> authoritis = context.getAuthentication().getAuthorities();
if (authoritis != null && !authoritis.isEmpty()) {
Iterator var9 = authoritis.iterator();
while (var9.hasNext()) {
GrantedAuthority authority = (GrantedAuthority) var9.next();
authed = authority.getAuthority().equals("ROLE_VERIFIED");
if (!authed && authority.getAuthority().equals("CHANGEPASS")) {
authed = uri.indexOf("service/XS0104/") >= 0;
}
if (authed) {
break;
}
}
}
}
if (uri.indexOf("service") < 0) {
authed = true;
}
// modify by songx at 20240826 if条件去掉authed,否则token会串
if (this.iTokenValidateFilter != null) {
this.iTokenValidateFilter.doFilter(httpServletRequest, httpServletResponse);
if (!authed) {
authed = this.isAuthedByJwt(httpServletRequest);
}
}
Map headerMap = new HashMap();
Enumeration<String> headerNames = httpServletRequest.getHeaderNames();
String headValue;
String serviceParam;
boolean hasXPlatHeader;
for (hasXPlatHeader = false; headerNames.hasMoreElements(); headerMap.put(serviceParam, headValue)) {
String name = (String) headerNames.nextElement();
headValue = httpServletRequest.getHeader(name);
this.logger.debug("******cached header:" + name + "****** value:" + headValue + "********");
serviceParam = name.toLowerCase();
if (serviceParam.contains("xplat")) {
hasXPlatHeader = true;
}
}
if (authed) {
filterChain.doFilter(httpServletRequest, httpServletResponse);
} else {
try {
EiInfo securityInfo = new EiInfo();
securityInfo.set("headerMap", headerMap);
securityInfo.set("clientIp", ip);
if (uri.indexOf("service/") > 0) {
String[] uriParts = uri.split("service/");
serviceParam = uriParts[uriParts.length - 1];
if (serviceParam.contains("/")) {
String[] serviceInfos = serviceParam.split("/");
securityInfo.set("paramServiceName", serviceInfos[0]);
securityInfo.set("paramMethodName", serviceInfos[1]);
} else {
securityInfo.set("paramServiceId", serviceParam);
}
}
securityInfo.set("uri", uri);
EiInfo outInfo = null;
if (StringUtils.isNotEmpty(this.filterServiceId)) {
securityInfo.set(EiConstant.serviceId, this.filterServiceId);
outInfo = XServiceManager.call(securityInfo);
} else {
if (!hasXPlatHeader) {
throw new AccessDeniedException("Access is denied, reason: no service validate public key!");
}
securityInfo.set(EiConstant.serviceName, "EPFI01");
securityInfo.set(EiConstant.methodName, "validate");
outInfo = XLocalManager.call(securityInfo);
}
if (outInfo.getStatus() < 0) {
throw new AccessDeniedException("Access is denied, reason:" + outInfo.getMsg());
}
Object jwtMapObj = outInfo.get("jwt_map");
if (jwtMapObj != null && jwtMapObj instanceof Map) {
httpServletRequest.setAttribute("jwt_map", jwtMapObj);
}
filterChain.doFilter(httpServletRequest, httpServletResponse);
} catch (Exception var15) {
if (this.orRequestMatcher != null && this.orRequestMatcher.matches(httpServletRequest)) {
filterChain.doFilter(httpServletRequest, httpServletResponse);
} else {
this.logger.warn(var15.getMessage());
if (this.entryPoint == null) {
if (var15 instanceof AccessDeniedException) {
throw var15;
}
throw new AccessDeniedException("Access is denied, reason:" + var15.getMessage());
}
this.entryPoint.commence(httpServletRequest, httpServletResponse, (AuthenticationException) null);
}
}
}
}
private boolean isAuthedByJwt(HttpServletRequest httpServletRequest) {
boolean authed = false;
Object jwtMapObj = httpServletRequest.getAttribute("jwt_map");
if (jwtMapObj != null && jwtMapObj instanceof Map) {
Map jwtMap = (Map) jwtMapObj;
String s_loginName = (String) jwtMap.get("sub");
if (s_loginName != null) {
authed = true;
}
}
return authed;
}
public void init(FilterConfig filterConfig) throws ServletException {
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
this.doFilterInternal((HttpServletRequest) request, (HttpServletResponse) response, chain);
}
public void destroy() {
}
public OrRequestMatcher getOrRequestMatcher() {
return this.orRequestMatcher;
}
public void setOrRequestMatcher(OrRequestMatcher orRequestMatcher) {
this.orRequestMatcher = orRequestMatcher;
}
public AuthenticationEntryPoint getEntryPoint() {
return this.entryPoint;
}
public void setEntryPoint(AuthenticationEntryPoint entryPoint) {
this.entryPoint = entryPoint;
}
public void setITokenValidateFilter(ITokenValidateFilter iTokenValidateFilter) {
this.iTokenValidateFilter = iTokenValidateFilter;
}
}
......@@ -15,6 +15,14 @@
<!-- 用户服务 -->
<sqlMap resource="com/baosight/hpjx/hp/xs/sql/HPXS007A.xml"/>
<!--财务服务-->
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW001.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW002.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW003.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW003A.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW004.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/cw/sql/HPCW004A.xml"/>
<!--设备管理-->
<sqlMap resource="com/baosight/hpjx/hp/sb/sql/HPSB003.xml"/>
<sqlMap resource="com/baosight/hpjx/hp/sb/sql/HPSB004.xml"/>
......
$(function() {
var projCodeBox = __eiInfo.getBlock("projCodeBox_block_id").getMappedRows();
var custCodeBox = __eiInfo.getBlock("custCode_block_id").getMappedRows();
// 查询
$("#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 = "";
if (item.companyCode){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
}
return template;
}
},{
field: "projCode",
filter:function (options) {
var factoryCode = options.model['factoryCode'];
if(factoryCode) {
// 返回我们过滤后的数据集
return _.filter(projCodeBox, function (item) {
return item["param1Field"]==factoryCode;
})
}
return options.values;
}
},{
field: "partyA",
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-projCode", options.model["projCode"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPSC001");
inInfo.set("methodName", "queryCustCodeBox");
inInfo.set("blockId", "custCode_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},{
field: "signingDate",
defaultValue: function () {
return currShortDate();
}
}
],
loadComplete: function (grid) {
//此grid对象
$("#SUBMIT").on("click",submitFunc);
$("#BTN_BILL").on("click",billFunc);
grid.dataSource.bind("change",function(e){
var item = e.items[0];
if(e.field == "totalContractPriceIncluding" || e.field == "taxPoints"){
if(item.taxPoints && item.totalContractPriceIncluding){
let thisSettlementAmount = item.totalContractPriceIncluding / (item.taxPoints / 100 + 1);
let thisSettlementTax = item.totalContractPriceIncluding-thisSettlementAmount;
// 使用toFixed方法四舍五入到两位小数,并转换为数字
thisSettlementAmount = Number(thisSettlementAmount.toFixed(2));
// 使用toFixed方法四舍五入到两位小数,并转换为数字
thisSettlementTax = Number(thisSettlementTax.toFixed(2));
resultGrid.setCellValue(item,'thisSettlementTax',thisSettlementTax)
resultGrid.setCellValue(item,'thisSettlementAmount',thisSettlementAmount)
}
loadChange(grid,e,"price");
}else if (e.field == "projCode"){
if (!item.factoryCode){
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i].valueField == item.projCode){
resultGrid.setCellValue(item,'factoryCode',projCodeBox[i].param1Field);
resultGrid.setCellValue(item,'projName',projCodeBox[i].textField);
break;
}
}
}
loadChange(grid,e,"partyA");
}else if (e.field == "factoryCode"){
loadChange(grid,e,"projCode");
}
})
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
saveFunc(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
downKeyUp();
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
function saveFunc(btn) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let factoryCode= item.get("factoryCode");
let projCode= item.get("projCode");
let partyA= item.get("partyA");
let totalContractPriceIncluding= item.get("totalContractPriceIncluding");
let reviewStatus= item.get("reviewStatus");
let billState= item.get("billState");
let billNumber= item.get("billNumber");
if(isBlank(factoryCode)){
message("选中的第"+(index+1)+"行\"工厂代码\",不能为空!");
flag = false;
return false;
}
if(isBlank(projCode)){
message("选中的第"+(index+1)+"行\"项目代码\",不能为空!");
flag = false;
return false;
}
if(isBlank(partyA)){
message("选中的第"+(index+1)+"行\"客户名称\",不能为空!");
flag = false;
return false;
}
if(!isNumber(totalContractPriceIncluding) && !isPositiveNumber(totalContractPriceIncluding)){
message("勾选的第" + (index+1) + "行开票总额必须是大于0的数字");
flag = false;
return false;
}
if((reviewStatus === "1")){
message("勾选的第" + (index+1) + "行数据已审核,无法修改");
flag = false;
return false;
}
if((billState === "2")){
message("勾选的第" + (index+1) + "行数据已开票,无法修改");
flag = false;
return false;
}
if((reviewStatus === "1")){
message("勾选的第" + (index+1) + "行数据已审核,无法修改");
flag = false;
return false;
}
if(isBlank(billNumber)){
message("选中的第"+(index+1)+"行\"开票单号\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW001", "save", true,
function (e) {
//detailGrid.setEiInfo(e);
//query();
});
//释放禁用按钮
btn.attr("disabled", false);
}
});
}
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function fileDetailFunc(id) {
JSColorbox.open({
href: "HPCW099?methodName=initLoad&inqu_status-0-bizType=HJCW001&inqu_status-0-matId=" + id + "&efParentFormEname=HPCW001",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row, index) {
let billNumber= row.get("billNumber");
if (row.reviewStatus == "1") {
message("勾选的数据中有已经审核的票据!");
flag = false;
}
if(isBlank(billNumber)){
message("选中的第"+(index+1)+"行\"发票号\",不能为空!");
flag = false;
return false;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"审核\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW001", "submit", true,
function (e) {
//detailGrid.setEiInfo(e);
query();
});
}
});
}
}
function billFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.billState == "2") {
message("勾选的数据中有已经开票的票据!");
flag = false;
}
if (row.billNumber == " ") {
message("勾选的数据中发票号为空");
flag = false;
}
}
)
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"开票\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW001", "billing", true,
function (e) {
//detailGrid.setEiInfo(e);
query();
});
}
});
}
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/16
Time: 17:53
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="销售开票">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="工厂" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="开票日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFSelect blockId="inqu_status" row="0" ename="partyA" cname="客户名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="票据类型" ename="inqu_status-0-billTybe" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcw.billTybe"/>
</EF:EFSelect>
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" placeholder="模糊发票号"/>
<EF:EFSelect cname="开票状态" ename="inqu_status-0-billState" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcw.billState"/>
</EF:EFSelect>
<EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus" condition = "ITEM_CODE IN ('0','1')"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" autoBind="true" queryMethod="query">
<EF:EFColumn ename="id" cname="主键" primaryKey="true" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="140" required="true"
align="center" filter="contains" sort="true" />
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="projCodeBox_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="140" required="true"
align="center" filter="contains" sort="true" />
<EF:EFColumn ename="projName" cname="项目名称" width="160" enable="false" readonly="true" align="center" hidden="true"/>
<EF:EFComboColumn ename="partyA" cname="客户名称" blockName="custCode_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="160" required="true"
align="center" filter="contains" sort="true" />
<EF:EFColumn ename="settlementNumber" cname="开票单号" width="140" enable="false" readonly="true" align="center" hidden="true"/>
<EF:EFComboColumn ename="billTybe" cname="票据类型" width="120" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpcw.billTybe"/>
</EF:EFComboColumn>
<EF:EFColumn ename="signingDate" cname="开票日期" width="120" enable="true" readonly="false" align="center"
editType="date" parseFormats="['yyyyMMdd']" parseFormat="yyyy-MM-dd"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="140" format="{0:N0}" align="center" required="true"/>
<EF:EFComboColumn ename="taxPoints" cname="税率" width="120" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" defaultValue="13">
<EF:EFCodeOption codeName="hpjx.hpcw.taxPoints"/>
</EF:EFComboColumn>
<EF:EFColumn ename="totalContractPriceIncluding" cname="开票总额" width="120" enable="true" readonly="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="thisSettlementAmount" cname="不含税金额" width="120" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" readonly="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="15" required="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFComboColumn ename="billState" cname="开票状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpcw.billState"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
$(function() {
var projCodeBox = __eiInfo.getBlock("projCodeBox_block_id").getMappedRows();
// 查询
$("#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 = "";
if (item.companyCode){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
}
return template;
}
},{
field: "projCode",
filter:function (options) {
var factoryCode = options.model['factoryCode'];
if(factoryCode) {
// 返回我们过滤后的数据集
return _.filter(projCodeBox, function (item) {
return item["param1Field"]==factoryCode;
})
}
return options.values;
},
},{
field: "signingDate",
defaultValue: function () {
return currShortDate();
}
},{
field: "receiveDate",
defaultValue: function () {
return currShortDate();
}
}],
loadComplete: function (grid) {
//$("#BTN_UPDATE").on("click",updateFunc);
$("#SUBMIT").on("click",submitFunc);
$("#B_SAVE").on("click",saveFunc);
grid.dataSource.bind("change",function(e){
var item = e.items[0];
if(e.field == "totalContractPriceIncluding" || e.field == "taxPoints"){
if(item.taxPoints && item.totalContractPriceIncluding){
let thisSettlementAmount = item.totalContractPriceIncluding / (item.taxPoints / 100 + 1);
let thisSettlementTax = item.totalContractPriceIncluding-thisSettlementAmount;
// 使用toFixed方法四舍五入到两位小数,并转换为数字
thisSettlementAmount = Number(thisSettlementAmount.toFixed(2));
// 使用toFixed方法四舍五入到两位小数,并转换为数字
thisSettlementTax = Number(thisSettlementTax.toFixed(2));
resultGrid.setCellValue(item,'thisSettlementTax',thisSettlementTax)
resultGrid.setCellValue(item,'thisSettlementAmount',thisSettlementAmount)
}
loadChange(grid,e,"price");
}else if (e.field == "projCode"){
if (!item.factoryCode){
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i].valueField == item.projCode){
resultGrid.setCellValue(item,'factoryCode',projCodeBox[i].param1Field);
resultGrid.setCellValue(item,'projName',projCodeBox[i].textField);
break;
}
}
}
loadChange(grid,e,"partyA");
}else if (e.field == "factoryCode"){
loadChange(grid,e,"projCode");
}
})
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
saveFunc(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
downKeyUp();
});
$(window).load(function () {
// 查
//query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
function saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let reviewStatus= item.get("reviewStatus");
let signingDate = item.get("signingDate");
let factoryCode= item.get("factoryCode");
let projCode= item.get("projCode");
let partyA= item.get("partyA");
let totalContractPriceIncluding= item.get("totalContractPriceIncluding");
if(isBlank(factoryCode)){
message("选中的第"+(index+1)+"行\"工厂代码\",不能为空!");
flag = false;
return false;
}
if(isBlank(projCode)){
message("选中的第"+(index+1)+"行\"项目代码\",不能为空!");
flag = false;
return false;
}
if(isBlank(partyA)){
message("选中的第"+(index+1)+"行\"供应商名称\",不能为空!");
flag = false;
return false;
}
if((reviewStatus === "1")){
message("选中的第"+(index+1)+"行数据已审核,不能修改!");
flag = false;
return false;
}
if(isBlank(signingDate)){
message("选中的第"+(index+1)+"行\"发票日期\",不能为空!");
flag = false;
return false;
}
if(!isNumber(totalContractPriceIncluding) && !isPositiveNumber(totalContractPriceIncluding)){
message("勾选的第" + (index+1) + "行开票总额必须是大于0的数字");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW002", "save", true,
function (e) {
//detailGrid.setEiInfo(e);
query();
});
}
});
}
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function fileDetailFunc(id) {
JSColorbox.open({
href: "HPCW099?methodName=initLoad&inqu_status-0-bizType=HJCW002&inqu_status-0-matId=" + id + "&efParentFormEname=HPCW002",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row, index) {
let billNumber= row.get("billNumber");
if (isBlank(row.billTybe)) {
message("勾选的数据中未选择票据类型!");
flag = false;
}
if (row.reviewStatus == "1") {
message("勾选的数据中有已经审批的数据,不能审批!");
flag = false;
}
if(isBlank(billNumber)){
message("选中的第"+(index+1)+"行\"发票号\",不能为空!");
flag = false;
return false;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW002", "submit", true,
function (e) {
//detailGrid.setEiInfo(e);
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}"/>
<head>
</head>
<EF:EFPage title="采购收票">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="工厂" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="收票日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFSelect blockId="inqu_status" row="0" ename="partyA" cname="供应商名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="supplier_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="票据类型" ename="inqu_status-0-billTybe" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcw.billTybe"/>
</EF:EFSelect>
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" placeholder="模糊发票号"/>
<EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus" condition = "ITEM_CODE IN ('0','1')"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" autoBind="true" queryMethod="query">
<EF:EFColumn ename="id" cname="主键" primaryKey="true" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="160" required="true"
align="center" filter="contains" sort="true" />
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="projCodeBox_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="160" required="true"
align="center" filter="contains" sort="true" />
<EF:EFComboColumn ename="partyA" cname="供应商名称" blockName="supplier_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="160" required="true"
align="center" filter="contains" sort="true" />
<EF:EFColumn ename="settlementNumber" cname="发票单号" width="200" enable="false" readonly="true" align="center" hidden="true"/>
<EF:EFComboColumn ename="billTybe" cname="票据类型" width="120" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpcw.billTybe"/>
</EF:EFComboColumn>
<EF:EFColumn ename="receiveDate" cname="收票日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" />
<EF:EFColumn ename="signingDate" cname="开票日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" />
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="true" readonly="false" align="center"/>
<EF:EFComboColumn ename="taxPoints" cname="税率" width="120" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" defaultValue="13">
<EF:EFCodeOption codeName="hpjx.hpcw.taxPoints"/>
</EF:EFComboColumn>
<EF:EFColumn ename="totalContractPriceIncluding" cname="发票总额" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="thisSettlementAmount" cname="不含税金额" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
$(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 = '';
if (item.companyCode){
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="contractDetailFunc(' + item.id + ')">收款清单</a>';
}
return template;
}
},{
field: "signingDate",
defaultValue: function () {
return currShortDate();
}
}
],
loadComplete: function (grid) {
$("#BTN_CHOICE").on("click",choiceFunc);
$("#BTN_UPDATE").on("click",updateFunc);
$("#BTN_SUBMIT").on("click",submitFunc);
$("#BTN_WRITEOFF").on("click",writeoffFunc);
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveResult1Func();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
$("#result-0-projCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-projCode"));
$("#result-0-projName").val(textField);
})
downKeyUp();
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 选择销售开票
*/
function choiceFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length == 1 || rows.length == 0) {
var mainId = "";
if (rows.length == 1) {
mainId = rows[0].id;
}
JSColorbox.open({
href: "HPCW003B?methodName=initLoad&inqu_status-0-hiddenConditions=1" +
"&inqu_status-0-billState=2" + /*已开票*/
"&inqu_status-0-reviewStatus=1" + /*已审核*/
"&inqu_status-0-mainId=" + mainId +
"&efParentFormEname=HPCW003",
title: "<div style='text-align: center;'>销售开票</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
} else {
message("请选择一条数据或不选择数据");
return;
}
}
/**
* 修改
*/
function updateFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
if (rows[0].cancelStatus == "1") {
message("已经核销的单据不能修改");
return;
}
JSColorbox.open({
href: "HPCW001B?methodName=initLoad&inqu_status-0-mainId=" + rows[0].id + "&efParentFormEname=HPCW003",
title: "<div style='text-align: center;'>收款清单</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function saveResult1Func() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请至少选择一条数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW003", "save", true,
function (e) {
//detailGrid.setEiInfo(e);
//query();
});
}
});
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请至少选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.cancelStatus == "1") {
message("勾选的数据中有未核销的单据!");
flag = false;
return;
}
if (row.reviewStatus == "3") {
message("勾选的数据中有已经提交的单据!");
flag = false;
return;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW003", "submit", true,
function (e) {
//detailGrid.setEiInfo(e);
//query();
});
}
});
}
}
function writeoffFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请至少选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.cancelStatus == "1") {
message("勾选的数据中有已经核销的单据!");
flag = false;
return;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"核销\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW003", "writeoff", true,
function (e) {
//detailGrid.setEiInfo(e);
//query();
});
/*var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HPCW001", "writeoff", 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");
}
});*/
}
});
}
}
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let cancelStatus= item.get("cancelStatus");
if(cancelStatus === "2"){
message("选中的第"+(index+1)+"行记录为核销状态,不能删除!");
flag = false;
return;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW003", "delete", true);
}
});
}
}
function contractDetailFunc(id) {
JSColorbox.open({
href: "HPCW003A?methodName=initLoad&inqu_status-0-parentId=" + id + "&efParentFormEname=HPCW003",
title: "<div style='text-align: center;'>收款详情</div>",
width: "80%",
height: "80%",
callbackName: windowCallback
});
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/16
Time: 17:54
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
</head>
<EF:EFPage title="收款单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="收款日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFSelect blockId="inqu_status" row="0" ename="partyA" cname="客户名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="核销状态" ename="inqu_status-0-cancelStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.cancelStatus"/>
</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="100" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="140" required="true"
align="center" filter="contains" sort="true" />
<EF:EFComboColumn ename="partyA" cname="客户名称" blockName="customer_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="160" required="true"
align="center" filter="contains" sort="true" />
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="projCodeBox_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="140" required="true"
align="center" filter="contains" sort="true" />
<EF:EFColumn ename="projName" cname="项目编码" hidden="true"/>
<EF:EFColumn ename="signingDate" cname="收款日期" width="100" align="center" readonly="true"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="contractNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="incomeNumber" cname="收款单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="收款总额" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFComboColumn ename="cancelStatus" cname="核销状态" width="100" align="center" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcw.cancelStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveFunc();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
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 cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HPCW003A", "save", 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");
}
});
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
}
});
}
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW003A", "delete", true);
}
});
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/16
Time: 17:54
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="收款清单">
<EF:EFInput cname="隐藏条件" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="projCodeBox_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="140" required="true"
align="center" filter="contains" sort="true" />
<EF:EFComboColumn ename="partyA" cname="客户名称" blockName="customer_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="160" required="true"
align="center" filter="contains" sort="true" />
<EF:EFColumn ename="contractNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="收款总额" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
}
}
downKeyUp();
});
$(window).load(function () {
// 查
//query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let thisAmount = rows[i]['thisAmount'];
let remainingAmount = rows[i]['remainingAmount'];
if (!isNumber(thisAmount) && !isPositiveNumber(thisAmount)) {
message("勾选的第" + (i + 1) + "行本次收款金额必须是大于0的数字");
return;
}
if (parseFloat(thisAmount) > parseFloat(remainingAmount)) {
message("第" + (i + 1) + "行本次收款金额不能大于剩余开票金额");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成收款单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW003", "select", true,
function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/18
Time: 19:58
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="销售开票">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="隐藏条件" ename="reviewStatus" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="隐藏条件" ename="billState" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="工厂" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="开票日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFSelect blockId="inqu_status" row="0" ename="partyA" cname="客户名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="customer_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="票据类型" ename="inqu_status-0-billTybe" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcw.billTybe"/>
</EF:EFSelect>
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" placeholder="模糊查询发票号" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" autoBind="true" queryMethod="query">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="140" required="false"
align="center" filter="contains" sort="true" />
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="projCodeBox_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="140" required="false"
align="center" filter="contains" sort="true" />
<EF:EFComboColumn ename="partyA" cname="客户名称" blockName="customer_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="160" required="false"
align="center" filter="contains" sort="true" />
<EF:EFColumn ename="thisAmount" cname="本次收款金额" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="false"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="200" enable="false" readonly="true" align="center" hidden="true"/>
<EF:EFComboColumn ename="billTybe" cname="票据类型" width="120" align="center" required="false"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpcw.billTybe"/>
</EF:EFComboColumn>
<EF:EFColumn ename="signingDate" cname="开票日期" width="120" enable="false" editType="date" parseFormats="['yyyyMMdd']" parseFormat="yyyy-MM-dd" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="不含税金额" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="开票总额" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</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>
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/16
Time: 17:55
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
</head>
<EF:EFPage title="付款单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="factoryCode" cname="工厂" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="付款日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFSelect blockId="inqu_status" row="0" ename="partyA" cname="供应商名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="supplier_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="核销状态" ename="inqu_status-0-cancelStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpcw.cancelStatus"/>
</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="100" align="center"/>
<EF:EFComboColumn ename="factoryCode" cname="工厂" blockName="factory_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="160" required="true"
align="center" filter="contains" sort="true" />
<EF:EFColumn ename="factoryName" cname="工厂名称" hidden="true"/>
<EF:EFComboColumn ename="partyA" cname="供应商名称" blockName="supplier_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="160" required="true"
align="center" filter="contains" sort="true" />
<EF:EFColumn ename="signingDate" cname="付款日期" width="100" align="center" readonly="true"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="contractNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="incomeNumber" cname="付款单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="付款总额" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" readonly="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFComboColumn ename="cancelStatus" cname="核销状态" width="100" align="center" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpcw.cancelStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="reviewStatus" cname="审核状态" width="100" align="center" readonly="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hpjx.hpcw.reviewStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveFunc();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
downKeyUp();
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HPCW004A", "save", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
}
});
}
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPCW004A", "delete", true);
}
});
}
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