投资支付

This commit is contained in:
pengjie 2023-07-10 09:22:10 +08:00
parent a8cdaf146c
commit 5e09c64e23
17 changed files with 59 additions and 22 deletions

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.config;
import com.fasterxml.jackson.databind.ser.std.NumberSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
@ -20,6 +21,6 @@ public class JacksonConfig {
return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder
.serializerByType(Long.class, ToStringSerializer.instance)
.serializerByType(Long.TYPE, ToStringSerializer.instance)
.serializerByType(BigDecimal.class, ToStringSerializer.instance);
.serializerByType(BigDecimal.class, NumberSerializer.instance);
}
}

View File

@ -91,8 +91,7 @@ public class GovInvestmentPaymentController {
@ApiOperation(value = " 添加投资支付信息", notes = "添加投资支付信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<Object> add(@RequestBody InvestmentPaymentVo investmentPaymentVo) {
investmentPaymentService.saveInfo(investmentPaymentVo);
return Result.success("添加成功!");
return Result.success(investmentPaymentService.saveInfo(investmentPaymentVo));
}
/**

View File

@ -69,6 +69,9 @@ public class GovInvestmentPaymentItemController {
@ApiOperation(value = " 列表查询投资支付子项信息", notes = "列表查询投资支付子项信息", httpMethod = "POST")
@PostMapping(value = "/list")
public Result<List<InvestmentPaymentItem>> queryList(@RequestBody InvestmentPaymentItem investmentPaymentItem) {
if (null == investmentPaymentItem.getInvestmentApplyId()) {
return Result.success(null);
}
QueryWrapper<InvestmentPaymentItem> queryWrapper = QueryGenerator.initQueryWrapper(investmentPaymentItem);
List<InvestmentPaymentItem> list = investmentPaymentItemService.list(queryWrapper);
return Result.success(list);

View File

@ -11,6 +11,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -46,6 +47,10 @@ public class GovInvestmentPaymentStatController {
@ApiImplicitParam(name = "investmentApplyId", value = "投资支付申报ID", paramType = "body", required = true, dataType = "String")
@PostMapping(value = "/queryByApplyId")
public Result<InvestmentPaymentStat> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
String investmentApplyId = MapUtils.getString(map, "investmentApplyId");
if (StringUtils.isBlank(investmentApplyId)) {
return Result.success(null);
}
QueryWrapper<InvestmentPaymentStat> queryWrapper = QueryGenerator.initPageQueryWrapper(InvestmentPaymentStat.class, map);
return Result.success(investmentPaymentStatService.getOne(queryWrapper));
}

View File

@ -70,6 +70,9 @@ public class InvestmentPaymentItemController {
@ApiOperation(value = " 列表查询投资支付子项信息", notes = "列表查询投资支付子项信息", httpMethod = "POST")
@PostMapping(value = "/list")
public Result<List<InvestmentPaymentItem>> queryList(@RequestBody InvestmentPaymentItem investmentPaymentItem) {
if (null == investmentPaymentItem.getInvestmentApplyId()) {
return Result.success(null);
}
QueryWrapper<InvestmentPaymentItem> queryWrapper = QueryGenerator.initQueryWrapper(investmentPaymentItem);
List<InvestmentPaymentItem> list = investmentPaymentItemService.list(queryWrapper);
return Result.success(list);

View File

@ -12,6 +12,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -47,6 +48,10 @@ public class InvestmentPaymentStatController {
@ApiImplicitParam(name = "investmentApplyId", value = "投资支付申报ID", paramType = "body", required = true, dataType = "String")
@PostMapping(value = "/queryByApplyId")
public Result<InvestmentPaymentStat> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
String investmentApplyId = MapUtils.getString(map, "investmentApplyId");
if (StringUtils.isBlank(investmentApplyId)) {
return Result.success(null);
}
QueryWrapper<InvestmentPaymentStat> queryWrapper = QueryGenerator.initPageQueryWrapper(InvestmentPaymentStat.class, map);
return Result.success(investmentPaymentStatService.getOne(queryWrapper));
}

View File

@ -34,7 +34,7 @@ public class InvestmentPaymentStat implements Serializable {
*/
@Excel(name = "投资支付申报ID", width = 15)
@ApiModelProperty(value = "投资支付申报ID")
private Integer investmentApplyId;
private Long investmentApplyId;
/**
* 含税造价
*/

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.safety.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.annotation.DataScope;
import com.zhgd.xmgl.modules.safety.entity.InvestmentContract;
import org.apache.ibatis.annotations.Mapper;
@ -11,6 +12,7 @@ import org.apache.ibatis.annotations.Mapper;
* @version V1.0
*/
@Mapper
@DataScope
public interface InvestmentContractMapper extends BaseMapper<InvestmentContract> {
}

View File

@ -1,11 +1,9 @@
package com.zhgd.xmgl.modules.safety.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.zhgd.xmgl.modules.safety.entity.InvestmentPaymentItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.annotation.DataScope;
import com.zhgd.xmgl.modules.safety.entity.InvestmentPaymentItem;
import org.apache.ibatis.annotations.Mapper;
/**
* @Description: 投资支付子项
@ -14,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @version V1.0
*/
@Mapper
@DataScope
public interface InvestmentPaymentItemMapper extends BaseMapper<InvestmentPaymentItem> {
}

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.safety.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.annotation.DataScope;
import com.zhgd.xmgl.modules.safety.entity.InvestmentPaymentStat;
import org.apache.ibatis.annotations.Mapper;
@ -11,6 +12,7 @@ import org.apache.ibatis.annotations.Mapper;
* @version V1.0
*/
@Mapper
@DataScope
public interface InvestmentPaymentStatMapper extends BaseMapper<InvestmentPaymentStat> {
}

View File

@ -12,7 +12,7 @@ import com.zhgd.xmgl.modules.safety.vo.InvestmentPaymentVo;
*/
public interface IInvestmentPaymentService extends IService<InvestmentPayment> {
boolean saveInfo(InvestmentPaymentVo investmentPaymentVo);
Long saveInfo(InvestmentPaymentVo investmentPaymentVo);
boolean updateInfo(InvestmentPaymentVo investmentPaymentVo);
}

View File

@ -48,10 +48,14 @@ public class InvestmentApplyServiceImpl extends ServiceImpl<InvestmentApplyMappe
@Override
public Page<InvestmentApply> pageList(Map<String, Object> map) {
String name = MapUtils.getString(map, "name");
String projectSn = MapUtils.getString(map, "projectSn");
QueryWrapper<InvestmentApply> wrapper = Wrappers.<InvestmentApply>query();
if (StringUtils.isNotBlank(name)) {
wrapper.like("a.name", name);
}
if (StringUtils.isNotBlank(projectSn)) {
wrapper.eq("a.project_sn", projectSn);
}
Page<InvestmentApply> page = PageUtil.getPage(map);
return baseMapper.pageList(page, wrapper);
}

View File

@ -35,21 +35,27 @@ public class InvestmentPaymentServiceImpl extends ServiceImpl<InvestmentPaymentM
private IInvestmentApplyService investmentApplyService;
@Override
public boolean saveInfo(InvestmentPaymentVo investmentPaymentVo) {
public Long saveInfo(InvestmentPaymentVo investmentPaymentVo) {
if (StringUtils.isNotBlank(investmentPaymentVo.getEngineeringSn())) {
String projectSn = engineeringService.getOne(Wrappers.<Engineering>lambdaQuery().eq(Engineering::getEngineeringSn, investmentPaymentVo.getEngineeringSn())).getProjectSn();
investmentPaymentVo.setProjectSn(projectSn);
}
// 调整绑定申报列表信息
build(investmentPaymentVo);
return this.save(investmentPaymentVo);
boolean flag = this.save(investmentPaymentVo);
if (flag) {
// 调整绑定申报列表信息
build(investmentPaymentVo);
}
return investmentPaymentVo.getId();
}
@Override
public boolean updateInfo(InvestmentPaymentVo investmentPaymentVo) {
// 调整绑定申报列表信息
build(investmentPaymentVo);
return this.updateById(investmentPaymentVo);
boolean flag = this.updateById(investmentPaymentVo);
if (flag) {
// 调整绑定申报列表信息
build(investmentPaymentVo);
}
return flag;
}
private void build(InvestmentPaymentVo investmentPaymentVo) {

View File

@ -271,7 +271,7 @@ public class ProjectSubItemServiceImpl extends ServiceImpl<ProjectSubItemMapper,
Date actualStartDate = task.getActualStart();
projectSubItem.setRealEndTime(actualStartDate);
// 预计完成时间
// progressTask.setFinishDate(task.getFinish());
projectSubItem.setPlanEndTime(task.getFinish());
// 实际完成时间
Date actualFinishDate = task.getActualFinish();
projectSubItem.setRealEndTime(actualFinishDate);

View File

@ -5,7 +5,7 @@
"groupId" : "1f3d3e5b9fe340bab84de67b0de08f44",
"name" : "投资管理",
"createTime" : null,
"updateTime" : 1688652815858,
"updateTime" : 1688866586913,
"lock" : null,
"createBy" : "admin",
"updateBy" : "admin",
@ -40,6 +40,7 @@ result.put("applyAmountByMonth", applyAmountByMonth)
result.put("realPayAmountByMonth", realPayAmountByMonth)
result.put("unPayAmountByMonth", applyAmountByMonth.subtract(realPayAmountByMonth))
result.put("totalAmount", totalAmount)
result.put("payRatio", realPayAmountTotal == 0 ? 0 : realPayAmountTotal.divide(totalAmount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")).doubleValue())
result.put("paymentTotal", paymentTotal)
result.put("applyAmountTotal", applyAmountTotal)

View File

@ -5,7 +5,7 @@
"groupId" : "de890cb5bb01484ab1feeedd1eb1c1dd",
"name" : "支付管理",
"createTime" : null,
"updateTime" : 1688649593817,
"updateTime" : 1688900331033,
"lock" : null,
"createBy" : null,
"updateBy" : "admin",
@ -31,6 +31,8 @@ BigDecimal applyAmountByYear = db.selectValue("SELECT IFNULL(SUM(s.apply_payment
BigDecimal applyAmountByMonth = db.selectValue("SELECT IFNULL(SUM(s.apply_payment), 0) FROM investment_apply a INNER JOIN investment_payment_stat s ON a.id = s.investment_apply_id WHERE DATE_FORMAT(apply_time, '%Y-%m') = DATE_FORMAT(now(), '%Y-%m') AND #projectalias ")
Map payAmountByYear = db.selectValue("SELECT IFNULL(SUM(pay_amount), 0) FROM investment_payment WHERE DATE_FORMAT(pay_time, '%Y') = DATE_FORMAT(now(), '%Y') AND #project")
Map payAmountByMonth = db.selectValue("SELECT IFNULL(SUM(pay_amount), 0) FROM investment_payment WHERE DATE_FORMAT(pay_time, '%Y-%m') = DATE_FORMAT(now(), '%Y-%m') AND #project")
result.put("payAmount", payAmount)
result.put("totalAmount", totalAmount.subtract(payAmount))
result.put("payRatio", payAmount == 0 ? 0 : payAmount.divide(totalAmount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")).doubleValue())
result.put("applyAmountTotal", applyAmountTotal)
result.put("applyAmountByYear", applyAmountByYear)

View File

@ -5,7 +5,7 @@
"groupId" : "de890cb5bb01484ab1feeedd1eb1c1dd",
"name" : "项目信息",
"createTime" : null,
"updateTime" : 1688263440346,
"updateTime" : 1688896088131,
"lock" : null,
"createBy" : null,
"updateBy" : "admin",
@ -22,4 +22,9 @@
"responseBodyDefinition" : null
}
================================
return db.selectOne("SELECT project_name, project_address, project_manage, project_tel, project_acreage,start_work_date, project_number,project_type,engineering_purpose,structure_type,build_status, datediff(end_work_date, start_work_date) totalDay, longitude, latitude FROM project WHERE #project")
Map result = db.selectOne("SELECT project_name, project_address, project_manage, project_tel, project_acreage,start_work_date, project_number,project_type,engineering_purpose,structure_type,build_status, datediff(end_work_date, start_work_date) totalDay, IF(datediff(end_work_date, now()) >= 0,datediff(end_work_date, now()), 0) residueDay, longitude, latitude FROM project WHERE #project")
var purpose = db.selectValue("SELECT dict_value FROM system_dict_data WHERE dict_type = 'engineering_purpose' AND dict_label = " + result.get("engineering_purpose"))
var style = db.selectValue("SELECT dict_value FROM system_dict_data WHERE dict_type = 'structural_style' AND dict_label = " + result.get("structure_type"))
result.put("engineering_purpose", purpose)
result.put("structure_type", style)
return result;