|
@@ -54,24 +54,29 @@ public class UasOaService extends AbstractService {
|
|
|
logger.info("出差申请单alitripList==" + alitripList.size());
|
|
|
for (OapiAlitripBtripApplySearchResponse.OpenApplyRs openApplyRs:alitripList) {
|
|
|
String inDate = DateUtil.format(openApplyRs.getGmtCreate(),"yyyy-MM-dd HH:mm:ss");
|
|
|
- List<OapiAlitripBtripApplySearchResponse.OpenItineraryInfo> itineraryList = openApplyRs.getItineraryList();
|
|
|
- OapiAlitripBtripApplySearchResponse.OpenItineraryInfo openItineraryInfo = itineraryList.get(0);
|
|
|
- String startDate = DateUtil.format(openItineraryInfo.getDepDate(),"yyyy-MM-dd HH:mm:ss");
|
|
|
- String endDate = DateUtil.format(openItineraryInfo.getArrDate(),"yyyy-MM-dd HH:mm:ss");
|
|
|
Long rsId = openApplyRs.getId();
|
|
|
- String projectTitle = openItineraryInfo.getProjectTitle();
|
|
|
- String projectCode = openItineraryInfo.getProjectCode();
|
|
|
- String arrCity = openItineraryInfo.getArrCity();
|
|
|
- String depCity = openItineraryInfo.getDepCity();
|
|
|
- String statusDesc = openApplyRs.getStatusDesc()==null?"":openApplyRs.getStatusDesc();
|
|
|
- int count =queryForObject("select count(1) from FeePlease where dp_ddid=" + rsId, Integer.class);
|
|
|
- if (count<=0&&"已同意".equals(statusDesc)) {
|
|
|
- int id = generateId("FEEPLEASE_SEQ");
|
|
|
- String code = generateCode("FeePlease!CCSQ!new", 2);
|
|
|
- jdbcTemplate.execute("insert into FeePlease (fp_id,fp_code,fp_kind,fp_v9,FP_PEOPLE2,fp_recordman,fp_recorddate,fp_statuscode,fp_status,fp_v3,fp_prestartdate,fp_preenddate,fp_n6,dp_ddid,fp_remark,fp_prjcode,fp_prjname,fp_depcity,fp_arrcity) " +
|
|
|
- "values (" + id + ",'" + code + "','出差申请单','" + openApplyRs.getDeptName() + "','" + openApplyRs.getUserName() + "','" + openApplyRs.getUserName() + "',to_date('" + inDate + "','yyyy-MM-dd HH24:mi:ss'),'AUDITED','已审核','" + openApplyRs.getTripCause() + "',to_date('" + startDate + "','yyyy-MM-dd HH24:mi:ss'),to_date('" + endDate + "','yyyy-MM-dd HH24:mi:ss')," + openApplyRs.getTripDay() + ","+rsId+",'"+statusDesc+"','"+projectCode+"','"+projectTitle+"','"+depCity+"','"+arrCity+"')");
|
|
|
+ String statusDesc = openApplyRs.getStatusDesc()==null?"空":openApplyRs.getStatusDesc();
|
|
|
+ if (statusDesc.contains("已同意")){
|
|
|
+ List<OapiAlitripBtripApplySearchResponse.OpenItineraryInfo> itineraryList = openApplyRs.getItineraryList();
|
|
|
+ for (OapiAlitripBtripApplySearchResponse.OpenItineraryInfo openItineraryInfo:itineraryList) {
|
|
|
+ String startDate = DateUtil.format(openItineraryInfo.getDepDate(),"yyyy-MM-dd HH:mm:ss");
|
|
|
+ String endDate = DateUtil.format(openItineraryInfo.getArrDate(),"yyyy-MM-dd HH:mm:ss");
|
|
|
+ String projectTitle = openItineraryInfo.getProjectTitle();
|
|
|
+ String projectCode = openItineraryInfo.getProjectCode();
|
|
|
+ String arrCity = openItineraryInfo.getArrCity();
|
|
|
+ String depCity = openItineraryInfo.getDepCity();
|
|
|
+ String itineraryId = openItineraryInfo.getItineraryId();
|
|
|
+ String ddid=rsId.toString()+"-"+itineraryId;
|
|
|
+ int count =queryForObject("select count(1) from FeePlease where fp_dingid='"+ddid+"'", Integer.class);
|
|
|
+ if (count<=0) {
|
|
|
+ int id = generateId("FEEPLEASE_SEQ");
|
|
|
+ String code = generateCode("FeePlease!CCSQ!new", 2);
|
|
|
+ jdbcTemplate.execute("insert into FeePlease (fp_id,fp_code,fp_kind,fp_v9,FP_PEOPLE2,fp_recordman,fp_recorddate,fp_statuscode,fp_status,fp_v3,fp_prestartdate,fp_preenddate,fp_n6,fp_dingid,fp_remark,fp_prjcode,fp_prjname,fp_depcity,fp_arrcity) " +
|
|
|
+ "values (" + id + ",'" + code + "','出差申请单','" + openApplyRs.getDeptName() + "','" + openApplyRs.getUserName() + "','" + openApplyRs.getUserName() + "',to_date('" + inDate + "','yyyy-MM-dd HH24:mi:ss'),'AUDITED','已审核','" + openApplyRs.getTripCause() + "',to_date('" + startDate + "','yyyy-MM-dd HH24:mi:ss'),to_date('" + endDate + "','yyyy-MM-dd HH24:mi:ss')," + openApplyRs.getTripDay() + ","+rsId+",'"+statusDesc+"','"+projectCode+"','"+projectTitle+"','"+depCity+"','"+arrCity+"')");
|
|
|
|
|
|
"values(FeePleaseDetail_seq.nextval,"+id+",'"+code+"','出差申请单',1,'"+projectCode+"','"+projectTitle+"',to_date('" + startDate + "','yyyy-MM-dd HH24:mi:ss'),to_date('" + endDate + "','yyyy-MM-dd HH24:mi:ss'))");*/
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|