调整
This commit is contained in:
@@ -49,6 +49,7 @@ public class LeaseBillController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ILeaseBillDao leaseBillDao;
|
private ILeaseBillDao leaseBillDao;
|
||||||
|
|
||||||
public void setLeaseBillDao(ILeaseBillDao leaseBillDao) {
|
public void setLeaseBillDao(ILeaseBillDao leaseBillDao) {
|
||||||
this.leaseBillDao = leaseBillDao;
|
this.leaseBillDao = leaseBillDao;
|
||||||
}
|
}
|
||||||
@@ -60,138 +61,216 @@ public class LeaseBillController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
log.info("进入生成账单ajax方法");
|
System.out.println("进入生成账单ajax方法");
|
||||||
|
|
||||||
ConfigVo configVo = getYdctLeaseBillConfig();
|
ConfigVo configVo = getYdctLeaseBillConfig();
|
||||||
DateUtil dateUtil = new DateUtil();
|
DateUtil dateUtil = new DateUtil();
|
||||||
LeaseBillUtil leaseBillUtil = new LeaseBillUtil();
|
LeaseBillUtil leaseBillUtil = new LeaseBillUtil();
|
||||||
FormExportUtil formExportUtil = new FormExportUtil();
|
FormExportUtil formExportUtil = new FormExportUtil();
|
||||||
// 设置返回值对象
|
|
||||||
Map<String, Object> res = new HashMap<>();
|
Map<String, Object> res = new HashMap<>();
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmsssss");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmsssss");
|
||||||
|
|
||||||
request.setCharacterEncoding("UTF-8");
|
request.setCharacterEncoding("UTF-8");
|
||||||
response.setCharacterEncoding("UTF-8");
|
response.setCharacterEncoding("UTF-8");
|
||||||
|
|
||||||
BufferedReader reader = request.getReader();
|
// 读取请求体
|
||||||
String line;
|
String requestBody = getRequestBody(request);
|
||||||
StringBuilder requestBody = new StringBuilder();
|
if (requestBody == null || requestBody.isEmpty()) {
|
||||||
while((line = reader.readLine())!=null){
|
System.out.println("【错误】请求体为空,直接返回默认结果");
|
||||||
requestBody.append(line);
|
render(response, JSONObject.toJSONString(res));
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
String data = requestBody.toString();
|
|
||||||
String decodedParam = URLDecoder.decode(data, "UTF-8");
|
// 解析参数
|
||||||
String[] datas = decodedParam.split("&");
|
JSONObject jsonObject = parseRequestParams(requestBody);
|
||||||
JSONObject jsonObject = new JSONObject();
|
if (jsonObject == null || jsonObject.isEmpty()) {
|
||||||
for(int i = 0 ; i < datas.length ; i ++ ){
|
System.out.println("【错误】解析后请求参数为空,返回默认结果");
|
||||||
String[] params = datas[i].split("=");
|
render(response, JSONObject.toJSONString(res));
|
||||||
if(params.length>1){
|
return null;
|
||||||
jsonObject.put(params[0],params[1]);
|
|
||||||
}else{
|
|
||||||
if(params[0].equals("bdid")){
|
|
||||||
jsonObject.put("bdid","0");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
System.out.println("入参: " + jsonObject.toString());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// 账单编号
|
||||||
String bdidValue = jsonObject.getString("bdid");
|
String bdidValue = jsonObject.getString("bdid");
|
||||||
log.info("当前账单编号为:"+bdidValue);
|
if (bdidValue == null || bdidValue.trim().isEmpty()) {
|
||||||
if("0".equals(bdidValue)){
|
bdidValue = "0";
|
||||||
Date formDate = new Date();
|
}
|
||||||
String formId = simpleDateFormat.format(formDate);
|
System.out.println("当前账单编号为:" + bdidValue);
|
||||||
// 账单编号
|
|
||||||
bdidValue = formId;
|
String code;
|
||||||
// formDataVo.getNewFieldDataMap().put("账单编号", formId);
|
if ("0".equals(bdidValue)) {
|
||||||
}else {
|
code = simpleDateFormat.format(new Date());
|
||||||
|
System.out.println("自动生成新账单编号:" + code);
|
||||||
|
} else {
|
||||||
|
code = bdidValue;
|
||||||
List<String> ids = leaseBillDao.leaseBillByCode(bdidValue);
|
List<String> ids = leaseBillDao.leaseBillByCode(bdidValue);
|
||||||
for (int i = 0; i < ids.size(); i++) {
|
if (ids == null || ids.isEmpty()) {
|
||||||
// 删除明细账单
|
System.out.println("根据账单编号[" + bdidValue + "]未查询到需要删除的旧数据");
|
||||||
leaseBillDao.deleteBillsByBillId(ids.get(i));
|
} else {
|
||||||
// 删除主表数据
|
for (String id : ids) {
|
||||||
leaseBillDao.deleteBillById(ids.get(i));
|
leaseBillDao.deleteBillsByBillId(id);
|
||||||
|
leaseBillDao.deleteBillById(id);
|
||||||
|
}
|
||||||
|
System.out.println("账单编号[" + bdidValue + "]旧数据删除完成");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String code = bdidValue;
|
|
||||||
// 开始日期
|
// 日期
|
||||||
String startDateStr = jsonObject.getString("startDate");
|
String startDateStr = jsonObject.getString("startDate");
|
||||||
Date startDate = sdf.parse(startDateStr);
|
|
||||||
// 结束日期
|
|
||||||
String endDateStr = jsonObject.getString("endDate");
|
String endDateStr = jsonObject.getString("endDate");
|
||||||
|
if (startDateStr == null || startDateStr.isEmpty() || endDateStr == null || endDateStr.isEmpty()) {
|
||||||
|
System.out.println("【错误】开始日期或结束日期为空,生成账单失败");
|
||||||
|
res.put("success", false);
|
||||||
|
res.put("s", "开始日期/结束日期不能为空");
|
||||||
|
render(response, JSONObject.toJSONString(res));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Date startDate = sdf.parse(startDateStr);
|
||||||
Date endDate = sdf.parse(endDateStr);
|
Date endDate = sdf.parse(endDateStr);
|
||||||
// 设置面积
|
|
||||||
|
// 计费面积
|
||||||
String jifeifs = jsonObject.getString("jifeifs");
|
String jifeifs = jsonObject.getString("jifeifs");
|
||||||
// 设置合同开始日期
|
if (jifeifs == null || jifeifs.isEmpty()) {
|
||||||
|
System.out.println("【错误】计费面积为空,生成账单失败");
|
||||||
|
res.put("success", false);
|
||||||
|
res.put("s", "计费面积不能为空");
|
||||||
|
render(response, JSONObject.toJSONString(res));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 日期处理
|
||||||
Calendar startTime = Calendar.getInstance();
|
Calendar startTime = Calendar.getInstance();
|
||||||
startTime.setTime(startDate);
|
startTime.setTime(startDate);
|
||||||
// 判断合同开始时间是否为月底
|
boolean isMaxDay = startTime.get(Calendar.DAY_OF_MONTH) == startTime.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||||
log.info("入参: " + jsonObject.toString());
|
|
||||||
boolean isMaxDay = false;
|
|
||||||
int currentDay = startTime.get(Calendar.DAY_OF_MONTH);
|
|
||||||
int maxDay = startTime.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
||||||
if(currentDay==maxDay){
|
|
||||||
isMaxDay = true;
|
|
||||||
}
|
|
||||||
// 设置合同结束日期
|
|
||||||
Calendar endTime = Calendar.getInstance();
|
Calendar endTime = Calendar.getInstance();
|
||||||
endTime.setTime(endDate);
|
endTime.setTime(endDate);
|
||||||
endTime.add(Calendar.DAY_OF_MONTH, 1);
|
endTime.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
|
||||||
// 根据缴费方式设置开始结束时间
|
// 缴费方式
|
||||||
String jiaofeifs = jsonObject.getString("jiaofeifs");
|
String jiaofeifs = jsonObject.getString("jiaofeifs");
|
||||||
int jfzqNum = dateUtil.getCycleNum(jiaofeifs);
|
int jfzqNum = dateUtil.getCycleNum(jiaofeifs);
|
||||||
|
|
||||||
FormExport formExport = new FormExport();
|
List<Map<String, String>> rents = new ArrayList<>();
|
||||||
// 租金
|
if (jfzqNum == 12) {
|
||||||
List<Map<String,String>> rents = new ArrayList<Map<String,String>>();
|
|
||||||
if(jfzqNum==12){
|
|
||||||
String njiaofeifs = jsonObject.getString("njiaofeifs");
|
String njiaofeifs = jsonObject.getString("njiaofeifs");
|
||||||
if(StringUtil.isEmpty(njiaofeifs)){
|
if (StringUtil.isEmpty(njiaofeifs)) {
|
||||||
|
System.out.println("【错误】年缴费计算方式未选择,终止生成");
|
||||||
res.put("success", true);
|
res.put("success", true);
|
||||||
res.put("name", AppContext.currentUserLoginName());
|
res.put("name", AppContext.currentUserLoginName());
|
||||||
res.put("s", "请选择年缴费计算方式");
|
res.put("s", "请选择年缴费计算方式");
|
||||||
res.put("num", "");
|
res.put("num", "");
|
||||||
render(response, JSONUtil.toJSONString(res));
|
render(response, JSONObject.toJSONString(res));
|
||||||
return null;
|
return null;
|
||||||
}else{
|
|
||||||
if(njiaofeifs.equals(configProvider.getBizConfigByKey(LeaseBillConstant.annualPaymentTypeOneMapName))){
|
|
||||||
// 采用方式一/正常年度
|
|
||||||
System.out.println("开始生成账单数据");
|
|
||||||
log.info("正常年度-生成账单数据");
|
|
||||||
rents = leaseBillUtil.getLeaseBillYers1(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs);
|
|
||||||
}else if(njiaofeifs.equals(configProvider.getBizConfigByKey(LeaseBillConstant.annualPaymentTypeTwoMapName))){
|
|
||||||
// 采用方式二/非正常年度
|
|
||||||
System.out.println("开始生成账单数据");
|
|
||||||
log.info("非正常年度-生成账单数据");
|
|
||||||
rents = leaseBillUtil.getLeaseBillYers2(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
// 根据标准方法生成
|
String type1 = configProvider.getBizConfigByKey(LeaseBillConstant.annualPaymentTypeOneMapName);
|
||||||
System.out.println("开始生成账单数据");
|
String type2 = configProvider.getBizConfigByKey(LeaseBillConstant.annualPaymentTypeTwoMapName);
|
||||||
log.info("开始用标准方法生成账单数据");
|
if (njiaofeifs.equals(type1)) {
|
||||||
rents = leaseBillUtil.getLeaseBill(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs);
|
System.out.println("正常年度-生成账单数据");
|
||||||
|
rents = leaseBillUtil.getLeaseBillYers1(startTime, endTime, isMaxDay, jfzqNum, jsonObject, jifeifs);
|
||||||
|
} else if (njiaofeifs.equals(type2)) {
|
||||||
|
System.out.println("非正常年度-生成账单数据");
|
||||||
|
rents = leaseBillUtil.getLeaseBillYers2(startTime, endTime, isMaxDay, jfzqNum, jsonObject, jifeifs);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
System.out.println("标准方式生成账单数据");
|
||||||
|
rents = leaseBillUtil.getLeaseBill(startTime, endTime, isMaxDay, jfzqNum, jsonObject, jifeifs);
|
||||||
}
|
}
|
||||||
if(rents.size() == 0){
|
|
||||||
log.info("要生成账单的数据为空");
|
// 租金为空判断
|
||||||
|
if (rents == null || rents.isEmpty()) {
|
||||||
|
System.out.println("【错误】生成账单数据为空,无法继续导入");
|
||||||
|
res.put("success", false);
|
||||||
|
res.put("s", "生成账单明细为空");
|
||||||
|
render(response, JSONObject.toJSONString(res));
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
log.info("创建档案");
|
|
||||||
List<SubordinateFormExport> subordinateFormExports = formExportUtil.setSubordinateFormValue(rents);
|
// 创建档案
|
||||||
Map<String , String > billMap = new HashMap<String, String>();
|
System.out.println("开始创建档案,账单编号:" + code);
|
||||||
|
List<SubordinateFormExport> subordinateList = formExportUtil.setSubordinateFormValue(rents);
|
||||||
|
|
||||||
|
Map<String, String> billMap = new HashMap<>();
|
||||||
billMap.put("账单编号", code);
|
billMap.put("账单编号", code);
|
||||||
List<ValueExport> valueExports = formExportUtil.setFormValue(billMap);
|
List<ValueExport> valueExports = formExportUtil.setFormValue(billMap);
|
||||||
formExport.setSubordinateForms(subordinateFormExports);
|
|
||||||
|
FormExport formExport = new FormExport();
|
||||||
|
formExport.setSubordinateForms(subordinateList);
|
||||||
formExport.setValues(valueExports);
|
formExport.setValues(valueExports);
|
||||||
|
|
||||||
String loginName = configProvider.getBizConfigByKey(LeaseBillConstant.loginName);
|
String loginName = configProvider.getBizConfigByKey(LeaseBillConstant.loginName);
|
||||||
getFormFactory().importBusinessFormData(loginName, configProvider.getBizConfigByKey(LeaseBillConstant.assistiveFormNo),
|
String formNo = configProvider.getBizConfigByKey(LeaseBillConstant.assistiveFormNo);
|
||||||
formExport, new String[] {});
|
|
||||||
|
getFormFactory().importBusinessFormData(loginName, formNo, formExport, new String[]{});
|
||||||
|
System.out.println("账单[" + code + "]导入表单数据成功");
|
||||||
|
|
||||||
|
// 成功返回
|
||||||
res.put("success", true);
|
res.put("success", true);
|
||||||
res.put("name", AppContext.currentUserLoginName());
|
res.put("name", AppContext.currentUserLoginName());
|
||||||
res.put("s", "");
|
res.put("s", "");
|
||||||
res.put("num", code);
|
res.put("num", code);
|
||||||
}catch (Exception e){
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("【异常】生成账单发生异常:" + e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
res.put("success", false);
|
||||||
|
res.put("s", "系统异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 最终 res 为空判断
|
||||||
|
if (res == null || res.isEmpty()) {
|
||||||
|
System.out.println("【严重】最终返回结果 res 为空,返回空JSON");
|
||||||
|
render(response, "{}");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("生成账单完成,返回结果:" + res);
|
||||||
|
render(response, JSONObject.toJSONString(res));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 读取请求体
|
||||||
|
private String getRequestBody(HttpServletRequest request) {
|
||||||
|
BufferedReader reader = null;
|
||||||
|
try {
|
||||||
|
reader = request.getReader();
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String line;
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
sb.append(line);
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("【错误】读取请求体异常");
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析请求参数
|
||||||
|
private JSONObject parseRequestParams(String requestBody) {
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
try {
|
||||||
|
String decoded = URLDecoder.decode(requestBody, "UTF-8");
|
||||||
|
String[] paramsArray = decoded.split("&");
|
||||||
|
for (String param : paramsArray) {
|
||||||
|
String[] kv = param.split("=", 2);
|
||||||
|
if (kv.length == 2) {
|
||||||
|
json.put(kv[0], kv[1]);
|
||||||
|
} else if ("bdid".equals(kv[0])) {
|
||||||
|
json.put("bdid", "0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("【错误】解析请求参数异常");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
render(response, JSONUtil.toJSONString(res));
|
return json;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class LeaseBillDaoImpl implements ILeaseBillDao {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int deleteBillsByBillId(String formmainId) throws BusinessException, SQLException {
|
public int deleteBillsByBillId(String formmainId) throws BusinessException, SQLException {
|
||||||
TableContext sub = FormTableExecutor.sub(getFormNo(), "明细表1");
|
TableContext sub = FormTableExecutor.sub(getFormNo(), "账单明细");
|
||||||
List<FormWhereCondition> conditions = new ArrayList<>();
|
List<FormWhereCondition> conditions = new ArrayList<>();
|
||||||
conditions.add(FormWhereCondition.build().display("formmain_id").value(formmainId));
|
conditions.add(FormWhereCondition.build().display("formmain_id").value(formmainId));
|
||||||
return FormTableExecutor.delete(sub,conditions);
|
return FormTableExecutor.delete(sub,conditions);
|
||||||
|
|||||||
@@ -44,10 +44,10 @@ public class LeaseBillUtil {
|
|||||||
// zf = gdzj*zlmjFloat*monthNum;
|
// zf = gdzj*zlmjFloat*monthNum;
|
||||||
zf = gdzj*zlmjFloat;
|
zf = gdzj*zlmjFloat;
|
||||||
}
|
}
|
||||||
rent.put("开始日期",sdf.format(startTime.getTime()));
|
rent.put("明细-开始日期",sdf.format(startTime.getTime()));
|
||||||
endTime.add(Calendar.DATE, -1);
|
endTime.add(Calendar.DATE, -1);
|
||||||
rent.put("结束日期",sdf.format(endTime.getTime()));
|
rent.put("明细-结束日期",sdf.format(endTime.getTime()));
|
||||||
rent.put("租费",zf+"");
|
rent.put("明细-租费",zf+"");
|
||||||
rents.add(rent);
|
rents.add(rent);
|
||||||
}else{
|
}else{
|
||||||
// 月,季,半年,账单生成
|
// 月,季,半年,账单生成
|
||||||
@@ -74,7 +74,7 @@ public class LeaseBillUtil {
|
|||||||
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
||||||
Map<String, String> rentMap = new HashMap<String, String>();
|
Map<String, String> rentMap = new HashMap<String, String>();
|
||||||
// 设置租费时间
|
// 设置租费时间
|
||||||
rentMap.put("开始日期", sdf.format(startTime.getTime()));
|
rentMap.put("明细-开始日期", sdf.format(startTime.getTime()));
|
||||||
if (!isMaxDay) {
|
if (!isMaxDay) {
|
||||||
startTime.add(Calendar.MONTH, jfzqNum);
|
startTime.add(Calendar.MONTH, jfzqNum);
|
||||||
startTime.add(Calendar.DAY_OF_MONTH, -1);
|
startTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
@@ -88,9 +88,9 @@ public class LeaseBillUtil {
|
|||||||
if("面积计费".equals(jifeifs)){
|
if("面积计费".equals(jifeifs)){
|
||||||
rentMap.put("租费", (zf * jfzqNum) + "");
|
rentMap.put("租费", (zf * jfzqNum) + "");
|
||||||
}else if ("固定租金".equals(jifeifs)){
|
}else if ("固定租金".equals(jifeifs)){
|
||||||
rentMap.put("租费", (zf * 1) + "");
|
rentMap.put("明细-租费", (zf * 1) + "");
|
||||||
}
|
}
|
||||||
rentMap.put("结束日期", sdf.format(startTime.getTime()));
|
rentMap.put("明细-结束日期", sdf.format(startTime.getTime()));
|
||||||
} else {
|
} else {
|
||||||
//两个日期相差多少月
|
//两个日期相差多少月
|
||||||
startTime.add(Calendar.MONTH, jfzqNum*-1);
|
startTime.add(Calendar.MONTH, jfzqNum*-1);
|
||||||
@@ -98,13 +98,13 @@ public class LeaseBillUtil {
|
|||||||
int qijianyueshu = dateUtil.betweenMonthByTwoCalendar(startTime, endTime);
|
int qijianyueshu = dateUtil.betweenMonthByTwoCalendar(startTime, endTime);
|
||||||
// rentMap.put("期间月数-租金",qijianyueshu+"");
|
// rentMap.put("期间月数-租金",qijianyueshu+"");
|
||||||
if("面积计费".equals(jifeifs)){
|
if("面积计费".equals(jifeifs)){
|
||||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
rentMap.put("明细-租费", (zf * qijianyueshu) + "");
|
||||||
}else if ("固定租金".equals(jifeifs)){
|
}else if ("明细-固定租金".equals(jifeifs)){
|
||||||
rentMap.put("租费", (zf * 1) + "");
|
rentMap.put("明细-租费", (zf * 1) + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
rentMap.put("结束日期", sdf.format(endTime.getTime()));
|
rentMap.put("明细-结束日期", sdf.format(endTime.getTime()));
|
||||||
}
|
}
|
||||||
startTime.add(Calendar.DAY_OF_MONTH, 1);
|
startTime.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
if (isMaxDay) {
|
if (isMaxDay) {
|
||||||
@@ -158,18 +158,18 @@ public class LeaseBillUtil {
|
|||||||
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
||||||
Map<String, String> rentMap = new HashMap<String, String>();
|
Map<String, String> rentMap = new HashMap<String, String>();
|
||||||
// 设置租费时间
|
// 设置租费时间
|
||||||
rentMap.put("开始日期", sdf.format(startTime.getTime()));
|
rentMap.put("明细-开始日期", sdf.format(startTime.getTime()));
|
||||||
startTime.add(Calendar.MONTH, jfzqNum);
|
startTime.add(Calendar.MONTH, jfzqNum);
|
||||||
startTime.add(Calendar.DAY_OF_MONTH, -1);
|
startTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
||||||
// rentMap.put("期间月数-租金",jfzqNum+"");
|
// rentMap.put("期间月数-租金",jfzqNum+"");
|
||||||
// rentMap.put("租费", (zf * jfzqNum) + "");
|
// rentMap.put("租费", (zf * jfzqNum) + "");
|
||||||
if("固定租金".equals(jifeifs)){
|
if("固定租金".equals(jifeifs)){
|
||||||
rentMap.put("租费", (zf * 1) + "");
|
rentMap.put("明细-租费", (zf * 1) + "");
|
||||||
}else{
|
}else{
|
||||||
rentMap.put("租费", (zf * jfzqNum) + "");
|
rentMap.put("明细-租费", (zf * jfzqNum) + "");
|
||||||
}
|
}
|
||||||
rentMap.put("结束日期", sdf.format(startTime.getTime()));
|
rentMap.put("明细-结束日期", sdf.format(startTime.getTime()));
|
||||||
} else {
|
} else {
|
||||||
//两个日期相差多少月
|
//两个日期相差多少月
|
||||||
startTime.add(Calendar.MONTH, jfzqNum*-1);
|
startTime.add(Calendar.MONTH, jfzqNum*-1);
|
||||||
@@ -178,12 +178,12 @@ public class LeaseBillUtil {
|
|||||||
// rentMap.put("期间月数-租金",qijianyueshu+"");
|
// rentMap.put("期间月数-租金",qijianyueshu+"");
|
||||||
// rentMap.put("租费", (zf * qijianyueshu) + "");
|
// rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||||
if("固定租金".equals(jifeifs)){
|
if("固定租金".equals(jifeifs)){
|
||||||
rentMap.put("租费", (zf * 1) + "");
|
rentMap.put("明细-租费", (zf * 1) + "");
|
||||||
}else{
|
}else{
|
||||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
rentMap.put("明细-租费", (zf * qijianyueshu) + "");
|
||||||
}
|
}
|
||||||
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
rentMap.put("结束日期", sdf.format(endTime.getTime()));
|
rentMap.put("明细-结束日期", sdf.format(endTime.getTime()));
|
||||||
}
|
}
|
||||||
startTime.add(Calendar.DAY_OF_MONTH, 1);
|
startTime.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
if (isMaxDay) {
|
if (isMaxDay) {
|
||||||
@@ -246,11 +246,11 @@ public class LeaseBillUtil {
|
|||||||
startTime.add(Calendar.DAY_OF_MONTH, -1);
|
startTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
// rentMap.put("租费", (zf * qijianyueshu) + "");
|
// rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||||
if ("固定租金".equals(jifeifs)){
|
if ("固定租金".equals(jifeifs)){
|
||||||
rentMap.put("租费", (zf * 1) + "");
|
rentMap.put("明细-租费", (zf * 1) + "");
|
||||||
}else{
|
}else{
|
||||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
rentMap.put("明细-租费", (zf * qijianyueshu) + "");
|
||||||
}
|
}
|
||||||
rentMap.put("结束日期", sdf.format(startTime.getTime()));
|
rentMap.put("明细-结束日期", sdf.format(startTime.getTime()));
|
||||||
calendar.set(Calendar.MONTH, 11);
|
calendar.set(Calendar.MONTH, 11);
|
||||||
calendar.set(Calendar.DATE, 31);
|
calendar.set(Calendar.DATE, 31);
|
||||||
} else {
|
} else {
|
||||||
@@ -259,12 +259,12 @@ public class LeaseBillUtil {
|
|||||||
// rentMap.put("期间月数-租金",qijianyueshu+"");
|
// rentMap.put("期间月数-租金",qijianyueshu+"");
|
||||||
// rentMap.put("租费", (zf * qijianyueshu) + "");
|
// rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||||
if ("固定租金".equals(jifeifs)){
|
if ("固定租金".equals(jifeifs)){
|
||||||
rentMap.put("租费", (zf * 1) + "");
|
rentMap.put("明细-租费", (zf * 1) + "");
|
||||||
}else{
|
}else{
|
||||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
rentMap.put("明细-租费", (zf * qijianyueshu) + "");
|
||||||
}
|
}
|
||||||
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
rentMap.put("结束日期", sdf.format(endTime.getTime()));
|
rentMap.put("明细-结束日期", sdf.format(endTime.getTime()));
|
||||||
}
|
}
|
||||||
startTime.add(Calendar.DAY_OF_MONTH, 1);
|
startTime.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
|||||||
@@ -81,19 +81,19 @@
|
|||||||
if(targetObj[key].display === "年缴费方案选项") {
|
if(targetObj[key].display === "年缴费方案选项") {
|
||||||
njiaofeifs = targetObj[key].showValue
|
njiaofeifs = targetObj[key].showValue
|
||||||
}
|
}
|
||||||
if(targetObj[key].display === "实租单价") {
|
if(targetObj[key].display === "租赁单价") {
|
||||||
mjzj = targetObj[key].showValue
|
mjzj = targetObj[key].showValue
|
||||||
}
|
}
|
||||||
if(targetObj[key].display === "固定租金标准") {
|
if(targetObj[key].display === "固定租金标准") {
|
||||||
gdzj = targetObj[key].showValue
|
gdzj = targetObj[key].showValue
|
||||||
}
|
}
|
||||||
if(targetObj[key].display === "计租开始日期") {
|
if(targetObj[key].display === "计租日期") {
|
||||||
startDate = targetObj[key].showValue
|
startDate = targetObj[key].showValue
|
||||||
}
|
}
|
||||||
if(targetObj[key].display === "合同截止日期") {
|
if(targetObj[key].display === "合同截止日期") {
|
||||||
endDate = targetObj[key].showValue
|
endDate = targetObj[key].showValue
|
||||||
}
|
}
|
||||||
if(targetObj[key].display === "租赁总面积") {
|
if(targetObj[key].display === "租赁面积") {
|
||||||
mj = targetObj[key].showValue
|
mj = targetObj[key].showValue
|
||||||
}
|
}
|
||||||
if(targetObj[key].display === "账单编号") {
|
if(targetObj[key].display === "账单编号") {
|
||||||
|
|||||||
Reference in New Issue
Block a user