|
|
@@ -27,7 +27,10 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -228,7 +231,9 @@ public class ERPServiceImpl implements ERPService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public ApiResult<String> saveAccountRegister(AccountRegisterReq accountRegisterReq) {
|
|
|
+ public ApiResult<Map<Object, Object>> saveAccountRegister(AccountRegisterReq accountRegisterReq) {
|
|
|
+
|
|
|
+ Map result = new HashMap();
|
|
|
try {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
logger.info("saveAccountRegister-Begin:master {} ids {}");
|
|
|
@@ -283,6 +288,12 @@ public class ERPServiceImpl implements ERPService {
|
|
|
if (accountRegisterMain.getAccountcode() == null || "".equals(accountRegisterMain.getAccountcode())){
|
|
|
return ApiResponse.failRsp("102",type + " 账户编号为空!");
|
|
|
}
|
|
|
+ // 获取当前日期
|
|
|
+ LocalDate today = LocalDate.now();
|
|
|
+ // 格式化
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-mm-dd");
|
|
|
+ String formattedDate = today.format(formatter);
|
|
|
+ String ar_date = accountRegisterMain.getDate() == null || "".equals(accountRegisterMain.getDate()) ? formattedDate : accountRegisterMain.getDate();
|
|
|
String ar_type = accountRegisterMain.getType() == null ? "" : accountRegisterMain.getType();
|
|
|
String ar_currencytype = accountRegisterMain.getCurrencytype() == null ? "" : accountRegisterMain.getCurrencytype();
|
|
|
String ar_accountcode = accountRegisterMain.getAccountcode() == null ? "" : accountRegisterMain.getAccountcode();
|
|
|
@@ -295,7 +306,7 @@ public class ERPServiceImpl implements ERPService {
|
|
|
//String ar_cateid = accountRegisterMain.getType() == null ? "" : accountRegisterMain.getType();
|
|
|
String Sql="insert into AccountRegister(ar_id,ar_code,ar_date,ar_type,ar_currencytype,ar_accountcode,ar_accountname,ar_accountcurrency,ar_accountrate" +
|
|
|
",ar_payment,ar_departmentcode,ar_departmentname,ar_cateid,ar_emid,ar_recordman,ar_status,ar_statuscode,ar_poststatus,ar_poststatuscode)" +
|
|
|
- "values("+ar_id+",'"+code+"',to_date('"+accountRegisterMain.getDate()+"','yyyy-mm-dd'),'"+ar_type+"','"+ar_currencytype+"','"+ar_accountcode+"'," +
|
|
|
+ "values("+ar_id+",'"+code+"',to_date('"+ar_date+"','yyyy-mm-dd'),'"+ar_type+"','"+ar_currencytype+"','"+ar_accountcode+"'," +
|
|
|
"'"+ar_accountname+"','"+ar_accountcurrency+"',"+accountRegisterMain.getAccountrate()+"," +
|
|
|
accountRegisterMain.getPayment() +",'"+ar_departmentcode+"','"+ar_departmentname+"',"+accountRegisterMain.getCateid() +"," +
|
|
|
"1033922,'管理员','在录入','ENTERING','未过账','UNPOST')";
|
|
|
@@ -391,13 +402,14 @@ public class ERPServiceImpl implements ERPService {
|
|
|
}
|
|
|
}
|
|
|
updateErrorString(ar_id);
|
|
|
+ result.put("code", code);
|
|
|
+ result.put("date", ar_date);
|
|
|
}catch (Exception e){
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("message", e.getMessage());
|
|
|
return ApiResponse.failRsp("101",jsonObject.getString("message"));
|
|
|
}
|
|
|
-
|
|
|
- return ApiResponse.successRsp("0","同步银行登记成功");
|
|
|
+ return ApiResponse.successRsp("0","同步银行登记成功","",result);
|
|
|
}
|
|
|
|
|
|
|