Compare commits
5 Commits
master
...
湖南方盛制药股份有限
Author | SHA1 | Date |
---|---|---|
|
d1723942ed | 2 weeks ago |
|
4d4075598d | 2 weeks ago |
|
345daced84 | 2 weeks ago |
|
96b0292a2f | 4 months ago |
|
aef3473db1 | 4 months ago |
@ -0,0 +1,13 @@
|
|||||||
|
package com.api.fssecond.web;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2025/4/9 14:46
|
||||||
|
* @Description: 获取电子凭证
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Path("/fssecond/workflow")
|
||||||
|
public class EleEctronVoucherAction extends com.engine.fssecond.web.EleEctronVoucherAction {
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.engine.fssecond.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class GenerateDocParams {
|
||||||
|
|
||||||
|
private int imageFileid;
|
||||||
|
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
private String docContent;
|
||||||
|
|
||||||
|
private String workflowid;
|
||||||
|
|
||||||
|
private int creater;
|
||||||
|
|
||||||
|
private String docCreateDate;
|
||||||
|
|
||||||
|
private String docCreateTime;
|
||||||
|
|
||||||
|
private int maincategory;
|
||||||
|
|
||||||
|
private int subcategory;
|
||||||
|
|
||||||
|
private int seccategory;
|
||||||
|
|
||||||
|
private int docType;
|
||||||
|
|
||||||
|
private String docExtendname;
|
||||||
|
|
||||||
|
private String clientAddress;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.engine.fssecond.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2025/4/9 14:46
|
||||||
|
* @Description:
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface EleEctronVoucherService {
|
||||||
|
|
||||||
|
|
||||||
|
Map<String,Object> generateFile(Map<String, Object> params);
|
||||||
|
}
|
@ -0,0 +1,252 @@
|
|||||||
|
package com.engine.fssecond.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONArray;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.api.formmode.page.util.Util;
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.fssecond.entity.GenerateDocParams;
|
||||||
|
import com.engine.fssecond.service.EleEctronVoucherService;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
|
import com.weaver.general.TimeUtil;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.docs.category.SecCategoryComInfo;
|
||||||
|
import weaver.docs.docs.DocComInfo;
|
||||||
|
import weaver.docs.docs.DocImageManager;
|
||||||
|
import weaver.docs.docs.DocManager;
|
||||||
|
import weaver.docs.docs.DocViewer;
|
||||||
|
import weaver.file.ImageFileManager;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
import weaver.workflow.request.RequestDoc;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2025/4/9 14:47
|
||||||
|
* @Description: TODO
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class EleEctronVoucherServiceImpl extends Service implements EleEctronVoucherService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> generateFile(Map<String, Object> params) {
|
||||||
|
|
||||||
|
String billId = Util.null2String(params.get("billId"));
|
||||||
|
String host = Util.null2String(params.get("host"));
|
||||||
|
String maincategory = Util.null2String(params.get("maincategory"));
|
||||||
|
String subcategory = Util.null2String(params.get("subcategory"));
|
||||||
|
String seccategory = Util.null2String(params.get("seccategory"));
|
||||||
|
String workflowid = Util.null2String(params.get("workflowid"));
|
||||||
|
|
||||||
|
Map<String, Object> fileMap = new HashMap<>(2);
|
||||||
|
String apiUrl = host + "/uapws/rest/gl/voucherout/voucheroutpdf";
|
||||||
|
|
||||||
|
String fileName = "凭证" + billId + ".pdf";
|
||||||
|
|
||||||
|
// 1. 发送 POST 请求,获取 InputStream
|
||||||
|
try (HttpResponse response = HttpRequest.post(apiUrl)
|
||||||
|
.header("Content-Type", "application/json")
|
||||||
|
.body("{\"billId\": \"" + billId + "\"}")
|
||||||
|
.execute()) {
|
||||||
|
|
||||||
|
// 2. 检查响应状态码
|
||||||
|
if (response.isOk()) {
|
||||||
|
|
||||||
|
// 解析 JSON 响应
|
||||||
|
String body = response.body();
|
||||||
|
JSONObject json = JSONUtil.parseObj(body);
|
||||||
|
|
||||||
|
// 检查 success 和 code
|
||||||
|
if (json.getBool("success") && "1000000000".equals(json.getStr("code"))) {
|
||||||
|
// 提取 data 数组
|
||||||
|
JSONArray dataArray = json.getJSONArray("data");
|
||||||
|
byte[] bytes = new byte[dataArray.size()];
|
||||||
|
for (int i = 0; i < dataArray.size(); i++) {
|
||||||
|
bytes[i] = dataArray.getInt(i).byteValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将字节数组转换为 InputStream
|
||||||
|
InputStream inputStream = new ByteArrayInputStream(bytes);
|
||||||
|
|
||||||
|
//InputStream inputStream = response.bodyStream();
|
||||||
|
//附件生成
|
||||||
|
int imageFileid = generateImageFileid(inputStream, fileName);
|
||||||
|
GenerateDocParams generateDocParams = GenerateDocParams.builder()
|
||||||
|
.imageFileid(imageFileid)
|
||||||
|
.fileName(fileName)
|
||||||
|
.creater(user.getUID())
|
||||||
|
.docCreateDate(TimeUtil.getCurrentDateString())
|
||||||
|
.docCreateTime(TimeUtil.getOnlyCurrentTimeString())
|
||||||
|
.maincategory(Integer.parseInt(maincategory))
|
||||||
|
.subcategory(Integer.parseInt(subcategory))
|
||||||
|
.seccategory(Integer.parseInt(seccategory))
|
||||||
|
.docType(1)
|
||||||
|
.docExtendname(".pdf")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
fileMap.put("imageFileid", imageFileid);
|
||||||
|
fileMap.put("fileName", fileName);
|
||||||
|
|
||||||
|
int docId = generateDocId(user, generateDocParams);
|
||||||
|
fileMap.put("docId", docId);
|
||||||
|
}else {
|
||||||
|
fileMap.put("msg",json);
|
||||||
|
//fileMap.put("msg",json.getStr("data"));
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
fileMap.put("msg","接口调用失败 ->"+response.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return fileMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private int generateImageFileid(InputStream inputStream, String filename) {
|
||||||
|
int imagefileid = -1;
|
||||||
|
try {
|
||||||
|
ByteArrayOutputStream bos = null;
|
||||||
|
byte[] data = null;
|
||||||
|
try {
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int len = 0;
|
||||||
|
bos = new ByteArrayOutputStream();
|
||||||
|
while ((len = inputStream.read(buffer)) != -1) {
|
||||||
|
bos.write(buffer, 0, len);
|
||||||
|
}
|
||||||
|
data = bos.toByteArray();
|
||||||
|
bos.flush();
|
||||||
|
} catch (Exception e) {
|
||||||
|
} finally {
|
||||||
|
if (bos != null) {
|
||||||
|
try {
|
||||||
|
bos.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
inputStream.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data == null || data.length == 0) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
ImageFileManager ifm = new ImageFileManager();
|
||||||
|
ifm.setData(data);
|
||||||
|
|
||||||
|
ifm.setImagFileName(filename);
|
||||||
|
imagefileid = ifm.saveImageFile();// 文件存储及更新imagefile表
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
inputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return imagefileid;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int generateDocId(User user, GenerateDocParams gdp){
|
||||||
|
|
||||||
|
DocManager dm = new DocManager();
|
||||||
|
DocImageManager imgManger = new DocImageManager();
|
||||||
|
SecCategoryComInfo scc = new SecCategoryComInfo();
|
||||||
|
DocComInfo dc = new DocComInfo();
|
||||||
|
DocViewer dv = new DocViewer();
|
||||||
|
|
||||||
|
try {
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
int docId = dm.getNextDocId(rs);
|
||||||
|
String filename = gdp.getFileName();
|
||||||
|
imgManger.resetParameter();
|
||||||
|
String docSubject = getFileMainName(filename);
|
||||||
|
imgManger.setImagefilename(filename);
|
||||||
|
imgManger.setDocfiletype(weaver.general.Util.null2String(gdp.getDocType()));
|
||||||
|
imgManger.setDocid(docId);
|
||||||
|
imgManger.setImagefileid(gdp.getImageFileid());
|
||||||
|
imgManger.setIsextfile("1");//1附件
|
||||||
|
imgManger.setOperateuserid(user.getUID()); //默认管理员
|
||||||
|
imgManger.setDocfiletype("2");
|
||||||
|
imgManger.AddDocImageInfo();
|
||||||
|
|
||||||
|
|
||||||
|
int workflowid= weaver.general.Util.getIntValue(gdp.getWorkflowid(),0);
|
||||||
|
String isWorkflowDraft = "0";
|
||||||
|
if(workflowid > 0){
|
||||||
|
RequestDoc requestDoc=new RequestDoc();
|
||||||
|
ArrayList docFiledList = requestDoc.getDocFiled(""+workflowid);
|
||||||
|
if(docFiledList != null && docFiledList.size() > 6){
|
||||||
|
isWorkflowDraft = "" +docFiledList.get(6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String docStatus = "1"; //生效正常
|
||||||
|
if("1".equals(isWorkflowDraft)){
|
||||||
|
docStatus = "9"; //流程草稿
|
||||||
|
}
|
||||||
|
|
||||||
|
dm.setId(docId);
|
||||||
|
dm.setMaincategory(gdp.getMaincategory());
|
||||||
|
dm.setSubcategory(gdp.getSubcategory());
|
||||||
|
dm.setSeccategory(gdp.getSeccategory());
|
||||||
|
dm.setLanguageid(user.getLanguage());
|
||||||
|
dm.setDoccontent(weaver.general.Util.null2String(gdp.getDocContent()));
|
||||||
|
dm.setDocstatus(docStatus);
|
||||||
|
dm.setDocsubject(docSubject);
|
||||||
|
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(gdp.getDocCreateDate());
|
||||||
|
dm.setDoclastmoddate(gdp.getDocCreateDate());
|
||||||
|
dm.setDoccreatetime(gdp.getDocCreateTime());
|
||||||
|
dm.setDoclastmodtime(gdp.getDocCreateTime());
|
||||||
|
dm.setDoclangurage(user.getLanguage());
|
||||||
|
dm.setKeyword(docSubject);
|
||||||
|
dm.setIsapprover("0"); //批复意见
|
||||||
|
dm.setIsreply(""); //是否回复文档
|
||||||
|
dm.setDocdepartmentid(user.getUserDepartment());
|
||||||
|
dm.setDocreplyable("1"); //是否可回复
|
||||||
|
dm.setAccessorycount(1); //附件总数
|
||||||
|
dm.setParentids("" + docId); //文档父节点
|
||||||
|
dm.setOrderable("" + scc.getSecOrderable(gdp.getSeccategory())); //得到此分录下文是否可订阅
|
||||||
|
dm.setClientAddress(gdp.getClientAddress());
|
||||||
|
dm.setUserid(user.getUID());
|
||||||
|
dm.AddDocInfo();
|
||||||
|
dm.AddShareInfo();
|
||||||
|
dc.addDocInfoCache("" + docId);
|
||||||
|
dv.setDocShareByDoc("" + docId);
|
||||||
|
return docId;
|
||||||
|
}catch (Exception ex) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getFileMainName(String fileName) {
|
||||||
|
if (fileName == null){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
int pos = fileName.lastIndexOf(".");
|
||||||
|
if (pos != -1) {
|
||||||
|
fileName = fileName.substring(0, pos);
|
||||||
|
}
|
||||||
|
return fileName;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.engine.fssecond.web;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
|
import com.engine.common.util.ParamUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.fssecond.service.EleEctronVoucherService;
|
||||||
|
import com.engine.fssecond.service.impl.EleEctronVoucherServiceImpl;
|
||||||
|
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.QueryParam;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2025/4/9 14:46
|
||||||
|
* @Description:
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class EleEctronVoucherAction {
|
||||||
|
|
||||||
|
private EleEctronVoucherService getService(User user) {
|
||||||
|
return ServiceUtil.getService(EleEctronVoucherServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/generateFile")
|
||||||
|
@Produces(MediaType.TEXT_PLAIN)
|
||||||
|
public String generateFile(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||||
|
@QueryParam("billId") String billId,@QueryParam("host") String host){
|
||||||
|
Map<String, Object> data = new HashMap<>(8);
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||||
|
data.putAll(getService(user).generateFile(params));
|
||||||
|
} catch (Exception e) {
|
||||||
|
data.put("msg", "catch exception : " + e.getMessage());
|
||||||
|
}
|
||||||
|
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,170 @@
|
|||||||
|
package weaver.interfaces.fssecond.action;
|
||||||
|
|
||||||
|
import com.weaver.general.TimeUtil;
|
||||||
|
import com.weaver.general.Util;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.interfaces.workflow.action.Action;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2024/12/18 1:38 PM
|
||||||
|
* @Description: QC3433560 年度费用预算申请 流程更新 费控预算信息
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class FnabudgetinfoAction implements Action {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String execute(RequestInfo requestInfo) {
|
||||||
|
|
||||||
|
String requestid = requestInfo.getRequestid();
|
||||||
|
int formid = Math.abs(requestInfo.getRequestManager().getFormid());
|
||||||
|
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
String mainTable = String.format("%s%s", "formtable_main_", formid);
|
||||||
|
String detaiTable = String.format("%s%s",mainTable,"_dt1");
|
||||||
|
|
||||||
|
String currentTime = TimeUtil.getCurrentTimeString();
|
||||||
|
|
||||||
|
FnabudgetinfoPo fbinfo = FnabudgetinfoPo.builder()
|
||||||
|
.budgetStatus(1)
|
||||||
|
.organizationType(2)
|
||||||
|
.revision(0)
|
||||||
|
.status(1)
|
||||||
|
.createDate(currentTime)
|
||||||
|
.remark("年度费用预算申请流程requestid:"+requestid)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
Integer mainTableId = null;
|
||||||
|
//1.获取流程主表信息
|
||||||
|
rs.executeQuery("select id,sqr,ysnd,ysbm from "+mainTable+" where requestId = ?",requestid);
|
||||||
|
if (rs.next()) {
|
||||||
|
mainTableId = Util.getIntValue(rs.getString("id"));
|
||||||
|
fbinfo.setCreaterId(Util.getIntValue(rs.getString("sqr")));
|
||||||
|
fbinfo.setBudgetperiods(selectBudgetPeriods(Util.null2String(rs.getString("ysnd"))));
|
||||||
|
fbinfo.setBudgetOrganizationId(Util.getIntValue(rs.getString("ysbm")));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fbinfo.getBudgetperiods() == null) {
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("费控预算年度未维护");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//2.插入费控主表信息
|
||||||
|
//校验数据是否重复
|
||||||
|
rs.executeQuery("select count(1) as sums from fnabudgetinfo where organizationtype = 2 and budgetorganizationid = ? and " +
|
||||||
|
" budgetperiods = ? and status = 1",fbinfo.getBudgetOrganizationId(),fbinfo.getBudgetperiods());
|
||||||
|
rs.next();
|
||||||
|
int sums = Util.getIntValue(rs.getString("sums"));
|
||||||
|
if (sums > 0) {
|
||||||
|
requestInfo.getRequestManager().setMessagecontent("当前部门费控预算信息已存在生效状态数据,请检查");
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
rs.executeUpdate("insert into fnabudgetinfo(budgetstatus,createrid,budgetorganizationid,organizationtype,budgetperiods," +
|
||||||
|
" revision,status,remark,createdate) values(?,?,?,?,?,?,?,?,?)",fbinfo.getBudgetStatus(),fbinfo.getCreaterId(),
|
||||||
|
fbinfo.getBudgetOrganizationId(),fbinfo.getOrganizationType(),fbinfo.getBudgetperiods(),fbinfo.getRevision(),
|
||||||
|
fbinfo.getStatus(),fbinfo.getRemark(),fbinfo.getCreateDate());
|
||||||
|
|
||||||
|
//获取插入后主表id
|
||||||
|
rs.executeQuery("select id from fnabudgetinfo where organizationtype = 2 and budgetorganizationid = ? and " +
|
||||||
|
" budgetperiods = ? and status = 1",fbinfo.getBudgetOrganizationId(),fbinfo.getBudgetperiods());
|
||||||
|
|
||||||
|
rs.next();
|
||||||
|
Integer budgetinfoId = Util.getIntValue(rs.getString("id"));
|
||||||
|
|
||||||
|
|
||||||
|
List<FnabudgetinfoDetailPo> fbDetail = new ArrayList<>();
|
||||||
|
//3.获取流程明细数据
|
||||||
|
rs.executeQuery("select kmmc,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,ybzsm_1,ybzsm_2,ybzsm_3,ybzsm_4,ybzsm_5,ybzsm_6,ybzsm_7,ybzsm_8,ybzsm_9,ybzsm_10,ybzsm_11,ybzsm_12 \n" +
|
||||||
|
" from "+detaiTable+" where mainid = ? and (y1 is not null or y2 is not null or y3 is not null or y4 is not null or y5 is not null \n" +
|
||||||
|
" or y6 is not null or y7 is not null or y8 is not null or y9 is not null or y10 is not null or y11 is not null or y12 is not null)",mainTableId);
|
||||||
|
|
||||||
|
while (rs.next()) {
|
||||||
|
Integer kmmc = Util.getIntValue(rs.getString("kmmc"));
|
||||||
|
String y1 = Util.null2String(rs.getString("y1"));
|
||||||
|
String y2 = Util.null2String(rs.getString("y2"));
|
||||||
|
String y3 = Util.null2String(rs.getString("y3"));
|
||||||
|
String y4 = Util.null2String(rs.getString("y4"));
|
||||||
|
String y5 = Util.null2String(rs.getString("y5"));
|
||||||
|
String y6 = Util.null2String(rs.getString("y6"));
|
||||||
|
String y7 = Util.null2String(rs.getString("y7"));
|
||||||
|
String y8 = Util.null2String(rs.getString("y8"));
|
||||||
|
String y9 = Util.null2String(rs.getString("y9"));
|
||||||
|
String y10 = Util.null2String(rs.getString("y10"));
|
||||||
|
String y11 = Util.null2String(rs.getString("y11"));
|
||||||
|
String y12 = Util.null2String(rs.getString("y12"));
|
||||||
|
|
||||||
|
|
||||||
|
// String ybzsm1 = Util.null2String(rs.getString("ybzsm_1"));
|
||||||
|
// String ybzsm2 = Util.null2String(rs.getString("ybzsm_2"));
|
||||||
|
// String ybzsm3 = Util.null2String(rs.getString("ybzsm_3"));
|
||||||
|
// String ybzsm4 = Util.null2String(rs.getString("ybzsm_4"));
|
||||||
|
// String ybzsm5 = Util.null2String(rs.getString("ybzsm_5"));
|
||||||
|
// String ybzsm6 = Util.null2String(rs.getString("ybzsm_6"));
|
||||||
|
// String ybzsm7 = Util.null2String(rs.getString("ybzsm_7"));
|
||||||
|
// String ybzsm8 = Util.null2String(rs.getString("ybzsm_8"));
|
||||||
|
// String ybzsm9 = Util.null2String(rs.getString("ybzsm_9"));
|
||||||
|
// String ybzsm10 = Util.null2String(rs.getString("ybzsm_10"));
|
||||||
|
// String ybzsm11 = Util.null2String(rs.getString("ybzsm_11"));
|
||||||
|
// String ybzsm12 = Util.null2String(rs.getString("ybzsm_12"));
|
||||||
|
|
||||||
|
|
||||||
|
List<FnabudgetinfoDetailItemPo> items = new ArrayList<>();
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y1).budgetperiodsList(1).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y2).budgetperiodsList(2).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y3).budgetperiodsList(3).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y4).budgetperiodsList(4).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y5).budgetperiodsList(5).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y6).budgetperiodsList(6).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y7).budgetperiodsList(7).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y8).budgetperiodsList(8).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y9).budgetperiodsList(9).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y10).budgetperiodsList(10).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y11).budgetperiodsList(11).build());
|
||||||
|
items.add(FnabudgetinfoDetailItemPo.builder().budgetAccount(y12).budgetperiodsList(12).build());
|
||||||
|
|
||||||
|
items.forEach(e -> {
|
||||||
|
if (StringUtils.isNotEmpty(e.getBudgetAccount())){
|
||||||
|
|
||||||
|
double value = Util.getDoubleValue(e.getBudgetAccount());
|
||||||
|
FnabudgetinfoDetailPo fnabudgetinfoDetail = FnabudgetinfoDetailPo.builder().budgettypeId(kmmc)
|
||||||
|
.budgetAccount(value).budgetperiodsList(e.getBudgetperiodsList()).build();
|
||||||
|
fbDetail.add(fnabudgetinfoDetail);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//4.插入费控明细表信息
|
||||||
|
fbDetail.forEach(item -> {
|
||||||
|
rs.executeUpdate("insert into fnabudgetinfodetail(budgetinfoid,budgetperiods,budgettypeid,budgetaccount,budgetperiodslist) " +
|
||||||
|
" values(?,?,?,?,?)",budgetinfoId,fbinfo.getBudgetperiods(),item.getBudgettypeId(),item.getBudgetAccount(),item.getBudgetperiodsList());
|
||||||
|
});
|
||||||
|
|
||||||
|
return Action.SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取预算年度id
|
||||||
|
* @param year
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Integer selectBudgetPeriods(String year) {
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
Integer budgetperiods = null;
|
||||||
|
rs.executeQuery("select id from FnaYearsPeriods where fnayear = ?",year);
|
||||||
|
if (rs.next()) {
|
||||||
|
budgetperiods = Util.getIntValue(rs.getString("id"));
|
||||||
|
}
|
||||||
|
return budgetperiods;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package weaver.interfaces.fssecond.action;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2024/12/18 1:47 PM
|
||||||
|
* @Description: TODO
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class FnabudgetinfoDetailItemPo {
|
||||||
|
|
||||||
|
private String budgetAccount;
|
||||||
|
|
||||||
|
private String budgetremark;
|
||||||
|
|
||||||
|
private Integer budgetperiodsList;
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package weaver.interfaces.fssecond.action;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2024/12/18 1:47 PM
|
||||||
|
* @Description: TODO
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class FnabudgetinfoDetailPo {
|
||||||
|
|
||||||
|
private Integer budgetinfoId;
|
||||||
|
|
||||||
|
private Integer budgetperiods;
|
||||||
|
|
||||||
|
private Integer budgettypeId;
|
||||||
|
|
||||||
|
private double budgetAccount;
|
||||||
|
|
||||||
|
private String budgetremark;
|
||||||
|
|
||||||
|
private Integer budgetperiodsList;
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package weaver.interfaces.fssecond.action;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2024/12/18 1:47 PM
|
||||||
|
* @Description: TODO
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class FnabudgetinfoPo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预算状态 默认值已审批 1
|
||||||
|
*/
|
||||||
|
private Integer budgetStatus;
|
||||||
|
|
||||||
|
private Integer createrId;
|
||||||
|
|
||||||
|
private Integer budgetOrganizationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程维度 默认部门 2
|
||||||
|
*/
|
||||||
|
private Integer organizationType;
|
||||||
|
|
||||||
|
private Integer budgetperiods;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本默认 0
|
||||||
|
*/
|
||||||
|
private Integer revision;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认生效 1
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建日期 yy-MM-dd HH:mm:ss
|
||||||
|
*/
|
||||||
|
private String createDate;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue