parent
fda37ab2c8
commit
02e66afd8d
|
@ -1,7 +1,13 @@
|
|||
package shkd.sys.sys.mservice;
|
||||
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.tmc.fpm.business.dataproc.query.ReportDataQParam;
|
||||
import kd.tmc.fpm.business.dataproc.query.ReportDataQResult;
|
||||
import kd.tmc.fpm.business.dataproc.save.ReportDataSDKService;
|
||||
import kd.bos.login.actions.SerializationUtils;
|
||||
import kd.tmc.fpm.business.dataproc.save.domain.*;
|
||||
|
@ -29,14 +35,15 @@ public class PlanningService {
|
|||
|
||||
/**
|
||||
* 计划编制批量写入服务
|
||||
* @param periodCode 编报期间code
|
||||
* @param orgCode 编报主体code
|
||||
* @param subjectCode 计划科目code
|
||||
*
|
||||
* @param periodCode 编报期间code
|
||||
* @param orgCode 编报主体code
|
||||
* @param subjectCode 计划科目code
|
||||
* @param entryPeriodCode 主维度数据分录期间code
|
||||
* @param amount 写入金额
|
||||
* @param amount 写入金额
|
||||
* @return
|
||||
*/
|
||||
public static FpmResponse<Void> planningWrite(String periodCode, String orgCode, String subjectCode, String entryPeriodCode, int amount) {
|
||||
public static FpmResponse<Void> planningWrite(String periodCode, String orgCode, String subjectCode, String entryPeriodCode, String amount) {
|
||||
// 1. 构造请求参数
|
||||
ReportDataBatchSaveParam reportDataBatchSaveParam = new ReportDataBatchSaveParam();
|
||||
// 体系code
|
||||
|
@ -112,7 +119,7 @@ public class PlanningService {
|
|||
* @param amount 调整金额
|
||||
* @return
|
||||
*/
|
||||
public static ReportAdjustBillBatchSaveResDTO planAdjustment(String adjustReason, String orgCode, String periodCode, String subjectCode, String entryPeriodCode, int amount) {
|
||||
public static ReportAdjustBillBatchSaveResDTO planAdjustment(String adjustReason, String orgCode, String periodCode, String subjectCode, String entryPeriodCode, String amount) {
|
||||
logger.info("计划调整服务入参:adjustReason={},orgCode={},periodCode={},subjectCode={},entryPeriodCode={},amount={}", adjustReason, orgCode, periodCode, subjectCode, entryPeriodCode, amount);
|
||||
ReportAdjustBillBatchSaveDTO reportAdjustBillBatchSaveDTO = new ReportAdjustBillBatchSaveDTO();
|
||||
reportAdjustBillBatchSaveDTO.setSystemCode("SYS-005");// 体系编码
|
||||
|
@ -167,4 +174,44 @@ public class PlanningService {
|
|||
}
|
||||
return reportAdjustBillBatchSaveResDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划编制
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String queryPlanning(String reportPeriod, String reportOrg) {
|
||||
DynamicObject[] fpm_member1 = BusinessDataServiceHelper.load("fpm_member", "id,name,number", new QFilter("name", QCP.equals, reportPeriod).toArray());
|
||||
if (fpm_member1 == null || fpm_member1.length == 0) {
|
||||
return null;
|
||||
}
|
||||
DynamicObject[] fpm_member2 = BusinessDataServiceHelper.load("fpm_member", "id,name,number", new QFilter("name", QCP.equals, reportOrg).toArray());
|
||||
if (fpm_member2 == null || fpm_member2.length == 0) {
|
||||
return null;
|
||||
}
|
||||
ReportDataQParam reportDataQParam = new ReportDataQParam();
|
||||
reportDataQParam.setSystemId(2128490588343906304L);// 体系ID
|
||||
reportDataQParam.setReportPeriodId((Long) fpm_member1[0].getPkValue());// 编报期间ID
|
||||
ArrayList<Long> longs = new ArrayList<>();
|
||||
longs.add((Long) fpm_member2[0].getPkValue());
|
||||
reportDataQParam.setReportOrgIds(longs);// 编报主体ID
|
||||
|
||||
String qParam = SerializationUtils.serializeToBase64(reportDataQParam);
|
||||
// 3. 调用SDK接口
|
||||
ReportDataSDKService reportDataSDKService = new ReportDataSDKService();
|
||||
String queryReportData = reportDataSDKService.queryReportData(qParam);
|
||||
// 4. 反序列化响应结果
|
||||
FpmOperateResult<List<ReportDataQResult>> responseObject = SerializationUtils.deSerializeFromBase64(queryReportData);
|
||||
logger.info("是否成功:{}\n消息列表:{}\n警告消息列表:{}",
|
||||
responseObject.isSuccess(),
|
||||
responseObject.getMessageList(),
|
||||
responseObject.getWarnMessage());
|
||||
List<ReportDataQResult> data = responseObject.getData();
|
||||
logger.info("查询结果:{}", data);
|
||||
if (data != null && !data.isEmpty()) {
|
||||
return "存在编报期间【" + reportPeriod + "】,编报主体【"+ reportOrg+"】的计划编制";
|
||||
} else {
|
||||
return "不存在编报期间【" + reportPeriod + "】,编报主体【"+ reportOrg+"】的计划编制";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,28 +1,20 @@
|
|||
package shkd.sys.sys.plugin.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.list.plugin.AbstractListPlugin;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.openapi.common.custom.annotation.*;
|
||||
import kd.bos.openapi.common.result.CustomApiResult;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.tmc.fpm.business.dataproc.save.domain.FpmResponse;
|
||||
import kd.tmc.fpm.business.dataproc.save.domain.ReportAdjustBillBatchSaveResDTO;
|
||||
import shade.javax.validation.Valid;
|
||||
import shkd.sys.sys.mservice.PlanningService;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static shkd.sys.sys.mservice.PlanningService.planAdjustment;
|
||||
import static shkd.sys.sys.mservice.PlanningService.planningWrite;
|
||||
import static shkd.sys.sys.mservice.PlanningService.*;
|
||||
|
||||
@ApiController(value = "open", desc = "用户example")
|
||||
@ApiMapping("/example")
|
||||
|
@ -58,7 +50,7 @@ public class InterfacePracticePlug extends AbstractListPlugin implements Seriali
|
|||
jsonObject.getString("subjectCode");// 计划科目
|
||||
jsonObject.getString("entryPeriodCode");// 主维度数据分录期间code
|
||||
jsonObject.getString("amount");//金额
|
||||
FpmResponse<Void> voidFpmResponse = planningWrite(jsonObject.getString("periodCode"), jsonObject.getString("orgCode"), jsonObject.getString("subjectCode"), jsonObject.getString("entryPeriodCode"), Integer.parseInt(jsonObject.getString("amount")));
|
||||
FpmResponse<Void> voidFpmResponse = planningWrite(jsonObject.getString("periodCode"), jsonObject.getString("orgCode"), jsonObject.getString("subjectCode"), jsonObject.getString("entryPeriodCode"), jsonObject.getString("amount"));
|
||||
stringBuffer.append("第").append(i + 1).append("条数据写入").append(voidFpmResponse.isSuccess() ? "成功" : "失败")
|
||||
.append(",返回信息:").append(voidFpmResponse.getMessage()).append("\n");
|
||||
}
|
||||
|
@ -83,14 +75,14 @@ public class InterfacePracticePlug extends AbstractListPlugin implements Seriali
|
|||
jsonObject.getString("periodCode");// 编报期间
|
||||
jsonObject.getString("subjectCode");// 计划科目
|
||||
jsonObject.getString("entryPeriodCode");// 主维度数据分录期间code
|
||||
jsonObject.getString("amount");//金额
|
||||
jsonObject.getString("amount");// 金额
|
||||
ReportAdjustBillBatchSaveResDTO resDTO = planAdjustment(
|
||||
jsonObject.getString("adjustReason"),
|
||||
jsonObject.getString("orgCode"),
|
||||
jsonObject.getString("periodCode"),
|
||||
jsonObject.getString("subjectCode"),
|
||||
jsonObject.getString("entryPeriodCode"),
|
||||
Integer.parseInt(jsonObject.getString("amount"))
|
||||
jsonObject.getString("amount")
|
||||
);
|
||||
|
||||
List<String> adjustBillNoList = resDTO.getAdjustBillNoList();// 调整单据编号列表
|
||||
|
@ -102,4 +94,19 @@ public class InterfacePracticePlug extends AbstractListPlugin implements Seriali
|
|||
}
|
||||
return CustomApiResult.success(stringBuffer.toString());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 计划编制查询
|
||||
*
|
||||
* @param hashMap
|
||||
* @return
|
||||
*/
|
||||
@ApiPostMapping(value = "planAdjustment_save", desc = "计划编制查询")
|
||||
public CustomApiResult<@ApiResponseBody("返回参数") String> planAdjustment_query(@ApiParam(value = "查询字段值") HashMap<String, Object> hashMap) {
|
||||
String reportPeriodName = hashMap.get("reportPeriodName").toString();// 编报期间ID
|
||||
String reportOrgName = hashMap.get("reportOrgName").toString();// 编报主体ID
|
||||
String queryPlanning = queryPlanning(reportPeriodName, reportOrgName);
|
||||
return CustomApiResult.success(queryPlanning);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -531,8 +531,7 @@ public class PayBillApiSavePlugin implements ApiSavePlugin {
|
|||
}
|
||||
}
|
||||
else if ("cas_paybill_span_BT_S".equals(billtype_number) && "XK".equals(shkd_businessname)) {// 星空传的跨主体调拨
|
||||
// 收款人ID
|
||||
fieldName1 = "payee";
|
||||
fieldName1 = "payee";// 收款人ID
|
||||
// 付款银行编码
|
||||
fieldName2 = "payerbank";
|
||||
Map<String, Object> payeebank = (Map<String, Object>) map.get("payeebank");
|
||||
|
|
Loading…
Reference in New Issue