Commit f2176c5c by 宋祥

1.北湖德诚文档库

parent 75826542
...@@ -89,4 +89,19 @@ public class CommonConstant { ...@@ -89,4 +89,19 @@ public class CommonConstant {
// 企业管理员 // 企业管理员
public static final String COMPANY_MANAGE = "companyManage"; public static final String COMPANY_MANAGE = "companyManage";
} }
/**
* 环境变量
*
* @author:songx
* @date:2024/1/20,15:04
*/
public static class FileLocation {
// 本地
public static final String LOCAL = "local";
// S3
public static final String S3 = "s3";
}
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="SqlBase">
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
</sqlMap>
...@@ -76,7 +76,7 @@ public class ServiceHGCB001 extends ServiceBase { ...@@ -76,7 +76,7 @@ public class ServiceHGCB001 extends ServiceBase {
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGCB001> hgcb001List = MapUtils.toDaoEPBase(resultRows,HGCB001.class); List<HGCB001> hgcb001List = MapUtils.toDaoEPBases(resultRows,HGCB001.class);
checkRepetition(hgcb001List); checkRepetition(hgcb001List);
// 写入数据 // 写入数据
Optional.ofNullable(hgcb001List).orElse(new ArrayList<>()).forEach(hgcb001 -> { Optional.ofNullable(hgcb001List).orElse(new ArrayList<>()).forEach(hgcb001 -> {
...@@ -189,7 +189,7 @@ public class ServiceHGCB001 extends ServiceBase { ...@@ -189,7 +189,7 @@ public class ServiceHGCB001 extends ServiceBase {
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGCB001> hgcb001List = MapUtils.toDaoEPBase(resultRows,HGCB001.class); List<HGCB001> hgcb001List = MapUtils.toDaoEPBases(resultRows,HGCB001.class);
Optional.ofNullable(hgcb001List).orElse(new ArrayList<>()).stream().forEach(o -> { Optional.ofNullable(hgcb001List).orElse(new ArrayList<>()).stream().forEach(o -> {
AssertUtils.isTrue(o.getAccountPeriodStatus()== CommonConstant.YesNo.NO_0,String.format( AssertUtils.isTrue(o.getAccountPeriodStatus()== CommonConstant.YesNo.NO_0,String.format(
"%s[%s]账期已关账,无法删除!",o.getCompanyName(),o.getAccountPeriod() "%s[%s]账期已关账,无法删除!",o.getCompanyName(),o.getAccountPeriod()
......
...@@ -88,7 +88,7 @@ public class ServiceHGCG001 extends ServiceBase { ...@@ -88,7 +88,7 @@ public class ServiceHGCG001 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "保存") @OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGCG001> fCg001s = MapUtils.toDaoEPBase(inInfo, HGCG001.class); List<HGCG001> fCg001s = MapUtils.toDaoEPBases(inInfo, HGCG001.class);
// db数据 // db数据
Map<String, HGCG001> dbCg001Map = this.lockGetData(fCg001s); Map<String, HGCG001> dbCg001Map = this.lockGetData(fCg001s);
// 数据校验 // 数据校验
...@@ -143,7 +143,7 @@ public class ServiceHGCG001 extends ServiceBase { ...@@ -143,7 +143,7 @@ public class ServiceHGCG001 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "删除") @OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) { public EiInfo remove(EiInfo inInfo) {
try { try {
List<HGCG001> fCg001s = MapUtils.toDaoEPBase(inInfo, HGCG001.class); List<HGCG001> fCg001s = MapUtils.toDaoEPBases(inInfo, HGCG001.class);
// db数据 // db数据
Map<String, HGCG001> dbCg001Map = this.lockGetData(fCg001s); Map<String, HGCG001> dbCg001Map = this.lockGetData(fCg001s);
// 数据校验 // 数据校验
...@@ -196,7 +196,7 @@ public class ServiceHGCG001 extends ServiceBase { ...@@ -196,7 +196,7 @@ public class ServiceHGCG001 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "保存") @OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "保存")
public EiInfo submit(EiInfo inInfo) { public EiInfo submit(EiInfo inInfo) {
try { try {
List<HGCG001> fCg001s = MapUtils.toDaoEPBase(inInfo, HGCG001.class); List<HGCG001> fCg001s = MapUtils.toDaoEPBases(inInfo, HGCG001.class);
// db数据 // db数据
Map<String, HGCG001> dbCg001Map = this.lockGetData(fCg001s); Map<String, HGCG001> dbCg001Map = this.lockGetData(fCg001s);
// 数据校验 // 数据校验
......
...@@ -89,7 +89,7 @@ public class ServiceHGCG001A extends ServiceBase { ...@@ -89,7 +89,7 @@ public class ServiceHGCG001A extends ServiceBase {
@OperationLogAnnotation(operModul = "采购计划明细", operType = "修改", operDesc = "保存") @OperationLogAnnotation(operModul = "采购计划明细", operType = "修改", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGCG001A> fCg001As = MapUtils.toDaoEPBase(inInfo, HGCG001A.class); List<HGCG001A> fCg001As = MapUtils.toDaoEPBases(inInfo, HGCG001A.class);
// db数据 // db数据
Map<Long, HGCG001A> dbCg001Map = this.lockGetData(fCg001As); Map<Long, HGCG001A> dbCg001Map = this.lockGetData(fCg001As);
HGCG001 cg001 = HGCGTools.HgCg001.get(fCg001As.get(0).getPrimaryId()); HGCG001 cg001 = HGCGTools.HgCg001.get(fCg001As.get(0).getPrimaryId());
...@@ -158,7 +158,7 @@ public class ServiceHGCG001A extends ServiceBase { ...@@ -158,7 +158,7 @@ public class ServiceHGCG001A extends ServiceBase {
@OperationLogAnnotation(operModul = "采购计划明细", operType = "修改", operDesc = "删除") @OperationLogAnnotation(operModul = "采购计划明细", operType = "修改", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) { public EiInfo remove(EiInfo inInfo) {
try { try {
List<HGCG001A> fCg001s = MapUtils.toDaoEPBase(inInfo, HGCG001A.class); List<HGCG001A> fCg001s = MapUtils.toDaoEPBases(inInfo, HGCG001A.class);
// db数据 // db数据
Map<Long, HGCG001A> dbCg001Map = this.lockGetData(fCg001s); Map<Long, HGCG001A> dbCg001Map = this.lockGetData(fCg001s);
HGCG001 cg001 = HGCGTools.HgCg001.get(fCg001s.get(0).getPrimaryId()); HGCG001 cg001 = HGCGTools.HgCg001.get(fCg001s.get(0).getPrimaryId());
......
...@@ -88,7 +88,7 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -88,7 +88,7 @@ public class ServiceHGCG002 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "保存") @OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class); List<HGCG002> fCg002s = MapUtils.toDaoEPBases(inInfo, HGCG002.class);
// db数据 // db数据
Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetDataEp(fCg002s); Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetDataEp(fCg002s);
// 数据校验 // 数据校验
...@@ -141,7 +141,7 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -141,7 +141,7 @@ public class ServiceHGCG002 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "删除") @OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) { public EiInfo remove(EiInfo inInfo) {
try { try {
List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class); List<HGCG002> fCg002s = MapUtils.toDaoEPBases(inInfo, HGCG002.class);
// db数据 // db数据
Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetDataEp(fCg002s); Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetDataEp(fCg002s);
// 数据校验 // 数据校验
...@@ -212,7 +212,7 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -212,7 +212,7 @@ public class ServiceHGCG002 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "保存") @OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "保存")
public EiInfo submit(EiInfo inInfo) { public EiInfo submit(EiInfo inInfo) {
try { try {
List<HGCG002> fCg002s = MapUtils.toDaoEPBase(inInfo, HGCG002.class); List<HGCG002> fCg002s = MapUtils.toDaoEPBases(inInfo, HGCG002.class);
// db数据 // db数据
Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetDataEp(fCg002s); Map<String, HGCG002A> dbCg002AMap = HGCGUtils.HgCg002.lockGetDataEp(fCg002s);
// 数据校验 // 数据校验
......
...@@ -92,7 +92,7 @@ public class ServiceHGCG002A extends ServiceBase { ...@@ -92,7 +92,7 @@ public class ServiceHGCG002A extends ServiceBase {
public EiInfo confirm(EiInfo inInfo) { public EiInfo confirm(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGCG001A> fCg001As = MapUtils.toDaoEPBase(inInfo, HGCG001A.class); List<HGCG001A> fCg001As = MapUtils.toDaoEPBases(inInfo, HGCG001A.class);
// db数据 // db数据
Map<Long, HGCG001A> dbCg001Map = this.lockGetData(fCg001As); Map<Long, HGCG001A> dbCg001Map = this.lockGetData(fCg001As);
......
...@@ -78,7 +78,7 @@ public class ServiceHGCG002B extends ServiceBase { ...@@ -78,7 +78,7 @@ public class ServiceHGCG002B extends ServiceBase {
@OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "保存") @OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGCG002B> fCg002Bs = MapUtils.toDaoEPBase(inInfo, HGCG002B.class); List<HGCG002B> fCg002Bs = MapUtils.toDaoEPBases(inInfo, HGCG002B.class);
// db数据 // db数据
Map<Long, HGCG002B> dbCg002AMap = HGCGUtils.HgCg002B.lockGetDataEp(fCg002Bs); Map<Long, HGCG002B> dbCg002AMap = HGCGUtils.HgCg002B.lockGetDataEp(fCg002Bs);
HGCG002 cg001 = HGCGTools.HgCg002.get(fCg002Bs.get(0).getPrimaryId()); HGCG002 cg001 = HGCGTools.HgCg002.get(fCg002Bs.get(0).getPrimaryId());
...@@ -136,7 +136,7 @@ public class ServiceHGCG002B extends ServiceBase { ...@@ -136,7 +136,7 @@ public class ServiceHGCG002B extends ServiceBase {
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "删除") @OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) { public EiInfo remove(EiInfo inInfo) {
try { try {
List<HGCG002B> fCg002Bs = MapUtils.toDaoEPBase(inInfo, HGCG002B.class); List<HGCG002B> fCg002Bs = MapUtils.toDaoEPBases(inInfo, HGCG002B.class);
// db数据 // db数据
Map<Long, HGCG002B> dbCg002BMap = HGCGUtils.HgCg002B.lockGetDataEp(fCg002Bs); Map<Long, HGCG002B> dbCg002BMap = HGCGUtils.HgCg002B.lockGetDataEp(fCg002Bs);
HGCG002 cg001 = HGCGTools.HgCg002.get(fCg002Bs.get(0).getPrimaryId()); HGCG002 cg001 = HGCGTools.HgCg002.get(fCg002Bs.get(0).getPrimaryId());
......
...@@ -96,7 +96,7 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -96,7 +96,7 @@ public class ServiceHGCG003 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "保存") @OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class); List<HGCG003> fCg003s = MapUtils.toDaoEPBases(inInfo, HGCG003.class);
// 写入数据 // 写入数据
for (int i = 0; i < fCg003s.size(); i++) { for (int i = 0; i < fCg003s.size(); i++) {
HGCG003 hgcg003 = fCg003s.get(i); HGCG003 hgcg003 = fCg003s.get(i);
...@@ -196,7 +196,7 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -196,7 +196,7 @@ public class ServiceHGCG003 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "删除") @OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) { public EiInfo remove(EiInfo inInfo) {
try { try {
List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class); List<HGCG003> fCg003s = MapUtils.toDaoEPBases(inInfo, HGCG003.class);
// 采购收货DB数据 // 采购收货DB数据
Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003s); Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003s);
// 采购合同DB数据 // 采购合同DB数据
...@@ -279,7 +279,7 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -279,7 +279,7 @@ public class ServiceHGCG003 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "确认") @OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) { public EiInfo confirm(EiInfo inInfo) {
try { try {
List<HGCG003> fCg003s = MapUtils.toDaoEPBase(inInfo, HGCG003.class); List<HGCG003> fCg003s = MapUtils.toDaoEPBases(inInfo, HGCG003.class);
// db数据 // db数据
Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003s); Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003s);
// 数据校验 // 数据校验
......
...@@ -84,7 +84,7 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -84,7 +84,7 @@ public class ServiceHGCG003A extends ServiceBase {
@OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "确认") @OperationLogAnnotation(operModul = "采购合同", operType = "修改", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) { public EiInfo confirm(EiInfo inInfo) {
try { try {
List<HGCG002B> fCg002Bs = MapUtils.toDaoEPBase(inInfo, HGCG002B.class); List<HGCG002B> fCg002Bs = MapUtils.toDaoEPBases(inInfo, HGCG002B.class);
// db数据 // db数据
Map<Long, HGCG002B> dbCg002AMap = HGCGUtils.HgCg002B.lockGetDataEp(fCg002Bs); Map<Long, HGCG002B> dbCg002AMap = HGCGUtils.HgCg002B.lockGetDataEp(fCg002Bs);
HGCG002 cg001 = HGCGTools.HgCg002.get(fCg002Bs.get(0).getPrimaryId()); HGCG002 cg001 = HGCGTools.HgCg002.get(fCg002Bs.get(0).getPrimaryId());
......
...@@ -79,7 +79,7 @@ public class ServiceHGCG003B extends ServiceBase { ...@@ -79,7 +79,7 @@ public class ServiceHGCG003B extends ServiceBase {
@OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "保存") @OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGCG003B> fCg003Bs = MapUtils.toDaoEPBase(inInfo, HGCG003B.class); List<HGCG003B> fCg003Bs = MapUtils.toDaoEPBases(inInfo, HGCG003B.class);
HGCG003 cg003 = HGCGTools.HgCg003.get(fCg003Bs.get(0).getPrimaryId()); HGCG003 cg003 = HGCGTools.HgCg003.get(fCg003Bs.get(0).getPrimaryId());
if(cg003.getSource().intValue() == HGConstant.CgSource.DEFAULT){ if(cg003.getSource().intValue() == HGConstant.CgSource.DEFAULT){
// 采购收货DB数据 // 采购收货DB数据
...@@ -215,7 +215,7 @@ public class ServiceHGCG003B extends ServiceBase { ...@@ -215,7 +215,7 @@ public class ServiceHGCG003B extends ServiceBase {
@OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "删除") @OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) { public EiInfo remove(EiInfo inInfo) {
try { try {
List<HGCG003B> fCg003Bs = MapUtils.toDaoEPBase(inInfo, HGCG003B.class); List<HGCG003B> fCg003Bs = MapUtils.toDaoEPBases(inInfo, HGCG003B.class);
// 采购收货DB数据 // 采购收货DB数据
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(fCg003Bs); Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(fCg003Bs);
HGCG003 cg003 = HGCGTools.HgCg003.get(fCg003Bs.get(0).getPrimaryId()); HGCG003 cg003 = HGCGTools.HgCg003.get(fCg003Bs.get(0).getPrimaryId());
......
package com.baosight.hggp.hg.dm.constant;
/**
* @author:songx
* @date:2024/8/13,16:43
*/
public class HgDmConstant {
/**
* 业务类型
*
* @author:songx
* @date:2024/8/13,16:43
*/
public static class BizType {
// 整改通知单-处理照片
public static final String RECTIFY_HANDLE = "RECTIFY_HANDLE";
// 整改通知单-问题照片
public static final String RECTIFY_DEFECT = "RECTIFY_DEFECT";
}
}
package com.baosight.hggp.hg.dm.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:THpdm099.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-08-13 15:40:25 create
*/
public class HGDM099 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
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_DELETE_FLAG = "deleteFlag"; /* 是否删除*/
public static final String FIELD_BIZ_TYPE = "bizType"; /* 业务类型*/
public static final String FIELD_BIZ_ID = "bizId"; /* 业务ID*/
public static final String FIELD_DOC_ID = "docId"; /* 文件ID*/
public static final String FIELD_DOC_NAME = "docName"; /* 文件名称*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
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_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除*/
public static final String COL_BIZ_TYPE = "BIZ_TYPE"; /* 业务类型*/
public static final String COL_BIZ_ID = "BIZ_ID"; /* 业务ID*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件ID*/
public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件名称*/
public static final String QUERY = "HPDM099.query";
public static final String COUNT = "HPDM099.count";
public static final String INSERT = "HPDM099.insert";
public static final String UPDATE = "HPDM099.update";
public static final String DELETE = "HPDM099.delete";
private Long id = new Long(0);
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag; /* 是否删除*/
private String bizType = " "; /* 业务类型*/
private String bizId = " "; /* 业务ID*/
private String docId = " "; /* 文件ID*/
private String docName = " "; /* 文件名称*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BIZ_TYPE);
eiColumn.setDescName("业务类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BIZ_ID);
eiColumn.setDescName("业务ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID);
eiColumn.setDescName("文件ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("文件名称");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGDM099() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the companyCode - 企业编码 预留.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 企业编码 预留.
*
* @param companyCode - 企业编码 预留
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称.
*
* @param updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除.
*
* @param deleteFlag - 是否删除
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the bizType - 业务类型.
* @return the bizType
*/
public String getBizType() {
return this.bizType;
}
/**
* set the bizType - 业务类型.
*
* @param bizType - 业务类型
*/
public void setBizType(String bizType) {
this.bizType = bizType;
}
/**
* get the bizId - 业务ID.
* @return the bizId
*/
public String getBizId() {
return this.bizId;
}
/**
* set the bizId - 业务ID.
*
* @param bizId - 业务ID
*/
public void setBizId(String bizId) {
this.bizId = bizId;
}
/**
* get the docId - 文件ID.
* @return the docId
*/
public String getDocId() {
return this.docId;
}
/**
* set the docId - 文件ID.
*
* @param docId - 文件ID
*/
public void setDocId(String docId) {
this.docId = docId;
}
/**
* get the docName - 文件名称.
* @return the docName
*/
public String getDocName() {
return this.getDocName();
}
/**
* set the docName - 文件名称.
*
* @param docName - 文件名称
*/
public void setDocName(String docName) {
this.docName = docName;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
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));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setBizType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_TYPE)), bizType));
setBizId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_ID)), bizId));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
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_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_BIZ_TYPE, StringUtils.toString(bizType, eiMetadata.getMeta(FIELD_BIZ_TYPE)));
map.put(FIELD_BIZ_ID, StringUtils.toString(bizId, eiMetadata.getMeta(FIELD_BIZ_ID)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
return map;
}
}
package com.baosight.hggp.hg.dm.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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.List;
/**
* 附件清单
*
* @author:songx
* @date:2024/8/13,15:27
*/
public class ServiceHGDM099 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 文件存储位置
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
inInfo = super.query(inInfo, "HGDM099.queryS3", new HGDM099());
} else {
inInfo = super.query(inInfo, "HGDM099.queryLocal", new HGDM099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
public EiInfo upload(EiInfo inInfo) {
try {
HGDM099 fDm099 = MapUtils.toDaoEPBase(inInfo, HGDM099.class);
fDm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGDM099.INSERT, fDm099);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("上传成功");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
public EiInfo delete(EiInfo inInfo) {
try {
List<HGDM099> fDm099s = MapUtils.toDaoEPBases(inInfo, HGDM099.class);
for (HGDM099 fDm099 : fDm099s) {
DaoUtils.update(HGDM099.DELETE, fDm099);
if (!fDm099.getDocId().isEmpty()) {
Iplat4jUtils.deleteFileByDocId(fDm099.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fDm099s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.dm.service;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
* 附件上传
*
* @author:songx
* @date:2024/8/13,15:26
*/
public class ServiceHGDM099A extends ServiceBase {
/**
* 画面初始化.
*/
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGDM099">
<sql id="column">
A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
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", <!-- 业务类型 -->
A.BIZ_ID as "bizId", <!-- 业务ID -->
A.DOC_ID as "docId" <!-- 文件ID -->
</sql>
<sql id="columnLocal">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnS3">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="condition">
AND A.DELETE_FLAG = '0'
<include refid="SqlBase.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
A.BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizId">
A.BIZ_ID = #bizId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
</sql>
<sql id="customCondition">
<include refid="condition"/>
<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="conditionLocal">
AND A.DOC_ID = B.DOC_ID
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<!-- S3地址 -->
<sql id="conditionS3">
AND A.DOC_ID = B.RES_ID
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.ID asc
</isEmpty>
</dynamic>
</sql>
<select id="queryLocal" resultClass="com.baosight.hggp.hg.dm.domain.HGDM099">
SELECT
<include refid="columnLocal"/>
FROM ${hggpSchema}.HGDM099 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionLocal"/>
<include refid="orderBy"/>
</select>
<select id="countLocal" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGDM099 A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionLocal"/>
</select>
<select id="queryS3" resultClass="com.baosight.hpjx.hp.dm.domain.HPDM099">
SELECT
<include refid="columnS3"/>
FROM ${hggpSchema}.HGDM099 A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionS3"/>
<include refid="orderBy"/>
</select>
<select id="countS3" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGDM099 A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionS3"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGDM099 (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除 -->
BIZ_TYPE, <!-- 业务类型 -->
BIZ_ID, <!-- 业务ID -->
DOC_ID, <!-- 文件ID -->
DOC_ID <!-- 文件名称 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGDM099
SET DELETE_FLAG = '1'
WHERE ID = #id#
</delete>
</sqlMap>
package com.baosight.hggp.hg.dm.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.util.AssertUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/8/13,16:40
*/
public class HpDmTools {
/**
* @author:songx
* @date:2024/8/13,16:40
*/
public static class HpDm099 {
/**
* 查询
*
* @param bizType
* @param bizId
* @return
*/
public static List<HGDM099> list(String bizType, String bizId) {
AssertUtils.isEmpty(bizId, "业务ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGDM099.FIELD_BIZ_TYPE, bizType);
paramMap.put(HGDM099.FIELD_BIZ_ID, bizId);
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
return DaoBase.getInstance().query("HGDM099.queryS3", paramMap);
} else {
return DaoBase.getInstance().query("HGDM099.queryLocal", paramMap);
}
}
}
}
...@@ -83,7 +83,7 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -83,7 +83,7 @@ public class ServiceHGKC001 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购入库", operType = "修改", operDesc = "保存") @OperationLogAnnotation(operModul = "采购入库", operType = "修改", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGKC001> fCg004s = MapUtils.toDaoEPBase(inInfo, HGKC001.class); List<HGKC001> fCg004s = MapUtils.toDaoEPBases(inInfo, HGKC001.class);
// 采购收货DB数据 // 采购收货DB数据
Map<String, HGKC001> dbCg004Map = HGKCUtils.HgKc001.lockGetDataEp(fCg004s); Map<String, HGKC001> dbCg004Map = HGKCUtils.HgKc001.lockGetDataEp(fCg004s);
// 数据校验 // 数据校验
...@@ -137,7 +137,7 @@ public class ServiceHGKC001 extends ServiceBase { ...@@ -137,7 +137,7 @@ public class ServiceHGKC001 extends ServiceBase {
@OperationLogAnnotation(operModul = "采购入库", operType = "修改", operDesc = "删除") @OperationLogAnnotation(operModul = "采购入库", operType = "修改", operDesc = "删除")
public EiInfo remove(EiInfo inInfo) { public EiInfo remove(EiInfo inInfo) {
try { try {
List<HGKC001> fKc001s = MapUtils.toDaoEPBase(inInfo, HGKC001.class); List<HGKC001> fKc001s = MapUtils.toDaoEPBases(inInfo, HGKC001.class);
// 采购收货DB数据 // 采购收货DB数据
Map<String, HGKC001> dbCg004Map = HGKCUtils.HgKc001.lockGetDataEp(fKc001s); Map<String, HGKC001> dbCg004Map = HGKCUtils.HgKc001.lockGetDataEp(fKc001s);
// 数据校验 // 数据校验
......
...@@ -86,7 +86,7 @@ public class ServiceHGKC001A extends ServiceBase { ...@@ -86,7 +86,7 @@ public class ServiceHGKC001A extends ServiceBase {
@OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "确认") @OperationLogAnnotation(operModul = "采购收货", operType = "修改", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) { public EiInfo confirm(EiInfo inInfo) {
try { try {
List<HGCG003A> fCg003As = MapUtils.toDaoEPBase(inInfo, HGCG003A.class); List<HGCG003A> fCg003As = MapUtils.toDaoEPBases(inInfo, HGCG003A.class);
// db数据 // db数据
Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003As); Map<String, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003As);
// 数据校验 // 数据校验
......
...@@ -81,7 +81,7 @@ public class ServiceHGKC002 extends ServiceBase { ...@@ -81,7 +81,7 @@ public class ServiceHGKC002 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产领料单", operType = "删除", operDesc = "删除") @OperationLogAnnotation(operModul = "生产领料单", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<HGKC002> fKc002s = MapUtils.toDaoEPBase(inInfo, HGKC002.class); List<HGKC002> fKc002s = MapUtils.toDaoEPBases(inInfo, HGKC002.class);
// 查询数据库记录 // 查询数据库记录
Map<String, HGKC002> dbKc002Map = HGKCUtils.HgKc002.lockGetDataEp(fKc002s); Map<String, HGKC002> dbKc002Map = HGKCUtils.HgKc002.lockGetDataEp(fKc002s);
// 删除检查 // 删除检查
......
...@@ -85,7 +85,7 @@ public class ServiceHGKC002A extends ServiceEPBase { ...@@ -85,7 +85,7 @@ public class ServiceHGKC002A extends ServiceEPBase {
@OperationLogAnnotation(operModul = "库存查询", operType = "插入", operDesc = "生产领料单-库存查询-生成出库单") @OperationLogAnnotation(operModul = "库存查询", operType = "插入", operDesc = "生产领料单-库存查询-生成出库单")
public EiInfo select(EiInfo inInfo) { public EiInfo select(EiInfo inInfo) {
try { try {
List<HGKC010A> hc010s = MapUtils.toDaoEPBase(inInfo, HGKC010A.class); List<HGKC010A> hc010s = MapUtils.toDaoEPBases(inInfo, HGKC010A.class);
// 获取库存信息 // 获取库存信息
Map<Long, HGKC010A> dbKc010Map = HGKCUtils.HgKc010A.lockGetDataEp(hc010s); Map<Long, HGKC010A> dbKc010Map = HGKCUtils.HgKc010A.lockGetDataEp(hc010s);
// 状态校验 // 状态校验
......
...@@ -112,7 +112,7 @@ public class ServiceHGKC003 extends ServiceBase { ...@@ -112,7 +112,7 @@ public class ServiceHGKC003 extends ServiceBase {
@OperationLogAnnotation(operModul = "生产入库单", operType = "删除", operDesc = "删除") @OperationLogAnnotation(operModul = "生产入库单", operType = "删除", operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<HGKC003> fKc003s = MapUtils.toDaoEPBase(inInfo, HGKC003.class); List<HGKC003> fKc003s = MapUtils.toDaoEPBases(inInfo, HGKC003.class);
// 生产入库单ids // 生产入库单ids
List<Long> ids = fKc003s.stream().map(HGKC003::getId).collect(Collectors.toList()); List<Long> ids = fKc003s.stream().map(HGKC003::getId).collect(Collectors.toList());
for(Long id : ids){ for(Long id : ids){
......
...@@ -63,10 +63,10 @@ public class ServiceHGSC005 extends ServiceBase { ...@@ -63,10 +63,10 @@ public class ServiceHGSC005 extends ServiceBase {
List<String> planCodes = ObjectUtils.listKey(resultRows, HGSC005.FIELD_plan_code); List<String> planCodes = ObjectUtils.listKey(resultRows, HGSC005.FIELD_plan_code);
List<HGSC005A> hgsc005AList = HGSCTools.THGSC005A.queryByPlanCodes(planCodes); List<HGSC005A> hgsc005AList = HGSCTools.THGSC005A.queryByPlanCodes(planCodes);
this.checkCommitDate(hgsc005AList); this.checkCommitDate(hgsc005AList);
List<Long> ids = MapUtils.toDaoEPBase(resultRows,HGSC005.class).stream().filter(o -> o.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)==0).map(HGSC005::getId).collect(Collectors.toList()); List<Long> ids = MapUtils.toDaoEPBases(resultRows,HGSC005.class).stream().filter(o -> o.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)==0).map(HGSC005::getId).collect(Collectors.toList());
DaoUtils.update(HGSC005.BATCH_COMMIT, new HashMap<String,Object>(){{put("ids",ids);}}); DaoUtils.update(HGSC005.BATCH_COMMIT, new HashMap<String,Object>(){{put("ids",ids);}});
//生成生产订单 //生成生产订单
HGSCTools.THGSC006.generatorOrder(MapUtils.toDaoEPBase(inInfo,HGSC005.class), hgsc005AList); HGSCTools.THGSC006.generatorOrder(MapUtils.toDaoEPBases(inInfo,HGSC005.class), hgsc005AList);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据提交成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据提交成功!");
......
...@@ -53,7 +53,7 @@ public class ServiceHGSC005A extends ServiceBase { ...@@ -53,7 +53,7 @@ public class ServiceHGSC005A extends ServiceBase {
@OperationLogAnnotation(operModul = "生产计划详情", operType = "保存", operDesc = "保存计划详情") @OperationLogAnnotation(operModul = "生产计划详情", operType = "保存", operDesc = "保存计划详情")
public EiInfo update(EiInfo inInfo){ public EiInfo update(EiInfo inInfo){
try { try {
List<HGSC005A> hgsc005AList = MapUtils.toDaoEPBase(inInfo, HGSC005A.class); List<HGSC005A> hgsc005AList = MapUtils.toDaoEPBases(inInfo, HGSC005A.class);
// 数据校验 // 数据校验
this.checkSaveData(hgsc005AList); this.checkSaveData(hgsc005AList);
// 保存数据 // 保存数据
......
package com.baosight.hggp.hg.wd.constant;
/**
* @author:songx
* @date:2024/8/16,15:51
*/
public class HgWdConstant {
/**
* 文件状态
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class FileStatus {
// 待发布
public static final Integer S_0 = 0;
// 已发布
public static final Integer S_1 = 1;
}
}
package com.baosight.hggp.hg.wd.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hgwd001.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-08-16 15:37:40 create
*/
public class HGWD001 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 记录创建名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 记录创建时间*/
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_DELETE_FLAG = "deleteFlag"; /* 0-未删除,1-已删除*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_FILE_TYPE = "fileType"; /* 文件类型*/
public static final String FIELD_FILE_NAME = "fileName"; /* 文件名称*/
public static final String FIELD_DOC_ID = "docId"; /* 文件号*/
public static final String FIELD_DOC_NAME = "docName"; /* 文件附件名称*/
public static final String FIELD_DOC_VERSION = "docVersion"; /* 文件版本号*/
public static final String FIELD_STATUS = "status"; /* 状态*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 记录创建名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 记录创建时间*/
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_DELETE_FLAG = "DELETE_FLAG"; /* 0-未删除,1-已删除*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_FILE_TYPE = "FILE_TYPE"; /* 文件类型*/
public static final String COL_FILE_NAME = "FILE_NAME"; /* 文件名称*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件号*/
public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件附件名称*/
public static final String COL_DOC_VERSION = "DOC_VERSION"; /* 文件版本号*/
public static final String COL_STATUS = "STATUS"; /* 状态*/
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String QUERY = "HGWD001.query";
public static final String COUNT = "HGWD001.count";
public static final String INSERT = "HGWD001.insert";
public static final String UPDATE = "HGWD001.update";
public static final String DELETE = "HGWD001.delete";
private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
private String createdTime = " "; /* 记录创建时间*/
private String updatedBy = " "; /* 记录修改者*/
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private Integer deleteFlag; /* 0-未删除,1-已删除*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String fileType = " "; /* 文件类型*/
private String fileName = " "; /* 文件名称*/
private String docId = " "; /* 文件号*/
private String docName = " "; /* 文件附件名称*/
private Integer docVersion = new Integer(0); /* 文件版本号*/
private Integer status; /* 状态*/
private String remark = " "; /* 备注*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("记录创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("记录创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("记录修改者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("记录修改名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("记录修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0-未删除,1-已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_NAME);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_TYPE);
eiColumn.setDescName("文件类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_NAME);
eiColumn.setDescName("文件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID);
eiColumn.setDescName("文件号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("文件附件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_VERSION);
eiColumn.setDescName("文件版本号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK);
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGWD001() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the accountCode - 企业编码.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 企业编码.
*
* @param accountCode - 企业编码
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 记录创建者.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 记录创建者.
*
* @param createdBy - 记录创建者
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 记录创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 记录创建名称.
*
* @param createdName - 记录创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 记录创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 记录创建时间.
*
* @param createdTime - 记录创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 记录修改者.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 记录修改者.
*
* @param updatedBy - 记录修改者
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 记录修改名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 记录修改名称.
*
* @param updatedName - 记录修改名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 记录修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 记录修改时间.
*
* @param updatedTime - 记录修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 0-未删除,1-已删除.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0-未删除,1-已删除.
*
* @param deleteFlag - 0-未删除,1-已删除
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the companyCode - 公司编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码.
*
* @param companyCode - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the companyName - 公司名称.
* @return the companyName
*/
public String getCompanyName() {
return this.companyName;
}
/**
* set the companyName - 公司名称.
*
* @param companyName - 公司名称
*/
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* get the projCode - 项目编码.
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码.
*
* @param projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the fileType - 文件类型.
* @return the fileType
*/
public String getFileType() {
return this.fileType;
}
/**
* set the fileType - 文件类型.
*
* @param fileType - 文件类型
*/
public void setFileType(String fileType) {
this.fileType = fileType;
}
/**
* get the fileName - 文件名称.
* @return the fileName
*/
public String getFileName() {
return this.fileName;
}
/**
* set the fileName - 文件名称.
*
* @param fileName - 文件名称
*/
public void setFileName(String fileName) {
this.fileName = fileName;
}
/**
* get the docId - 文件号.
* @return the docId
*/
public String getDocId() {
return this.docId;
}
/**
* set the docId - 文件号.
*
* @param docId - 文件号
*/
public void setDocId(String docId) {
this.docId = docId;
}
/**
* get the docName - 文件附件名称.
* @return the docName
*/
public String getDocName() {
return this.docName;
}
/**
* set the docName - 文件附件名称.
*
* @param docName - 文件附件名称
*/
public void setDocName(String docName) {
this.docName = docName;
}
/**
* get the docVersion - 文件版本号.
* @return the docVersion
*/
public Integer getDocVersion() {
return this.docVersion;
}
/**
* set the docVersion - 文件版本号.
*
* @param docVersion - 文件版本号
*/
public void setDocVersion(Integer docVersion) {
this.docVersion = docVersion;
}
/**
* get the status - 状态.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态.
*
* @param status - 状态
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the remark - 备注.
* @return the remark
*/
public String getRemark() {
return this.remark;
}
/**
* set the remark - 备注.
*
* @param remark - 备注
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
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));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setFileType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_TYPE)), fileType));
setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_NAME)), fileName));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
setDocVersion(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOC_VERSION)), docVersion));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
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_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_FILE_TYPE, StringUtils.toString(fileType, eiMetadata.getMeta(FIELD_FILE_TYPE)));
map.put(FIELD_FILE_NAME, StringUtils.toString(fileName, eiMetadata.getMeta(FIELD_FILE_NAME)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
map.put(FIELD_DOC_VERSION, StringUtils.toString(docVersion, eiMetadata.getMeta(FIELD_DOC_VERSION)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
return map;
}
}
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGWD002 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "文档浏览", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD001().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "文档浏览", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
inInfo = super.query(inInfo, HGWD001.QUERY, new HGWD001());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGWD001">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
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", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
FILE_TYPE as "fileType", <!-- 文件类型 -->
FILE_NAME as "fileName", <!-- 文件名称 -->
DOC_ID as "docId", <!-- 文件号 -->
DOC_NAME as "docName", <!-- 文件附件名称 -->
DOC_VERSION as "docVersion", <!-- 文件版本号 -->
STATUS as "status", <!-- 状态 -->
REMARK as "remark" <!-- 备注 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileType">
FILE_TYPE = #fileType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileName">
FILE_NAME LIKE CONCAT('%', #fileName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME = #docName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docVersion">
DOC_VERSION = #docVersion#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remark">
REMARK = #remark#
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.wd.domain.HGWD001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGWD001
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGWD001
WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGWD001 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
FILE_TYPE, <!-- 文件类型 -->
FILE_NAME, <!-- 文件名称 -->
DOC_ID, <!-- 文件号 -->
DOC_NAME, <!-- 文件附件名称 -->
DOC_VERSION, <!-- 文件版本号 -->
STATUS, <!-- 状态 -->
REMARK <!-- 备注 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #fileType#, #fileName#,
#docId#, #docName#, #docVersion#, #status#, #remark#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGWD001
SET DELETE_FLAG = '1'
WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD001
SET
FILE_TYPE = #fileType#, <!-- 文件类型 -->
FILE_NAME = #fileName#, <!-- 文件名称 -->
DOC_ID = #docId#, <!-- 文件号 -->
DOC_NAME = #docName#, <!-- 文件附件名称 -->
DOC_VERSION = #docVersion#, <!-- 文件版本号 -->
STATUS = #status#, <!-- 状态 -->
REMARK = #remark#, <!-- 备注 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
...@@ -162,7 +162,7 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -162,7 +162,7 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "入库质检单",operType = "删除",operDesc = "删除") @OperationLogAnnotation(operModul = "入库质检单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<HGZL001> fZl001s = MapUtils.toDaoEPBase(inInfo, HGZL001.class); List<HGZL001> fZl001s = MapUtils.toDaoEPBases(inInfo, HGZL001.class);
Map<String, HGZL001> dbZl001Map = HGZLUtils.HgZl001.lockGetDataEp(fZl001s); Map<String, HGZL001> dbZl001Map = HGZLUtils.HgZl001.lockGetDataEp(fZl001s);
for (HGZL001 fZl001 : fZl001s) { for (HGZL001 fZl001 : fZl001s) {
String checkNo = fZl001.getCheckNo(); String checkNo = fZl001.getCheckNo();
...@@ -192,7 +192,7 @@ public class ServiceHGZL001 extends ServiceBase { ...@@ -192,7 +192,7 @@ public class ServiceHGZL001 extends ServiceBase {
@OperationLogAnnotation(operModul = "入库质检单",operType = "修改",operDesc = "已处理") @OperationLogAnnotation(operModul = "入库质检单",operType = "修改",operDesc = "已处理")
public EiInfo doProcess(EiInfo inInfo) { public EiInfo doProcess(EiInfo inInfo) {
try { try {
List<HGZL001> fZl001s = MapUtils.toDaoEPBase(inInfo, HGZL001.class); List<HGZL001> fZl001s = MapUtils.toDaoEPBases(inInfo, HGZL001.class);
Map<String, HGZL001> dbZl001Map = HGZLUtils.HgZl001.lockGetDataEp(fZl001s); Map<String, HGZL001> dbZl001Map = HGZLUtils.HgZl001.lockGetDataEp(fZl001s);
// 数据校验 // 数据校验
this.checkProcessData(fZl001s, dbZl001Map); this.checkProcessData(fZl001s, dbZl001Map);
......
...@@ -84,7 +84,7 @@ public class ServiceHGZL001B extends ServiceEPBase { ...@@ -84,7 +84,7 @@ public class ServiceHGZL001B extends ServiceEPBase {
@OperationLogAnnotation(operModul = "采购收货单查询", operType = "新增", operDesc = "质量巡检单-采购收货单查询-生成巡检单") @OperationLogAnnotation(operModul = "采购收货单查询", operType = "新增", operDesc = "质量巡检单-采购收货单查询-生成巡检单")
public EiInfo confirm(EiInfo inInfo) { public EiInfo confirm(EiInfo inInfo) {
try { try {
List<HGCG003B> fCg003Bs = MapUtils.toDaoEPBase(inInfo, HGCG003B.class); List<HGCG003B> fCg003Bs = MapUtils.toDaoEPBases(inInfo, HGCG003B.class);
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(fCg003Bs); Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(fCg003Bs);
// Map<Long, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003Bs); // Map<Long, HGCG003> dbCg003Map = HGCGUtils.HgCg003.lockGetDataEp(fCg003Bs);
......
...@@ -83,7 +83,7 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -83,7 +83,7 @@ public class ServiceHGZL002 extends ServiceBase {
@OperationLogAnnotation(operModul = "工序质检单", operType = "保存", operDesc = "保存") @OperationLogAnnotation(operModul = "工序质检单", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGZL002> hgzl002List = MapUtils.toDaoEPBase(inInfo,HGZL002.class); List<HGZL002> hgzl002List = MapUtils.toDaoEPBases(inInfo,HGZL002.class);
List<Long> ids = Optional.ofNullable(hgzl002List).orElse(new ArrayList<>()).stream().map(HGZL002::getId).collect(Collectors.toList()); List<Long> ids = Optional.ofNullable(hgzl002List).orElse(new ArrayList<>()).stream().map(HGZL002::getId).collect(Collectors.toList());
List<HGZL002> dbList = HGZLTools.THGZL002.list(ids); List<HGZL002> dbList = HGZLTools.THGZL002.list(ids);
Optional.ofNullable(dbList).orElse(new ArrayList<>()).stream().forEach( o -> { Optional.ofNullable(dbList).orElse(new ArrayList<>()).stream().forEach( o -> {
...@@ -112,7 +112,7 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -112,7 +112,7 @@ public class ServiceHGZL002 extends ServiceBase {
resultMap.put("unpassQuantity",0); resultMap.put("unpassQuantity",0);
try { try {
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002()); inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
List<HGZL002> hgzl002s = MapUtils.toDaoEPBase(inInfo,HGZL002.class); List<HGZL002> hgzl002s = MapUtils.toDaoEPBases(inInfo,HGZL002.class);
int quantity = Optional.ofNullable(hgzl002s).orElse(new ArrayList<>()).stream().mapToInt(HGZL002::getQuantity).sum(); int quantity = Optional.ofNullable(hgzl002s).orElse(new ArrayList<>()).stream().mapToInt(HGZL002::getQuantity).sum();
int passQuantity = Optional.ofNullable(hgzl002s).orElse(new ArrayList<>()).stream().mapToInt(HGZL002::getPassQuantity).sum(); int passQuantity = Optional.ofNullable(hgzl002s).orElse(new ArrayList<>()).stream().mapToInt(HGZL002::getPassQuantity).sum();
int unpassQuantity = Optional.ofNullable(hgzl002s).orElse(new ArrayList<>()).stream().mapToInt(HGZL002::getUnpassQuantity).sum(); int unpassQuantity = Optional.ofNullable(hgzl002s).orElse(new ArrayList<>()).stream().mapToInt(HGZL002::getUnpassQuantity).sum();
......
...@@ -68,7 +68,7 @@ public class ServiceHGZL003 extends ServiceBase { ...@@ -68,7 +68,7 @@ public class ServiceHGZL003 extends ServiceBase {
@OperationLogAnnotation(operModul = "日常巡检单", operType = "保存", operDesc = "保存") @OperationLogAnnotation(operModul = "日常巡检单", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGZL003> hgzl003List = MapUtils.toDaoEPBase(inInfo,HGZL003.class); List<HGZL003> hgzl003List = MapUtils.toDaoEPBases(inInfo,HGZL003.class);
hgzl003List.forEach( o -> { hgzl003List.forEach( o -> {
HGZLTools.THGZL003.add(o); HGZLTools.THGZL003.add(o);
}); });
......
...@@ -64,7 +64,7 @@ public class ServiceHGZL004 extends ServiceBase { ...@@ -64,7 +64,7 @@ public class ServiceHGZL004 extends ServiceBase {
@OperationLogAnnotation(operModul = "整改通知单", operType = "保存", operDesc = "保存") @OperationLogAnnotation(operModul = "整改通知单", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) { public EiInfo save(EiInfo inInfo) {
try { try {
List<HGZL004> hgzl004List = MapUtils.toDaoEPBase(inInfo,HGZL004.class); List<HGZL004> hgzl004List = MapUtils.toDaoEPBases(inInfo,HGZL004.class);
hgzl004List.forEach( o -> { hgzl004List.forEach( o -> {
HGZL004 db004 = HGZLTools.THGZL004.get(o.getId()); HGZL004 db004 = HGZLTools.THGZL004.get(o.getId());
HGZLTools.THGZL004.lock(o.getId()); HGZLTools.THGZL004.lock(o.getId());
......
...@@ -164,7 +164,7 @@ public class MapUtils extends org.apache.commons.collections.MapUtils { ...@@ -164,7 +164,7 @@ public class MapUtils extends org.apache.commons.collections.MapUtils {
* @param clazz * @param clazz
* @param <T> * @param <T>
*/ */
public static <T extends DaoEPBase> List<T> toDaoEPBase(EiInfo inInfo, Class<T> clazz) { public static <T extends DaoEPBase> T toDaoEPBase(EiInfo inInfo, Class<T> clazz) {
return toDaoEPBase(inInfo, EiConstant.resultBlock, clazz); return toDaoEPBase(inInfo, EiConstant.resultBlock, clazz);
} }
...@@ -176,9 +176,54 @@ public class MapUtils extends org.apache.commons.collections.MapUtils { ...@@ -176,9 +176,54 @@ public class MapUtils extends org.apache.commons.collections.MapUtils {
* @param clazz * @param clazz
* @param <T> * @param <T>
*/ */
public static <T extends DaoEPBase> List<T> toDaoEPBase(EiInfo inInfo, String blockId, Class<T> clazz) { public static <T extends DaoEPBase> T toDaoEPBase(EiInfo inInfo, String blockId, Class<T> clazz) {
Map rowMap = inInfo.getBlock(blockId).getRow(0);
return toDaoEPBase(rowMap, clazz);
}
/**
* map 转 DaoEPBase
*
* @param rowMap
* @param clazz
* @param <T>
*/
public static <T extends DaoEPBase> T toDaoEPBase(Map rowMap, Class<T> clazz) {
if (MapUtils.isEmpty(rowMap) || clazz == null) {
return null;
}
T newBean = null;
try {
newBean = clazz.newInstance();
newBean.fromMap(rowMap);
} catch (Exception e) {
log.error("class new instance fail:{}", e.getMessage(), e);
}
return newBean;
}
/**
* map 转 DaoEPBase
*
* @param inInfo
* @param clazz
* @param <T>
*/
public static <T extends DaoEPBase> List<T> toDaoEPBases(EiInfo inInfo, Class<T> clazz) {
return toDaoEPBases(inInfo, EiConstant.resultBlock, clazz);
}
/**
* map 转 DaoEPBase
*
* @param inInfo
* @param blockId
* @param clazz
* @param <T>
*/
public static <T extends DaoEPBase> List<T> toDaoEPBases(EiInfo inInfo, String blockId, Class<T> clazz) {
List<Map> rows = inInfo.getBlock(blockId).getRows(); List<Map> rows = inInfo.getBlock(blockId).getRows();
return toDaoEPBase(rows, clazz); return toDaoEPBases(rows, clazz);
} }
/** /**
...@@ -188,7 +233,7 @@ public class MapUtils extends org.apache.commons.collections.MapUtils { ...@@ -188,7 +233,7 @@ public class MapUtils extends org.apache.commons.collections.MapUtils {
* @param clazz * @param clazz
* @param <T> * @param <T>
*/ */
public static <T extends DaoEPBase> List<T> toDaoEPBase(List<Map> maps, Class<T> clazz) { public static <T extends DaoEPBase> List<T> toDaoEPBases(List<Map> maps, Class<T> clazz) {
if (CollectionUtils.isEmpty(maps) || clazz == null) { if (CollectionUtils.isEmpty(maps) || clazz == null) {
return null; return null;
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<!-- 基础查询条件 --> <!-- 基础查询条件 -->
<sqlMap resource="com/baosight/hggp/core/dao/BaseCondition.xml"/> <sqlMap resource="com/baosight/hggp/core/dao/BaseCondition.xml"/>
<sqlMap resource="com/baosight/hggp/core/dao/SqlBase.xml"/>
<!-- 数据权限 --> <!-- 数据权限 -->
<sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml"/> <sqlMap resource="com/baosight/hggp/hg/xs/sql/HGXSDataAuth.xml"/>
...@@ -88,4 +89,7 @@ ...@@ -88,4 +89,7 @@
<sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX002.xml"/> <sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX002A.xml"/> <sqlMap resource="com/baosight/hggp/hg/yx/sql/HGYX002A.xml"/>
<!-- 文档库 -->
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD001.xml"/>
</sqlMapConfig> </sqlMapConfig>
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
return template;
}
}],
loadComplete: function (grid) {
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#BTN_DELETE").on("click", deleteFunc);
},
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGDM099A",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(e) {
let res = e.response;
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-bizId", $("#inqu_status-0-bizId").val());
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
inEiInfo.set("result-0-docId", res.docId);
inEiInfo.set("result-0-docName", res.docName);
EiCommunicator.send('HGDM099', 'upload', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGDM099", "delete", true);
}
})
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="业务ID" ename="bizId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFUpload = {
uploadFile: {
success: function (e) {
let docId = e.response.docId;
if (isBlank(docId)) {
return;
}
NotificationUtil("附件上传成功");
try {
parent.JSColorbox.setValueCallback(e);
} catch (e) {
}
},
}
};
});
<!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="result" title="请选择文件">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="fj_file" path="biz"/>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [{
field: "operator",
title: "操作",
template: function (model) {
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showQueryRecord(' + model.id + ')" >查询记录</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showExportRecord(' + model.id + ')" >导出记录</a>';
return template;
}
}],
loadComplete: function (grid) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择收货
$("#SELECT_RECEIVE").on("click", selectReceive);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
// 按键事件
downKeyUp();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示查询记录
*/
let showQueryRecord = function (id) {
}
/**
* 显示导出记录
*/
let showExportRecord = function (id) {
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
if (isBlank(rows[i]['whCode'])) {
message("勾选的第" + (i + 1) + "行仓库不能为空");
return;
}
if (rows[i]["submitStatus"] == 1) {
message("第" + (i + 1) + "行数据已提交,不能保存");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC001", "save", true);
}
});
}
/**
* 删除
*/
let remove = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC001", "remove", true);
}
});
}
/**
* 选择
*/
let selectReceive = function () {
JSColorbox.open({
href: "HGKC001A?methodName=initLoad",
title: "<div style='text-align: center;'>收货查询</div>",
width: "80%",
height: "80%",
callbackName: selectReceiveCallback
});
}
/**
* 选择回调
*/
let selectReceiveCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 提交
* @param id
* @param status
*/
function updateSubmitStatus(id) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
JSUtils.confirm("确定提交此采购入库单吗? ", {
ok: function () {
EiCommunicator.send('HGKC001', 'updateSubmitStatus', inEiInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
}
);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="文档浏览">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="公司名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="文件类型" ename="fileType" blockId="inqu_status" row="0" colWidth="3" optionLabel="全部"
defultValue="">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" width="120" enable="false" align="center"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="left"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="140" align="left"/>
<EF:EFComboColumn ename="fileType" cname="文件类型" enable="false" width="90" align="center">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="fileName" cname="文件名" enable="false" width="100" align="left"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="docId" cname="文件号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="docName" cname="文件附件名称" enable="false" width="100" align="left"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment