first commit
This commit is contained in:
parent
059e03623a
commit
8fb7de056e
|
|
@ -1,26 +1,27 @@
|
|||
# ---> Java
|
||||
# Compiled class file
|
||||
*.class
|
||||
/ecology-develop.iml
|
||||
/E9-bmj.iml
|
||||
/out/
|
||||
/.idea/
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
HELP.md
|
||||
target/
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
HELP.md
|
||||
target/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
/src/test
|
||||
/src/rebel.xml
|
||||
/src/META-INF
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
/log
|
||||
|
||||
/src/test
|
||||
/src/rebel.xml
|
||||
/src/META-INF
|
||||
|
||||
/log
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -0,0 +1,12 @@
|
|||
package com.api.secret.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/secret/authority/change")
|
||||
public class AuthorityChangeController extends com.engine.secret.web.AuthorityChangeController{
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.api.secret.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/secret/auto/number")
|
||||
public class AutoGenerateNumberController extends com.engine.secret.web.AutoGenerateNumberController{
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.api.secret.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
|
||||
@Path("/secret/demand")
|
||||
public class QualificationApplicationController extends com.engine.secret.web.QualificationApplicationController {
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.secret.entity.autonumber;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AcceptanceNumber {
|
||||
private Integer id;
|
||||
private Integer year;
|
||||
private Integer month;
|
||||
private Integer monthlySerial;
|
||||
private Integer globalSerial;
|
||||
private Integer secretType;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.secret.entity.unpack;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/03/26
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ApplicationResource {
|
||||
private String id;
|
||||
private String aid;
|
||||
private String fid;
|
||||
private String rid;
|
||||
private String createdTime;
|
||||
private String isDelete;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.engine.secret.entity.unpack;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/30
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class CheckFields {
|
||||
private String name;
|
||||
private String fields;
|
||||
private String formFields;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.secret.entity.unpack;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/03/26
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class DataConfig {
|
||||
private String id;
|
||||
private String mainTableName;
|
||||
private String relatedField;
|
||||
private String detailTableName;
|
||||
private String rootPath;
|
||||
List<DataConfig> childDataConfig;
|
||||
List<DataConfigDetail> detailList;
|
||||
List<FileConfig> fileList;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.engine.secret.entity.unpack;
|
||||
|
||||
import com.engine.secret.util.ModeUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/03/26
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class DataConfigDetail {
|
||||
private String fieldName;
|
||||
private String path;
|
||||
private String condition;
|
||||
private String convertSql;
|
||||
|
||||
public String getConvertSql() {
|
||||
if (StringUtils.isBlank(convertSql)) {
|
||||
return "";
|
||||
}
|
||||
return ModeUtil.ToDBC(convertSql);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.engine.secret.entity.unpack;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/03/26
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FileConfig {
|
||||
private String fieldName;
|
||||
private String fileId;
|
||||
private String isFilled;
|
||||
private String fixedValue;
|
||||
private String attachments;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.engine.secret.entity.unpack;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/03/26
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ResourceInfo {
|
||||
private String id;
|
||||
private String fileName;
|
||||
private String filePath;
|
||||
private String fileSuffix;
|
||||
private String virtualPath;
|
||||
private String createdTime;
|
||||
private String updatedTime;
|
||||
private String isDelete;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.secret.entity.unpack;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/30
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class UnpackParam {
|
||||
private String docId;
|
||||
private String requestId;
|
||||
private boolean isCorrection;
|
||||
private List<CheckFields> checkFields;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.engine.secret.enums;
|
||||
|
||||
/**
|
||||
* 申请类别
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/07
|
||||
* @version: 1.0
|
||||
*/
|
||||
public enum ApplicationCategory {
|
||||
// 涉密信息系统集成资质、国家秘密载体印制资质、武器装备科研生产单位保密资质、涉密军事设施建设保密资质
|
||||
CLASSIFIED_INFO_SYSTEM_INTEGRATION_QUALIFICATION("涉密信息系统集成资质", 0),
|
||||
NATIONAL_SECRET_CARRIER_PRINTING_QUALIFICATION("国家秘密载体印制资质", 1),
|
||||
WEAPON_EQUIPMENT_RESEARCH_SECURITY_QUALIFICATION("武器装备科研生产单位保密资质", 2),
|
||||
CLASSIFIED_MILITARY_FACILITY_CONSTRUCTION_QUALIFICATION("涉密军事设施建设保密资质", 3);
|
||||
|
||||
ApplicationCategory(String name, Integer value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private String name;
|
||||
private Integer value;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.engine.secret.enums;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/07
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface CategoryValue {
|
||||
/**
|
||||
* 获取值
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int getSelectValue();
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.engine.secret.enums;
|
||||
|
||||
/**
|
||||
* 集成资质
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/07
|
||||
* @version: 1.0
|
||||
*/
|
||||
public enum IntegrateCategory implements CategoryValue {
|
||||
// 总体集成、系统咨询、软件开发、安防监控、屏蔽室建设、运行维护、数据恢复、工程监理
|
||||
SYSTEM_INTEGRATION("总体集成", 0),
|
||||
SYSTEM_CONSULTING("系统咨询", 1),
|
||||
SOFTWARE_DEVELOPMENT("软件开发", 2),
|
||||
SECURITY_SURVEILLANCE("安防监控", 3),
|
||||
SHIELDED_ROOM_CONSTRUCTION("屏蔽室建设", 4),
|
||||
OPERATION_MAINTENANCE("运行维护", 5),
|
||||
DATA_RECOVERY("数据恢复", 6),
|
||||
PROJECT_SUPERVISION("工程监理", 7);
|
||||
|
||||
IntegrateCategory(String name, Integer value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private String name;
|
||||
private Integer value;
|
||||
|
||||
public static IntegrateCategory getValue(String name) {
|
||||
for (IntegrateCategory item : IntegrateCategory.values()) {
|
||||
if (item.name.equalsIgnoreCase(name)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
//throw new RuntimeException("不支持的操作类型");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getSelectValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.engine.secret.enums;
|
||||
|
||||
/**
|
||||
* 印制资质
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/07
|
||||
* @version: 1.0
|
||||
*/
|
||||
public enum PrintCategory implements CategoryValue {
|
||||
// 涉密文件资料、国家统一考试试卷、涉密防伪票据证书、涉密光电磁介质、涉密档案数字化加工
|
||||
CLASSIFIED_DOCUMENTS("涉密文件资料", 0),
|
||||
NATIONAL_EXAM_PAPERS("国家统一考试试卷", 1),
|
||||
CLASSIFIED_VOUCHERS("涉密防伪票据证书", 2),
|
||||
SECURE_ELECTRONIC_STORAGE("涉密光电磁介质", 3),
|
||||
CLASSIFIED_DIGITIZATION("涉密档案数字化加工", 4);
|
||||
|
||||
PrintCategory(String name, Integer value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private String name;
|
||||
private Integer value;
|
||||
|
||||
public static PrintCategory getValue(String name) {
|
||||
for (PrintCategory item : PrintCategory.values()) {
|
||||
if (item.name.equalsIgnoreCase(name)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
//throw new RuntimeException("不支持的操作类型");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getSelectValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.engine.secret.exception;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2023/2/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class CustomizeRunTimeException extends RuntimeException{
|
||||
|
||||
public CustomizeRunTimeException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public CustomizeRunTimeException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public CustomizeRunTimeException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,234 @@
|
|||
package com.engine.secret.instance;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.engine.secret.entity.autonumber.AcceptanceNumber;
|
||||
import com.engine.secret.exception.CustomizeRunTimeException;
|
||||
import com.engine.secret.util.ModeUtil;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSetTrans;
|
||||
import weaver.formmode.IgnoreCaseHashMap;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class AutoGenerateNumberInstance {
|
||||
private static final String TABLE_NAME = "uf_sldh";
|
||||
private static final String RECORD_TABLE_NAME = "uf_sldh_dt1";
|
||||
|
||||
private static final AutoGenerateNumberInstance INSTANCE = new AutoGenerateNumberInstance();
|
||||
|
||||
private AutoGenerateNumberInstance() {
|
||||
// 私有化构造方法
|
||||
}
|
||||
|
||||
public static AutoGenerateNumberInstance getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 集成、印制受理编号
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public synchronized String getAcceptanceNumber(User user, Map<String, Object> param) {
|
||||
RecordSetTrans rs = new RecordSetTrans();
|
||||
rs.setAutoCommit(false);
|
||||
try {
|
||||
Integer secretType = Convert.toInt(param.get("secretType"));
|
||||
String requestId = Util.null2String(param.get("requestId"));
|
||||
|
||||
LocalDate now = LocalDate.now();
|
||||
int year = now.getYear();
|
||||
int currentMonth = now.getMonthValue();
|
||||
|
||||
|
||||
AcceptanceNumber yearNumber;
|
||||
rs.executeQuery("select * from uf_sldh where secret_type= ? and year = ? and month = 0 FOR UPDATE", secretType, year);
|
||||
if (rs.next()) {
|
||||
yearNumber = getSelectNum(rs);
|
||||
} else {
|
||||
yearNumber = buildNewNum(year, 0, secretType);
|
||||
}
|
||||
yearNumber.setGlobalSerial(yearNumber.getGlobalSerial() + 1);
|
||||
// 更新年度流水号
|
||||
saveNum(rs, yearNumber);
|
||||
|
||||
AcceptanceNumber monthNumber;
|
||||
rs.executeQuery("select * from uf_sldh where secret_type= ? and year = ? and month = ? FOR UPDATE", secretType, year, currentMonth);
|
||||
if (rs.next()) {
|
||||
monthNumber = getSelectNum(rs);
|
||||
} else {
|
||||
monthNumber = buildNewNum(year, currentMonth, secretType);
|
||||
}
|
||||
monthNumber.setMonthlySerial(monthNumber.getMonthlySerial() + 1);
|
||||
// 更新月度、流水号
|
||||
saveNum(rs, monthNumber);
|
||||
|
||||
// 生成编号
|
||||
String formattedYear = String.format("%04d", year);
|
||||
String formattedMonth = String.format("%02d", monthNumber.getMonth());
|
||||
String formattedMonthlySerial = String.format("%02d", monthNumber.getMonthlySerial());
|
||||
String formattedGlobalSerial = String.format("%03d", yearNumber.getGlobalSerial());
|
||||
|
||||
String num = formattedYear + formattedMonth + formattedMonthlySerial + formattedGlobalSerial;
|
||||
rs.writeLog("requestId===" + requestId + ",secretType===" + secretType + ",num===" + num);
|
||||
insertGenerateRecord(rs, requestId, num, user.getUID());
|
||||
// 插入编号生成记录
|
||||
rs.commit();
|
||||
return num;
|
||||
} catch (Exception e) {
|
||||
rs.rollback();
|
||||
rs.writeLog(e);
|
||||
throw new CustomizeRunTimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 军工受理单号
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public synchronized String getWarIndustryAcceptanceNumber(User user, Map<String, Object> param) {
|
||||
RecordSetTrans rs = new RecordSetTrans();
|
||||
rs.setAutoCommit(false);
|
||||
try {
|
||||
Integer secretType = Convert.toInt(param.get("secretType"));
|
||||
String requestId = Util.null2String(param.get("requestId"));
|
||||
|
||||
LocalDate now = LocalDate.now();
|
||||
int year = now.getYear();
|
||||
|
||||
|
||||
AcceptanceNumber yearNumber;
|
||||
rs.executeQuery("select * from uf_sldh where secret_type= ? and year = ? and month = 0 FOR UPDATE", secretType, year);
|
||||
if (rs.next()) {
|
||||
yearNumber = getSelectNum(rs);
|
||||
} else {
|
||||
yearNumber = buildNewNum(year, 0, secretType);
|
||||
}
|
||||
yearNumber.setGlobalSerial(yearNumber.getGlobalSerial() + 1);
|
||||
// 更新年度流水号
|
||||
saveNum(rs, yearNumber);
|
||||
|
||||
// 生成编号
|
||||
String formattedYear = String.format("%04d", year);
|
||||
String formattedGlobalSerial = String.format("%03d", yearNumber.getGlobalSerial());
|
||||
|
||||
String num = "JS" + formattedYear + formattedGlobalSerial;
|
||||
rs.writeLog("requestId===" + requestId + ",secretType===" + secretType + ",num===" + num);
|
||||
insertGenerateRecord(rs, requestId, num, user.getUID());
|
||||
rs.commit();
|
||||
return num;
|
||||
} catch (Exception e) {
|
||||
rs.rollback();
|
||||
rs.writeLog(e);
|
||||
throw new CustomizeRunTimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建查询对象
|
||||
*
|
||||
* @param rs
|
||||
* @return
|
||||
*/
|
||||
private AcceptanceNumber getSelectNum(RecordSetTrans rs) {
|
||||
return AcceptanceNumber.builder()
|
||||
.id(rs.getInt("id"))
|
||||
.year(rs.getInt("year"))
|
||||
.month(rs.getInt("month"))
|
||||
.monthlySerial(rs.getInt("monthly_serial"))
|
||||
.globalSerial(rs.getInt("global_serial"))
|
||||
.secretType(rs.getInt("secret_type"))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建新对象
|
||||
*
|
||||
* @param year
|
||||
* @param currentMonth
|
||||
* @param secretType
|
||||
* @return
|
||||
*/
|
||||
private AcceptanceNumber buildNewNum(Integer year, Integer currentMonth, Integer secretType) {
|
||||
return AcceptanceNumber.builder()
|
||||
.year(year)
|
||||
.month(currentMonth)
|
||||
.monthlySerial(0)
|
||||
.globalSerial(0)
|
||||
.secretType(secretType)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存编号数据
|
||||
*
|
||||
* @param rs
|
||||
* @param number
|
||||
* @throws Exception
|
||||
*/
|
||||
private void saveNum(RecordSetTrans rs, AcceptanceNumber number) throws Exception {
|
||||
if (null == number.getId()) {
|
||||
Map<String, Object> insertMap = buildSaveMap(number);
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
insertMap.put("modeuuid", uuid);
|
||||
int formModeId = ModeUtil.getModeIdByTableName(TABLE_NAME);
|
||||
insertMap.put("formmodeid", formModeId);
|
||||
ModeUtil.buildModeInsertFields(insertMap, 1);
|
||||
ModeUtil.insertData(rs, insertMap, TABLE_NAME);
|
||||
ModeUtil.refreshRight(uuid, TABLE_NAME, formModeId, 1);
|
||||
} else {
|
||||
Map<String, Object> updateMap = buildSaveMap(number);
|
||||
ModeUtil.buildModeUpdateFields(updateMap, 1);
|
||||
ModeUtil.updateDataById(rs, updateMap, TABLE_NAME);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建数据库映射关系
|
||||
*
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
private IgnoreCaseHashMap<String, Object> buildSaveMap(AcceptanceNumber number) {
|
||||
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
|
||||
if (null != number.getId()) {
|
||||
dataMap.put("id", number.getId());
|
||||
}
|
||||
dataMap.put("year", number.getYear());
|
||||
dataMap.put("month", number.getMonth());
|
||||
dataMap.put("monthly_serial", number.getMonthlySerial());
|
||||
dataMap.put("global_serial", number.getGlobalSerial());
|
||||
dataMap.put("secret_type", number.getSecretType());
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入编号生成记录
|
||||
*
|
||||
* @param requestId
|
||||
* @param num
|
||||
* @param userId
|
||||
*/
|
||||
private void insertGenerateRecord(RecordSetTrans rs, String requestId, String num, int userId) throws Exception {
|
||||
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
|
||||
dataMap.put("request_id", requestId);
|
||||
dataMap.put("num", num);
|
||||
dataMap.put("operate_user", userId);
|
||||
dataMap.put("operate_time", DateUtil.getFullDate());
|
||||
ModeUtil.insertData(rs, dataMap, RECORD_TABLE_NAME);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.engine.secret.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface AuthorityChangeService {
|
||||
|
||||
/**
|
||||
* 将审批事权移交至省级
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> delegateToProvincialAuthority(Map<String, Object> param);
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.engine.secret.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface AutoGenerateNumberService {
|
||||
/**
|
||||
* 获取受理单号
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
String getAcceptanceNumber(Map<String, Object> param) ;
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.secret.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/08/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface QualificationApplicationService {
|
||||
|
||||
/**
|
||||
* 解析文件
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> parsingFiles(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 删除已经解析的数据
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> deleteParsedData(Map<String, Object> params);
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.engine.secret.service;
|
||||
|
||||
import com.engine.secret.entity.unpack.UnpackParam;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import net.lingala.zip4j.ZipFile;
|
||||
import net.lingala.zip4j.model.FileHeader;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/03/26
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface UnpackZipService {
|
||||
|
||||
/**
|
||||
* 材料收件
|
||||
*
|
||||
* @param unpackParam
|
||||
* @param rootNode
|
||||
* @param imageFileMap
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
Map<String, Object> registerAcceptance(ZipFile zipFile, UnpackParam unpackParam, JsonNode rootNode, Map<String, FileHeader> imageFileMap) throws Exception;
|
||||
|
||||
/**
|
||||
* 材料补正
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> reviewResubmittedMaterials(ZipFile zipFile, String requestId, JsonNode rootNode, Map<String, FileHeader> imageFileMap);
|
||||
|
||||
/**
|
||||
* 删除文件解析数据
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> deleteParsedData(Map<String, Object> param);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.engine.secret.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.secret.exception.CustomizeRunTimeException;
|
||||
import com.engine.secret.service.AuthorityChangeService;
|
||||
import com.engine.secret.util.FlowUtil;
|
||||
import com.engine.secret.util.ModeUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class AuthorityChangeServiceImpl extends Service implements AuthorityChangeService {
|
||||
@Override
|
||||
public Map<String, Object> delegateToProvincialAuthority(Map<String, Object> param) {
|
||||
RecordSet rs = new RecordSet();
|
||||
String ids = Util.null2String(param.get("ids"));
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
throw new CustomizeRunTimeException("请至少选择一条数据");
|
||||
}
|
||||
String customId = Util.null2String(param.get("customId"));
|
||||
if (StringUtils.isBlank(customId)) {
|
||||
throw new CustomizeRunTimeException("未获取到查询列表ID");
|
||||
}
|
||||
String modeTableName = ModeUtil.getTableNameByCustomId(customId);
|
||||
rs.writeLog("ids==" + ids);
|
||||
rs.writeLog("customId==" + customId);
|
||||
rs.writeLog("modeTableName==" + modeTableName);
|
||||
String options = user.getLastname() + "-自动提交流程-";
|
||||
|
||||
// 查询对应的流程,并更新
|
||||
String[] split = ids.split(",");
|
||||
for (String s : split) {
|
||||
rs.writeLog("id==" + s);
|
||||
// 更新事权类别为省级事权
|
||||
rs.executeUpdate("update " + modeTableName + " set bmzzzgsqlb = ?,tjdqjd = ? where id =? ", 0, 1, s);
|
||||
// 查询对应的requestId
|
||||
rs.executeQuery("select requestId from " + modeTableName + " where id = ?", s);
|
||||
if (rs.next()) {
|
||||
String requestId = rs.getString("requestId");
|
||||
rs.writeLog("requestId==" + requestId);
|
||||
List<Integer> currentUserIds = FlowUtil.getCurrentUserIds(requestId);
|
||||
if (CollectionUtils.isEmpty(currentUserIds)) {
|
||||
throw new CustomizeRunTimeException("requestId[" + requestId + "],流程提交失败,未获取到当前节点处理人");
|
||||
}
|
||||
|
||||
String submitResult = FlowUtil.submitWorkflowRequest(requestId, currentUserIds.get(0), options + DateUtil.getFullDate());
|
||||
if (!"success".equals(submitResult)) {
|
||||
throw new CustomizeRunTimeException("requestId[" + requestId + "],流程提交失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return new HashMap<>();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.engine.secret.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.secret.exception.CustomizeRunTimeException;
|
||||
import com.engine.secret.instance.AutoGenerateNumberInstance;
|
||||
import com.engine.secret.service.AutoGenerateNumberService;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class AutoGenerateNumberServiceImpl extends Service implements AutoGenerateNumberService {
|
||||
|
||||
@Override
|
||||
public String getAcceptanceNumber(Map<String, Object> param) {
|
||||
Integer secretType = Convert.toInt(param.get("secretType"));
|
||||
Integer requestId = Convert.toInt(param.get("requestId"));
|
||||
if (null == secretType) {
|
||||
throw new CustomizeRunTimeException("未获取到[保密资质(资格)类型],请检查表单数据");
|
||||
}
|
||||
// 查询当前请求是否已经生成单号,如已生成过,直接取原来单号,不重新生成
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select num from uf_sldh_dt1 where request_id = ? ", requestId);
|
||||
if (rs.next()) {
|
||||
return rs.getString("num");
|
||||
}
|
||||
|
||||
AutoGenerateNumberInstance instance = AutoGenerateNumberInstance.getInstance();
|
||||
if (0 == secretType || 1 == secretType) {
|
||||
// 集成、印制
|
||||
return instance.getAcceptanceNumber(user, param);
|
||||
} else {
|
||||
// 军工
|
||||
return instance.getWarIndustryAcceptanceNumber(user, param);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,239 @@
|
|||
package com.engine.secret.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.secret.entity.unpack.CheckFields;
|
||||
import com.engine.secret.entity.unpack.UnpackParam;
|
||||
import com.engine.secret.exception.CustomizeRunTimeException;
|
||||
import com.engine.secret.service.QualificationApplicationService;
|
||||
import com.engine.secret.util.ConfigUtil;
|
||||
import com.engine.secret.util.ModeUtil;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.wbi.util.Util;
|
||||
import net.lingala.zip4j.ZipFile;
|
||||
import net.lingala.zip4j.model.FileHeader;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.docs.docs.DocImageManager;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.GCONST;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/08/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class QualificationApplicationServiceImpl extends Service implements QualificationApplicationService {
|
||||
|
||||
|
||||
public static final String CONFIG_TABLE_NAME = "uf_config_package";
|
||||
public static final String CONFIG_DETAIL_TABLE_NAME = "uf_config_package_dt1";
|
||||
public static final String FILE_DETAIL_TABLE_NAME = "uf_config_package_dt2";
|
||||
|
||||
BaseBean baseBean = new BaseBean();
|
||||
|
||||
Map<String, FileHeader> fileHeaderMap;
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> parsingFiles(Map<String, Object> param) {
|
||||
try {
|
||||
Map<String, Object> returnMap;
|
||||
|
||||
String docId = Util.null2String(param.get("docId"));
|
||||
String requestId = Util.null2String(param.get("requestId"));
|
||||
String isCorrection = Util.null2String(param.get("isCorrection"));
|
||||
String checkFields = Util.null2String(param.get("checkFields"));
|
||||
if (StringUtils.isBlank(docId)) {
|
||||
throw new CustomizeRunTimeException("文件获取失败,请确认文件是否上传");
|
||||
}
|
||||
baseBean.writeLog("docId==" + docId);
|
||||
|
||||
if (StringUtils.isBlank(requestId)) {
|
||||
throw new CustomizeRunTimeException("流程关联失败,未获取到流程ID,请保存后重试");
|
||||
}
|
||||
|
||||
baseBean.writeLog("requestId==" + requestId);
|
||||
List<CheckFields> checkFieldsList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(checkFields)) {
|
||||
checkFieldsList = JSON.parseObject(checkFields, new TypeReference<List<CheckFields>>() {});
|
||||
}
|
||||
|
||||
UnpackParam unpackParam = UnpackParam.builder()
|
||||
.docId(docId)
|
||||
.requestId(requestId)
|
||||
.isCorrection(Boolean.parseBoolean(isCorrection))
|
||||
.checkFields(checkFieldsList)
|
||||
.build();
|
||||
|
||||
|
||||
// docId 转为换imageFileId
|
||||
DocImageManager imgManger = new DocImageManager();
|
||||
imgManger.setDocid(Integer.parseInt(docId));
|
||||
imgManger.selectDocImageInfo();
|
||||
imgManger.next();
|
||||
String imageFileId = imgManger.getImagefileid();
|
||||
baseBean.writeLog("imageFileId==" + imageFileId);
|
||||
if (StringUtils.isBlank(imageFileId) || "-1".equals(imageFileId)) {
|
||||
throw new CustomizeRunTimeException("文件获取失败,请确认文件是否上传,imageFileId=[" + imageFileId + "]");
|
||||
}
|
||||
|
||||
|
||||
// 初始化配置
|
||||
String unzipPwd = ConfigUtil.getConfig("UNZIP_PWD");
|
||||
baseBean.writeLog("unzipPwd==" + unzipPwd);
|
||||
|
||||
|
||||
// 根据文件id获取文件流
|
||||
ImageFileManager manager = new ImageFileManager();
|
||||
manager.getImageFileInfoById(Integer.parseInt(imageFileId));
|
||||
manager.getImageFileName();
|
||||
InputStream inputStream = manager.getInputStream();
|
||||
|
||||
Path fixedDir = Paths.get(GCONST.getRootPath() + "filesystem" + File.separatorChar + "downloadBatchTemp");
|
||||
Files.createDirectories(fixedDir);
|
||||
Path tempZipFile = Files.createTempFile(fixedDir, "offline_temp_", ".zip");
|
||||
baseBean.writeLog("tempZipFile==" + tempZipFile.toString());
|
||||
Files.copy(inputStream, tempZipFile, StandardCopyOption.REPLACE_EXISTING);
|
||||
|
||||
//解压文件,处理压缩包
|
||||
baseBean.writeLog("开始解压文件,处理压缩包");
|
||||
returnMap = unzipWithPassword(tempZipFile, Paths.get("output"), unzipPwd, unpackParam);
|
||||
baseBean.writeLog("压缩包处理完成");
|
||||
return returnMap;
|
||||
} catch (Exception e) {
|
||||
baseBean.writeLog(e);
|
||||
throw new CustomizeRunTimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> deleteParsedData(Map<String, Object> param) {
|
||||
return ServiceUtil.getService(OfflineZipUnpackServiceImpl.class, user).deleteParsedData(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解压ZIP文件
|
||||
*
|
||||
* @param zipFilePath
|
||||
* @param outputDir
|
||||
* @param password
|
||||
*/
|
||||
private Map<String, Object> unzipWithPassword(Path zipFilePath, Path outputDir, String password, UnpackParam unpackParam) {
|
||||
try {
|
||||
ZipFile zipFile = new ZipFile(zipFilePath.toFile());
|
||||
if (zipFile.isEncrypted()) {
|
||||
zipFile.setPassword(password.toCharArray());
|
||||
}
|
||||
// 遍历并解压所有文件
|
||||
zipFile.extractAll(outputDir.toString());
|
||||
baseBean.writeLog("已解压所有文件");
|
||||
|
||||
// 遍历 ZIP 内文件(可选)
|
||||
List<FileHeader> fileHeaders = zipFile.getFileHeaders();
|
||||
|
||||
//imageFileMap = new HashMap<>();
|
||||
fileHeaderMap = new HashMap<>();
|
||||
for (FileHeader header : fileHeaders) {
|
||||
if (header.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
String fullPath = header.getFileName();
|
||||
int lastSlashIndex = fullPath.lastIndexOf('/');
|
||||
String fileName = (lastSlashIndex != -1)
|
||||
? fullPath.substring(lastSlashIndex + 1)
|
||||
: fullPath;
|
||||
fileHeaderMap.put(fileName, header);
|
||||
}
|
||||
|
||||
|
||||
baseBean.writeLog("fileHeaders.size==" + fileHeaders.size());
|
||||
baseBean.writeLog("fileHeaderMap.size==" + fileHeaderMap.size());
|
||||
baseBean.writeLog("fileHeaderMap==" + JSON.toJSONString(fileHeaderMap));
|
||||
|
||||
|
||||
// 获取数据文件,用于后续数据解析
|
||||
String jsonFileName = "(database)data.json";
|
||||
if (unpackParam.isCorrection()) {
|
||||
jsonFileName = "(extra)data.json";
|
||||
}
|
||||
FileHeader fileHeader = fileHeaderMap.get(jsonFileName);
|
||||
int dataJsonImageId = generateImageFileId(zipFile, fileHeader, jsonFileName);
|
||||
|
||||
if (dataJsonImageId > 0) {
|
||||
// 离线端方式
|
||||
JsonNode rootNode = parseJsonContent(dataJsonImageId);
|
||||
OfflineZipUnpackServiceImpl offlineZipUnpackService = ServiceUtil.getService(OfflineZipUnpackServiceImpl.class, user);
|
||||
if (unpackParam.isCorrection()) {
|
||||
return offlineZipUnpackService.reviewResubmittedMaterials(zipFile, unpackParam.getRequestId(), rootNode, fileHeaderMap);
|
||||
}
|
||||
return offlineZipUnpackService.registerAcceptance(zipFile, unpackParam, rootNode, fileHeaderMap);
|
||||
}
|
||||
|
||||
// TODO 兼容其他方式
|
||||
|
||||
return new HashMap<>();
|
||||
|
||||
} catch (Exception e) {
|
||||
if (e.getMessage().contains("Wrong password")) {
|
||||
throw new CustomizeRunTimeException("数据包解压失败,密码错误");
|
||||
} else {
|
||||
baseBean.writeLog(e);
|
||||
throw new CustomizeRunTimeException(e.getMessage(), e);
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
Files.deleteIfExists(zipFilePath);
|
||||
} catch (IOException e) {
|
||||
baseBean.writeLog(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取JSON文件内容
|
||||
*
|
||||
* @param imageFieldId
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
private static JsonNode parseJsonContent(Integer imageFieldId) throws IOException {
|
||||
ImageFileManager manager = new ImageFileManager();
|
||||
manager.getImageFileInfoById(imageFieldId);
|
||||
InputStream inputStream = manager.getInputStream();
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
return mapper.readTree(inputStream);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件 返回imageFileId
|
||||
*
|
||||
* @param zipFile
|
||||
* @param header
|
||||
* @return
|
||||
*/
|
||||
private int generateImageFileId(ZipFile zipFile, FileHeader header, String fileName) {
|
||||
try (InputStream is = zipFile.getInputStream(header)) {
|
||||
return ModeUtil.generateImageFileId(is, fileName);
|
||||
} catch (Exception e) {
|
||||
throw new CustomizeRunTimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.secret.util;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/03/31
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class ConfigUtil {
|
||||
public static String getConfig(String name) {
|
||||
if (StringUtils.isBlank(name)) {
|
||||
return "";
|
||||
}
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select value from uf_config where name = ?",name.trim());
|
||||
if(rs.next()){
|
||||
return rs.getString("value").trim();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.engine.secret.util;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2023/2/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ExceptionUtil {
|
||||
public static String getRealMessage(Throwable e) {
|
||||
while (e != null) {
|
||||
Throwable cause = e.getCause();
|
||||
if (cause == null) {
|
||||
return e.getMessage();
|
||||
}
|
||||
e = cause;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
package com.engine.secret.util;
|
||||
|
||||
import com.weaver.formmodel.data.model.Formfield;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.validator.GenericValidator;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.definedfield.HrmFieldManager;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/02
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class FieldConvertUtil {
|
||||
|
||||
/**
|
||||
* 转换存入数据库的值
|
||||
*
|
||||
* @param formfield
|
||||
* @param value
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Object getReallyValue(Formfield formfield, String value) throws Exception {
|
||||
if (StringUtils.isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
RecordSet rs = new RecordSet();
|
||||
Object object = null;
|
||||
String type = Util.null2String(formfield.getType());
|
||||
switch (formfield.getFieldhtmltype()) {
|
||||
case "1":
|
||||
// INPUT
|
||||
if ("2".equals(type)) {
|
||||
object = new BigDecimal(value).intValue();
|
||||
} else if ("3".equals(type)) {
|
||||
object = new BigDecimal(value).floatValue();
|
||||
} else if ("1".equals(type)) {
|
||||
object = value;
|
||||
} else {
|
||||
try {
|
||||
object = new BigDecimal(value).toPlainString();
|
||||
} catch (NumberFormatException ignore) {
|
||||
object = value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "3":
|
||||
// BROWSER
|
||||
org.json.JSONObject jsonObject = new org.json.JSONObject();
|
||||
jsonObject.put("fieldhtmltype", formfield.getFieldhtmltype());
|
||||
jsonObject.put("type", type);
|
||||
jsonObject.put("fieldvalue", value);
|
||||
if ("161".equals(type) || "162".equals(type)) {
|
||||
jsonObject.put("dmlurl", formfield.getFielddbtype());
|
||||
} else {
|
||||
jsonObject.put("dmlurl", type);
|
||||
}
|
||||
|
||||
jsonObject.put("fieldid", 0);
|
||||
object = HrmFieldManager.getReallyFieldvalue(jsonObject);
|
||||
// 如果是日期,校验日期的合法性
|
||||
if ("2".equals(type)) {
|
||||
boolean isDate = GenericValidator.isDate(Util.null2String(object), "yyyy-MM-dd", true);
|
||||
if (!isDate) {
|
||||
rs.writeLog("日期格式校验失败,object==" + Util.null2String(object));
|
||||
object = "";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "5":
|
||||
// 区分单选、复选、下拉框
|
||||
switch (type) {
|
||||
case "1":
|
||||
case "3":
|
||||
// 下拉框、单选框
|
||||
object = ModeUtil.getSelectValue(formfield, value);
|
||||
if (StringUtils.isBlank(Util.null2String(object))) {
|
||||
if (isNumberOrCommaSeparatedNumbers(value)) {
|
||||
object = value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
List<String> selectValues = new ArrayList<>();
|
||||
// 兼容分隔符
|
||||
String separator = ",";
|
||||
if (value.contains("、")) {
|
||||
separator = "、";
|
||||
}
|
||||
String[] split = value.split(separator);
|
||||
for (String s : split) {
|
||||
selectValues.add(ModeUtil.getSelectValue(formfield, s));
|
||||
}
|
||||
object = StringUtils.join(selectValues, ",");
|
||||
if (StringUtils.isBlank(Util.null2String(object))) {
|
||||
if (isNumberOrCommaSeparatedNumbers(value)) {
|
||||
object = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case "4":
|
||||
// CHECKBOX
|
||||
case "6":
|
||||
// FILEUPLOAD
|
||||
break;
|
||||
case "7":
|
||||
// TEXT
|
||||
case "2":
|
||||
// TEXTAREA
|
||||
default:
|
||||
object = value;
|
||||
break;
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 执行转换SQL
|
||||
*
|
||||
* @param convertSql
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static String executeConvertSql(String convertSql, String value) {
|
||||
RecordSet rs = new RecordSet();
|
||||
value = Util.null2String(value);
|
||||
long count = convertSql.chars().filter(c -> c == '?').count();
|
||||
List<String> paramsList = new ArrayList<>();
|
||||
for (int i = 0; i < count; i++) {
|
||||
paramsList.add(value);
|
||||
}
|
||||
rs.executeQuery(convertSql, paramsList);
|
||||
if (rs.next()) {
|
||||
return rs.getString(1);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验字符串是否为纯数字或逗号分隔的数字
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static boolean isNumberOrCommaSeparatedNumbers(String str) {
|
||||
// 正则表达式匹配纯数字或逗号分隔的数字
|
||||
// 允许前后有空格,数字之间用逗号分隔
|
||||
String regex = "^\\s*\\d+(\\s*,\\s*\\d+)*\\s*$";
|
||||
return str.matches(regex);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.engine.secret.util;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.workflow.webservices.WorkflowRequestInfo;
|
||||
import weaver.workflow.webservices.WorkflowServiceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class FlowUtil {
|
||||
|
||||
/**
|
||||
* 根据流程请求ID,获取对应流程的表名
|
||||
*
|
||||
* @param requestId
|
||||
* @return
|
||||
*/
|
||||
public static String getTableNameByRequestId(String requestId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select a.tablename from workflow_bill a join workflow_base b on a.id = b.formid where b.id = ( select workflowid from workflow_requestbase where requestid = ?)", requestId);
|
||||
if (rs.next()) {
|
||||
return rs.getString("tablename");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取流程的当前处理人
|
||||
*
|
||||
* @param requestId
|
||||
* @return
|
||||
*/
|
||||
public static List<Integer> getCurrentUserIds(String requestId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
String sql = "select * from workflow_currentoperator where isremark = '0' and usertype = 0 and requestid=? order by id asc";
|
||||
List<Integer> currentUserIds = new ArrayList();
|
||||
rs.executeQuery(sql, requestId);
|
||||
while (rs.next()) {
|
||||
currentUserIds.add(Util.getIntValue(Util.null2String(rs.getString("userid"))));
|
||||
}
|
||||
return currentUserIds;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 提交流程到下一节点
|
||||
*
|
||||
* @param requestId
|
||||
* @param creator
|
||||
* @param opinions
|
||||
* @return
|
||||
*/
|
||||
public static String submitWorkflowRequest(String requestId, int creator, String opinions) {
|
||||
BaseBean bean = new BaseBean();
|
||||
WorkflowServiceImpl workflowService = new WorkflowServiceImpl();
|
||||
WorkflowRequestInfo wri = workflowService.getWorkflowRequest(Util.getIntValue(requestId, 0), creator, 0);
|
||||
bean.writeLog("wri==" + JSON.toJSONString(wri));
|
||||
return workflowService.submitWorkflowRequest(wri, Util.getIntValue(requestId, 0), creator, "submit", opinions);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交流程到下一节点(机器人节点)
|
||||
*
|
||||
* @param requestId
|
||||
* @param opinions
|
||||
* @return
|
||||
*/
|
||||
public static String submitWorkflowRequest(String requestId, String opinions) {
|
||||
WorkflowServiceImpl workflowService = new WorkflowServiceImpl();
|
||||
return workflowService.submitWorkflowRequest(null, Util.getIntValue(requestId, 0), 0, "submit", opinions);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,480 @@
|
|||
package com.engine.secret.util;
|
||||
|
||||
import com.engine.secret.exception.CustomizeRunTimeException;
|
||||
import com.weaver.formmodel.data.manager.FormInfoManager;
|
||||
import com.weaver.formmodel.data.model.Formfield;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.conn.RecordSetTrans;
|
||||
import weaver.docs.docs.*;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.formmode.IgnoreCaseHashMap;
|
||||
import weaver.formmode.setup.ModeRightInfo;
|
||||
import weaver.general.TimeUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/03/26
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class ModeUtil {
|
||||
|
||||
/**
|
||||
* 生成附件ID
|
||||
*
|
||||
* @param inputStream
|
||||
* @param filename
|
||||
* @return
|
||||
*/
|
||||
public static int generateImageFileId(InputStream inputStream, String filename) {
|
||||
int imageFileId;
|
||||
try {
|
||||
byte[] bytes = IOUtils.toByteArray(inputStream);
|
||||
ImageFileManager ifm = new ImageFileManager();
|
||||
ifm.setData(bytes);
|
||||
ifm.setImagFileName(filename);
|
||||
imageFileId = ifm.saveImageFile();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return imageFileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 附件imageFieldId生成docId
|
||||
*
|
||||
* @param secCategory
|
||||
* @param imageFieldId
|
||||
* @param user
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static int createDocId(int secCategory, int imageFieldId, User user) throws Exception {
|
||||
ImageFileManager manager = new ImageFileManager();
|
||||
manager.getImageFileInfoById(imageFieldId);
|
||||
String filenameqc = manager.getImageFileName();
|
||||
String filenamebc = filenameqc.substring(0, filenameqc.lastIndexOf("."));
|
||||
RecordSet rs = new RecordSet();
|
||||
DocManager dm = new DocManager();
|
||||
DocImageManager imgManger = new DocImageManager();
|
||||
|
||||
imgManger.setDocfiletype("2");
|
||||
|
||||
int docId = dm.getNextDocId(rs);
|
||||
imgManger.setDocid(docId);
|
||||
imgManger.setImagefileid(imageFieldId);
|
||||
imgManger.setImagefilename(filenameqc);
|
||||
imgManger.setIsextfile("1");
|
||||
imgManger.AddDocImageInfo();
|
||||
|
||||
String date = TimeUtil.getCurrentDateString();
|
||||
String time = TimeUtil.getOnlyCurrentTimeString();
|
||||
dm.setId(docId);
|
||||
dm.setMaincategory(0);
|
||||
dm.setSubcategory(0);
|
||||
dm.setSeccategory(secCategory);
|
||||
dm.setLanguageid(user.getLanguage());
|
||||
|
||||
dm.setDocstatus("1");
|
||||
dm.setDocsubject(filenamebc);
|
||||
dm.setDoccreaterid(user.getUID());
|
||||
dm.setDocCreaterType(user.getLogintype());
|
||||
dm.setUsertype(user.getLogintype());
|
||||
dm.setOwnerid(user.getUID());
|
||||
dm.setOwnerType(user.getLogintype());
|
||||
dm.setDoclastmoduserid(user.getUID());
|
||||
dm.setDocLastModUserType(user.getLogintype());
|
||||
dm.setDoccreatedate(date);
|
||||
dm.setDoclastmoddate(date);
|
||||
dm.setDoccreatetime(time);
|
||||
dm.setDoclastmodtime(time);
|
||||
dm.setDoclangurage(user.getLanguage());
|
||||
dm.setKeyword(filenameqc);
|
||||
dm.setIsapprover("0");
|
||||
dm.setIsreply("");
|
||||
dm.setDocdepartmentid(user.getUserDepartment());
|
||||
dm.setDocreplyable("1");
|
||||
dm.setAccessorycount(1);
|
||||
dm.setParentids("" + docId);
|
||||
dm.setUserid(user.getUID());
|
||||
DocCoder docCoder = new DocCoder();
|
||||
dm.setDocCode(docCoder.getDocCoder("" + secCategory));
|
||||
dm.setDocEditionId(dm.getNextEditionId(rs));
|
||||
dm.setDocEdition(1);
|
||||
dm.AddDocInfo();
|
||||
dm.AddShareInfo();
|
||||
DocViewer DocViewer = new DocViewer();
|
||||
DocViewer.setDocShareByDoc("" + docId);
|
||||
DocComInfo dc = new DocComInfo();
|
||||
dc.addDocInfoCache("" + docId);
|
||||
return docId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个记录映射
|
||||
*
|
||||
* @param rs RecordSet
|
||||
* @return
|
||||
*/
|
||||
public static IgnoreCaseHashMap<String, Object> getSingleRecordMap(RecordSet rs) {
|
||||
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
|
||||
if (rs.next()) {
|
||||
String[] columnNames = rs.getColumnName();
|
||||
for (String columnName : columnNames) {
|
||||
dataMap.put(columnName, parseBlankToNull(rs.getString(columnName)));
|
||||
}
|
||||
}
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
public static List<Map<String, Object>> getRecordMapList(RecordSet rs) {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
String[] columnNames = rs.getColumnName();
|
||||
Map<String, Object> dataMap = new IgnoreCaseHashMap<>();
|
||||
for (String columnName : columnNames) {
|
||||
dataMap.put(columnName.toLowerCase(), parseBlankToNull(rs.getString(columnName)));
|
||||
}
|
||||
list.add(dataMap);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入数据
|
||||
*
|
||||
* @param dataMap 数据集合
|
||||
* @param tableName 表名
|
||||
*/
|
||||
public static void insertData(Map<String, Object> dataMap, String tableName) {
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
List<String> dataList = new ArrayList<>();
|
||||
List<String> paramList = new ArrayList<>();
|
||||
|
||||
dataMap.forEach((key, value) -> {
|
||||
if (null != value) {
|
||||
String valueStr = String.valueOf(value);
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
fieldList.add(key);
|
||||
dataList.add(valueStr);
|
||||
paramList.add("?");
|
||||
}
|
||||
}
|
||||
});
|
||||
String insertSql = " insert into " + tableName + "(" + StringUtils.join(fieldList, ",") + ") values (" + StringUtils.join(paramList, ",") + ")";
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate(insertSql, dataList);
|
||||
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
|
||||
throw new CustomizeRunTimeException(rs.getExceptionMsg());
|
||||
}
|
||||
}
|
||||
|
||||
public static void insertData(RecordSetTrans rs,Map<String, Object> dataMap, String tableName) throws Exception {
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
List<String> dataList = new ArrayList<>();
|
||||
List<String> paramList = new ArrayList<>();
|
||||
|
||||
dataMap.forEach((key, value) -> {
|
||||
if (null != value) {
|
||||
String valueStr = String.valueOf(value);
|
||||
if (StringUtils.isNotBlank(valueStr)) {
|
||||
fieldList.add(key);
|
||||
dataList.add(valueStr);
|
||||
paramList.add("?");
|
||||
}
|
||||
}
|
||||
});
|
||||
String insertSql = " insert into " + tableName + "(" + StringUtils.join(fieldList, ",") + ") values (" + StringUtils.join(paramList, ",") + ")";
|
||||
rs.executeUpdate(insertSql, dataList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID更新数据
|
||||
*
|
||||
* @param dataMap
|
||||
* @param tableName
|
||||
*/
|
||||
public static void updateDataById(Map<String, Object> dataMap, String tableName) {
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
List<Object> dataList = new ArrayList<>();
|
||||
String id = Util.null2String(dataMap.get("id"));
|
||||
dataMap.remove("id");
|
||||
|
||||
dataMap.forEach((key, value) -> {
|
||||
fieldList.add(key + " = ? ");
|
||||
dataList.add(value);
|
||||
});
|
||||
dataList.add(id);
|
||||
String updateSql = "update " + tableName + " set " + StringUtils.join(fieldList, ",") + " where id = ? ";
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate(updateSql, dataList);
|
||||
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
|
||||
throw new CustomizeRunTimeException(rs.getExceptionMsg());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID更新数据
|
||||
*
|
||||
* @param dataMap
|
||||
* @param tableName
|
||||
*/
|
||||
public static void updateDataById(RecordSetTrans rs,Map<String, Object> dataMap, String tableName) throws Exception {
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
List<Object> dataList = new ArrayList<>();
|
||||
String id = Util.null2String(dataMap.get("id"));
|
||||
dataMap.remove("id");
|
||||
|
||||
dataMap.forEach((key, value) -> {
|
||||
fieldList.add(key + " = ? ");
|
||||
dataList.add(value);
|
||||
});
|
||||
dataList.add(id);
|
||||
String updateSql = "update " + tableName + " set " + StringUtils.join(fieldList, ",") + " where id = ? ";
|
||||
rs.executeUpdate(updateSql, dataList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新数据
|
||||
*
|
||||
* @param dataMap
|
||||
* @param tableName
|
||||
* @param whereSql
|
||||
*/
|
||||
public static void updateData(Map<String, Object> dataMap, String tableName, String whereSql) {
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
List<Object> dataList = new ArrayList<>();
|
||||
dataMap.forEach((key, value) -> {
|
||||
fieldList.add(key + " = ? ");
|
||||
dataList.add(value);
|
||||
});
|
||||
String updateSql = "update " + tableName + " set " + StringUtils.join(fieldList, ",") + whereSql;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate(updateSql, dataList);
|
||||
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
|
||||
throw new CustomizeRunTimeException(rs.getExceptionMsg());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param deleteSql
|
||||
*/
|
||||
public static void deleteData(String deleteSql) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate(deleteSql);
|
||||
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
|
||||
throw new CustomizeRunTimeException(rs.getExceptionMsg());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建建模表基本数据
|
||||
*
|
||||
* @param mainDataMap 参数集合
|
||||
*/
|
||||
public static void buildModeInsertFields(Map<String, Object> mainDataMap, int userId) {
|
||||
String dateTime = DateUtil.getFullDate();
|
||||
String[] dateSplit = dateTime.split(" ");
|
||||
mainDataMap.put("modedatacreater", userId);
|
||||
mainDataMap.put("modedatacreatedate", dateSplit[0]);
|
||||
mainDataMap.put("modedatacreatetime", dateSplit[1]);
|
||||
mainDataMap.put("modedatacreatertype", "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建建模表基本数据
|
||||
*
|
||||
* @param mainDataMap 参数集合
|
||||
*/
|
||||
public static void buildModeUpdateFields(Map<String, Object> mainDataMap, int userId) {
|
||||
String dateTime = DateUtil.getFullDate();
|
||||
mainDataMap.put("modedatamodifier", userId);
|
||||
mainDataMap.put("modedatamodifydatetime", dateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 建模表数据权限重构
|
||||
*
|
||||
* @param uuid
|
||||
* @param modeTable
|
||||
* @param formModeId
|
||||
*/
|
||||
public static int refreshRight(String uuid, String modeTable, int formModeId, int creator) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from " + modeTable + " where modeuuid='" + uuid + "'");
|
||||
if (rs.next()) {
|
||||
//建模数据的id
|
||||
int bid = Util.getIntValue(rs.getString("id"));
|
||||
ModeRightInfo modeRightInfo = new ModeRightInfo();
|
||||
modeRightInfo.setNewRight(true);
|
||||
//新建的时候添加共享
|
||||
modeRightInfo.editModeDataShare(creator, formModeId, bid);
|
||||
return bid;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 转换空字符串为null
|
||||
*
|
||||
* @param str 字符串
|
||||
* @return 转换后的字符串
|
||||
*/
|
||||
public static Object parseBlankToNull(String str) {
|
||||
return StringUtils.isBlank(str) ? null : str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换空字符串为null
|
||||
*
|
||||
* @param obj 对象
|
||||
* @return 转换后的字符串
|
||||
*/
|
||||
public static String parseBlankToNull(Object obj) {
|
||||
return Objects.isNull(obj) ? null : StringUtils.isBlank(obj.toString()) ? null : obj.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据建模表名,获取建模ID
|
||||
*
|
||||
* @param modeTable
|
||||
* @return
|
||||
*/
|
||||
public static int getModeIdByTableName(String modeTable) {
|
||||
int formModeId = -1;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from modeinfo where formid =( select id from workflow_bill where tablename = ? ) and isdelete = 0 order by id", modeTable);
|
||||
if (rs.next()) {
|
||||
formModeId = rs.getInt("id");
|
||||
}
|
||||
return formModeId;
|
||||
}
|
||||
|
||||
public static List<Formfield> getFieldList(String tableName) {
|
||||
int formId = getFormIdByTableName(tableName);
|
||||
return FormInfoManager.getInstance().getAllField(formId);
|
||||
}
|
||||
|
||||
public static List<Formfield> getFieldList(int formId) {
|
||||
return FormInfoManager.getInstance().getAllField(formId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据表名,获取表单ID
|
||||
*
|
||||
* @param modeTable
|
||||
* @return
|
||||
*/
|
||||
public static int getFormIdByTableName(String modeTable) {
|
||||
int formId = -1;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from workflow_bill where tablename = ? ", modeTable);
|
||||
if (rs.next()) {
|
||||
formId = rs.getInt("id");
|
||||
}
|
||||
return formId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取表单下拉框展示文本
|
||||
*
|
||||
* @param formId 表单ID
|
||||
* @param fieldName 字段明湖曾
|
||||
* @param value 下拉框值
|
||||
* @return
|
||||
*/
|
||||
public static String getSelectName(String formId, String fieldName, String value) {
|
||||
String cancelReason = "";
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select selectname from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? ) and selectvalue = ?", formId, fieldName, value);
|
||||
if (rs.next()) {
|
||||
cancelReason = rs.getString("selectname");
|
||||
}
|
||||
return cancelReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取表单下拉框值
|
||||
*
|
||||
* @param formId 表单ID
|
||||
* @param fieldName 字段明湖曾
|
||||
* @param selectName 下拉框展示内容
|
||||
* @return
|
||||
*/
|
||||
public static String getSelectValue(String formId, String fieldName, String selectName) {
|
||||
String selectValue = "";
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select selectvalue from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? ) and selectname = ?", formId, fieldName, selectName);
|
||||
if (rs.next()) {
|
||||
selectValue = rs.getString("selectvalue");
|
||||
}
|
||||
return selectValue;
|
||||
}
|
||||
|
||||
public static String getSelectValue(Formfield formfield, String selectName) {
|
||||
String selectValue = "";
|
||||
RecordSet rs = new RecordSet();
|
||||
String detailTable = Util.null2String(formfield.getDetailtable());
|
||||
if (StringUtils.isNotBlank(detailTable)) {
|
||||
rs.executeQuery("select selectvalue from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? and detailtable = ? ) and selectname = ?", formfield.getBillid(), formfield.getFieldname(), Util.null2String(detailTable), selectName);
|
||||
} else {
|
||||
rs.executeQuery("select selectvalue from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? AND (detailtable IS NULL OR detailtable = '') ) and selectname = ?", formfield.getBillid(), formfield.getFieldname(), selectName);
|
||||
}
|
||||
if (rs.next()) {
|
||||
selectValue = rs.getString("selectvalue");
|
||||
}
|
||||
return selectValue;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 全角转半角
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
public static String ToDBC(String input) {
|
||||
if (input == null) {
|
||||
input = "";
|
||||
}
|
||||
char[] c = input.toCharArray();
|
||||
for (int i = 0; i < c.length; i++) {
|
||||
if (c[i] == 12288) {
|
||||
//全角空格为12288,半角空格为32
|
||||
c[i] = (char) 32;
|
||||
continue;
|
||||
}
|
||||
if (c[i] > 65280 && c[i] < 65375) {
|
||||
//其他字符半角(33-126)与全角(65281-65374)的对应关系是:均相差65248
|
||||
c[i] = (char) (c[i] - 65248);
|
||||
}
|
||||
}
|
||||
return new String(c);
|
||||
}
|
||||
|
||||
public static String getTableNameByCustomId(String customId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select tablename from workflow_bill where id = (select formid from mode_customsearch where id = ?)", customId);
|
||||
if (rs.next()) {
|
||||
return rs.getString("tablename");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
package com.engine.secret.util;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.engine.core.exception.ECException;
|
||||
import com.engine.secret.exception.CustomizeRunTimeException;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 请求执行器
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Slf4j
|
||||
public class ResponseResult<T, R> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final User user;
|
||||
|
||||
private final BaseBean baseBean = new BaseBean();
|
||||
|
||||
private final Boolean isLog = "true".equals(baseBean.getPropValue("hrmSalary", "log"));
|
||||
|
||||
public ResponseResult(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一返回方法(自定义返回格式)
|
||||
*/
|
||||
public String customRun(Function<T, R> f, T t) {
|
||||
try {
|
||||
if (isLog) {
|
||||
log.info("run api , param {}", t);
|
||||
}
|
||||
return getJsonString(f.apply(t));
|
||||
} catch (com.engine.secret.exception.CustomizeRunTimeException e) {
|
||||
log.error("api run fail", e);
|
||||
return Error(e.getMessage());
|
||||
} catch (ECException e) {
|
||||
log.error("api run fail", e);
|
||||
Throwable cause = e.getCause();
|
||||
return Error(cause.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("api run fail", e);
|
||||
return Error("系统异常!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一返回方法
|
||||
*/
|
||||
public String run(Function<T, R> f, T t) {
|
||||
try {
|
||||
if (isLog) {
|
||||
log.info("run api , param {}", t);
|
||||
}
|
||||
return Ok(f.apply(t));
|
||||
} catch (com.engine.secret.exception.CustomizeRunTimeException e) {
|
||||
log.error("api run fail", e);
|
||||
return Error(e.getMessage());
|
||||
} catch (ECException e) {
|
||||
log.error("api run fail", e);
|
||||
Throwable cause = e.getCause();
|
||||
return Error(cause.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("api run fail", e);
|
||||
return Error("系统异常!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一返回方法(有参无返回)
|
||||
*/
|
||||
public String run(Consumer<T> f, T t) {
|
||||
try {
|
||||
if (isLog) {
|
||||
log.info("run api , param {}", t);
|
||||
}
|
||||
f.accept(t);
|
||||
return Ok();
|
||||
} catch (com.engine.secret.exception.CustomizeRunTimeException e) {
|
||||
log.error("api run fail", e);
|
||||
return Error(e.getMessage());
|
||||
} catch (ECException e) {
|
||||
log.error("api run fail", e);
|
||||
return Error(ExceptionUtil.getRealMessage(e));
|
||||
} catch (Exception e) {
|
||||
log.error("api run fail", e);
|
||||
return Error("系统异常!", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 统一返回方法(无参有返回)
|
||||
*/
|
||||
public String run(Supplier<R> f) {
|
||||
try {
|
||||
if (isLog) {
|
||||
log.info("run api");
|
||||
}
|
||||
return Ok(f.get());
|
||||
} catch (CustomizeRunTimeException e) {
|
||||
log.error("api run fail", e);
|
||||
return Error(e.getMessage());
|
||||
} catch (ECException e) {
|
||||
log.error("api run fail", e);
|
||||
Throwable cause = e.getCause();
|
||||
return Error(cause.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("api run fail", e);
|
||||
return Error("系统异常!", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static String getJsonString(Object apidatas) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
try {
|
||||
return mapper.writeValueAsString(apidatas);
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 成功返回
|
||||
*/
|
||||
private String Ok() {
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
apidatas.put("api_status", true);
|
||||
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 成功返回
|
||||
*/
|
||||
private String Ok(R r) {
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
apidatas.put("api_status", true);
|
||||
apidatas.put("data", r);
|
||||
String success = JSON.toJSONString(apidatas);
|
||||
if (isLog) {
|
||||
log.info("run salary api success return {}", success);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 失败返回
|
||||
*/
|
||||
private static String Error(String message) {
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
apidatas.put("api_status", false);
|
||||
apidatas.put("errormsg", message);
|
||||
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 系统异常失败返回
|
||||
*/
|
||||
private static String Error(String message, Exception e) {
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
apidatas.put("api_status", false);
|
||||
apidatas.put("errormsg", message);
|
||||
apidatas.put("error", e.getMessage());
|
||||
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.engine.secret.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.secret.service.AuthorityChangeService;
|
||||
import com.engine.secret.service.impl.AuthorityChangeServiceImpl;
|
||||
import com.engine.secret.util.ResponseResult;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class AuthorityChangeController {
|
||||
public AuthorityChangeService getService(User user) {
|
||||
return ServiceUtil.getService(AuthorityChangeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/delegateToProvincialAuthority")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String delegateToProvincialAuthority(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::delegateToProvincialAuthority, params);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.engine.secret.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.secret.service.AutoGenerateNumberService;
|
||||
import com.engine.secret.service.impl.AutoGenerateNumberServiceImpl;
|
||||
import com.engine.secret.util.ResponseResult;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class AutoGenerateNumberController {
|
||||
public AutoGenerateNumberService getService(User user) {
|
||||
return ServiceUtil.getService(AutoGenerateNumberServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getAcceptanceNumber")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getAcceptanceNumber(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, String>(user).run(getService(user)::getAcceptanceNumber, param);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.engine.secret.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.secret.service.QualificationApplicationService;
|
||||
import com.engine.secret.service.impl.QualificationApplicationServiceImpl;
|
||||
import com.engine.secret.util.ResponseResult;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/08/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class QualificationApplicationController {
|
||||
public QualificationApplicationService getService(User user) {
|
||||
return ServiceUtil.getService(QualificationApplicationServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/parsingFiles")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String parsingFiles(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::parsingFiles, params);
|
||||
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/deleteParsedData")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteParsedData(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::deleteParsedData, params);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package weaver.interfaces.secret.action;
|
||||
|
||||
import com.engine.secret.util.FlowUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 审批复核 归档Action
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class ApprovalReviewEndAction implements Action {
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
try {
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
Map<String, String> mainDataMap = new HashMap<>();
|
||||
for (Property property : properties) {
|
||||
mainDataMap.put(property.getName(), property.getValue());
|
||||
}
|
||||
// 获取主流程ID
|
||||
String mainRequestId = mainDataMap.get("zlcid");
|
||||
if (StringUtils.isBlank(mainRequestId)) {
|
||||
requestInfo.getRequestManager().setMessagecontent("未获取到主流程请求ID");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
// 获取审批复核结论
|
||||
String conclusion = mainDataMap.get("spfhjl");
|
||||
|
||||
// 更新主流程表单的审批复核结论
|
||||
String tableNameByRequestId = FlowUtil.getTableNameByRequestId(mainRequestId);
|
||||
if (StringUtils.isBlank(tableNameByRequestId)) {
|
||||
requestInfo.getRequestManager().setMessagecontent("主流程表单名称获取异常,请确认");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
String sql = "update " + tableNameByRequestId + " set spfhjl = ? where requestid = ?";
|
||||
|
||||
rs.writeLog("mainRequestId==" + mainRequestId);
|
||||
rs.writeLog("conclusion==" + conclusion);
|
||||
rs.writeLog("tableNameByRequestId==" + tableNameByRequestId);
|
||||
rs.writeLog("sql==" + sql);
|
||||
|
||||
rs.executeUpdate(sql, conclusion, mainRequestId);
|
||||
|
||||
// 更新完成后,自动提交流程到下一节点
|
||||
rs.writeLog("mainRequestId==" + mainRequestId);
|
||||
String options = requestInfo.getCreatorid() + "-自动提交流程-" + DateUtil.getFullDate();
|
||||
String submitResult = FlowUtil.submitWorkflowRequest(mainRequestId, options);
|
||||
if (!"success".equals(submitResult)) {
|
||||
requestInfo.getRequestManager().setMessagecontent("requestId[" + mainRequestId + "],流程提交失败");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
} catch (Exception e) {
|
||||
rs.writeLog(e);
|
||||
requestInfo.getRequestManager().setMessagecontent(e.getMessage());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
package weaver.interfaces.secret.action;
|
||||
|
||||
import com.engine.secret.util.ConfigUtil;
|
||||
import com.engine.secret.util.FlowUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/04/14
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class MeetingConveningEndAction implements Action {
|
||||
RecordSet rs = new RecordSet();
|
||||
private static final String MAIN_FLOW_TABLE = ConfigUtil.getConfig("xqxksqlc_table");
|
||||
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
try {
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
Map<String, String> mainDataMap = new HashMap<>();
|
||||
List<Map<String, String>> detailMapList = new ArrayList<>();
|
||||
for (Property property : properties) {
|
||||
mainDataMap.put(property.getName(), property.getValue());
|
||||
}
|
||||
|
||||
DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo();
|
||||
DetailTable detailTable = detailTableInfo.getDetailTable(0);
|
||||
String detailTableName = detailTable.getTableDBName();
|
||||
String updateDetailSql = "update " + detailTableName + " set zlctjzt = ? where id = ?";
|
||||
Row[] rows = detailTable.getRow();
|
||||
for (Row row : rows) {
|
||||
Map<String, String> detailDataMap = new HashMap<>(mainDataMap);
|
||||
Cell[] cells = row.getCell();
|
||||
String detailId = row.getId();
|
||||
for (Cell cell : cells) {
|
||||
detailDataMap.put(cell.getName(), cell.getValue());
|
||||
}
|
||||
detailDataMap.put("detailId", detailId);
|
||||
detailMapList.add(detailDataMap);
|
||||
}
|
||||
|
||||
Set<String> errorMsg = new HashSet<>();
|
||||
if (CollectionUtils.isNotEmpty(detailMapList)) {
|
||||
for (Map<String, String> detail : detailMapList) {
|
||||
dealMainFlow(requestInfo, detail, updateDetailSql, errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
// 根据错误信息,返回提示
|
||||
if (CollectionUtils.isNotEmpty(errorMsg)) {
|
||||
requestInfo.getRequestManager().setMessagecontent(StringUtils.join(errorMsg, "<br/>"));
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
return SUCCESS;
|
||||
} catch (Exception e) {
|
||||
rs.writeLog(e);
|
||||
requestInfo.getRequestManager().setMessagecontent(e.getMessage());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交主流程
|
||||
*
|
||||
* @param requestInfo
|
||||
* @param detail
|
||||
* @param updateDetailSql
|
||||
* @param errorMsg
|
||||
*/
|
||||
private void dealMainFlow(RequestInfo requestInfo, Map<String, String> detail, String updateDetailSql, Set<String> errorMsg) {
|
||||
String mainId = detail.get("xzxksqdh");
|
||||
|
||||
|
||||
String conclusion = detail.get("spfhjl");
|
||||
String detailId = detail.get("detailId");
|
||||
String submitStatus = detail.get("zlctjzt");
|
||||
if ("1".equals(submitStatus)) {
|
||||
// 已经提交成功的流程,不重复处理
|
||||
return;
|
||||
}
|
||||
|
||||
String mainRequestId = "";
|
||||
rs.executeQuery("select requestid from " + MAIN_FLOW_TABLE + " where id = ?", mainId);
|
||||
if (rs.next()) {
|
||||
mainRequestId = rs.getString("requestid");
|
||||
}
|
||||
if (StringUtils.isBlank(mainRequestId)) {
|
||||
errorMsg.add("主流程ID[" + mainId + "],主流程requestId获取异常,请确认");
|
||||
rs.executeUpdate(updateDetailSql, "2", detailId);
|
||||
return;
|
||||
}
|
||||
|
||||
rs.writeLog("mainRequestId==" + mainRequestId);
|
||||
rs.writeLog("conclusion==" + conclusion);
|
||||
|
||||
rs.executeUpdate("update " + MAIN_FLOW_TABLE + " set spfhjl = ? where requestid = ?", conclusion, mainRequestId);
|
||||
|
||||
// 更新完成后,自动提交流程到下一节点
|
||||
rs.writeLog("mainRequestId==" + mainRequestId);
|
||||
String options = requestInfo.getCreatorid() + "-自动提交流程-" + DateUtil.getFullDate();
|
||||
String submitResult = FlowUtil.submitWorkflowRequest(mainRequestId, options);
|
||||
if (!"success".equals(submitResult)) {
|
||||
errorMsg.add("requestId[" + mainRequestId + "],流程提交失败");
|
||||
rs.executeUpdate(updateDetailSql, "2", detailId);
|
||||
} else {
|
||||
rs.executeUpdate(updateDetailSql, "1", detailId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue