收入合同-工作组列表查询
This commit is contained in:
+62
-45
@@ -73,37 +73,7 @@ public class PayWorkingGroupController extends JeroController<PayWorkingGroup, I
|
||||
if(!Objects.isNull(pageList)){
|
||||
List<PayWorkingGroupVO> listPayWorkingGroupVO = pageList.getRecords();
|
||||
if(!CollectionUtils.isEmpty(listPayWorkingGroupVO)){
|
||||
listPayWorkingGroupVO.forEach(p->{
|
||||
LambdaQueryWrapper<PayWorkingGroupSubItem> query = new LambdaQueryWrapper<>();
|
||||
query.eq(PayWorkingGroupSubItem::getWorkingGroupId,p.getId());
|
||||
List<PayWorkingGroupSubItem> listPayWorkingGroupSubItem = payWorkingGroupSubItemService.list(query);
|
||||
if(!CollectionUtils.isEmpty(listPayWorkingGroupSubItem)){
|
||||
PayWorkingGroupPayment payWorkingGroupPayment = new PayWorkingGroupPayment();
|
||||
// 已付全款
|
||||
List<PayWorkingGroupSubItem> listAllPayment = listPayWorkingGroupSubItem.stream()
|
||||
.filter(p1->(Objects.isNull(p1.getPaidAmount()) ? 0 : p1.getPaidAmount())
|
||||
== (Objects.isNull(p1.getReceivableAmount()) ? 0 : p1.getReceivableAmount())).collect(Collectors.toList());
|
||||
payWorkingGroupPayment.setAllPayment(listAllPayment.size());
|
||||
// 部分付款
|
||||
List<PayWorkingGroupSubItem> listPartPayment = listPayWorkingGroupSubItem.stream()
|
||||
.filter(p1->(Objects.isNull(p1.getPaidAmount()) ? 0 : p1.getPaidAmount())
|
||||
< (Objects.isNull(p1.getReceivableAmount()) ? 0 : p1.getReceivableAmount())).collect(Collectors.toList());
|
||||
payWorkingGroupPayment.setPartPayment(listPartPayment.size());
|
||||
// 未付款
|
||||
List<PayWorkingGroupSubItem> listNotPayment = listPayWorkingGroupSubItem.stream()
|
||||
.filter(p1->(Objects.isNull(p1.getPaidAmount()) ? 0 : p1.getPaidAmount()) == 0
|
||||
&& (Objects.isNull(p1.getReceivableAmount()) ? 0 : p1.getReceivableAmount()) != 0 )
|
||||
.collect(Collectors.toList());
|
||||
payWorkingGroupPayment.setNotPayment(listNotPayment.size());
|
||||
p.setObj(payWorkingGroupPayment);
|
||||
}else{
|
||||
PayWorkingGroupPayment payWorkingGroupPayment = new PayWorkingGroupPayment();
|
||||
payWorkingGroupPayment.setAllPayment(0);
|
||||
payWorkingGroupPayment.setPartPayment(0);
|
||||
payWorkingGroupPayment.setNotPayment(0);
|
||||
p.setObj(payWorkingGroupPayment);
|
||||
}
|
||||
});
|
||||
setPayWorkingGroupSubItem(listPayWorkingGroupVO);
|
||||
pageList.setRecords(listPayWorkingGroupVO);
|
||||
}
|
||||
}
|
||||
@@ -126,23 +96,70 @@ public class PayWorkingGroupController extends JeroController<PayWorkingGroup, I
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成员单位列表查询
|
||||
*
|
||||
* @param companyId 成员id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "工作组项目-根据成员单位列表查询")
|
||||
@ApiOperation(value="工作组项目-根据成员单位列表查询", notes="工作组项目-根据单位列表查询")
|
||||
@GetMapping(value = "/queryListByCompany")
|
||||
public Result<?> queryListByCompany(@RequestParam(name = "companyId") String companyId,
|
||||
@RequestParam(name = "year",required = false) String year) {
|
||||
if(StringUtils.isBlank(companyId)){
|
||||
/**
|
||||
* 根据成员单位列表查询
|
||||
*
|
||||
* @param companyId 企业id
|
||||
* @param workingGroupProject 工作组项目
|
||||
* @param year 运行年份
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "工作组项目-根据成员单位列表查询")
|
||||
@ApiOperation(value="工作组项目-根据成员单位列表查询", notes="工作组项目-根据单位列表查询")
|
||||
@GetMapping(value = "/queryListByCompany")
|
||||
public Result<?> queryListByCompany(@RequestParam(name = "companyId") String companyId,
|
||||
@RequestParam(name = "workingGroupProject") String workingGroupProject,
|
||||
@RequestParam(name = "year",required = false) String year) {
|
||||
if(StringUtils.isBlank(companyId)){
|
||||
return Result.error("企业id不能为空!");
|
||||
}
|
||||
List<PayWorkingGroup> list = payWorkingGroupService.queryListByCompany(companyId,year);
|
||||
List<PayWorkingGroupVO> list = payWorkingGroupService.queryListByCompany(companyId,workingGroupProject,year);
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
setPayWorkingGroupSubItem(list);
|
||||
}
|
||||
return Result.OK(list);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @Description 获取进度
|
||||
* @Author lqt
|
||||
* @Date 2021/9/6
|
||||
* @Param list 集合
|
||||
* @Return
|
||||
* @Exception
|
||||
*/
|
||||
private void setPayWorkingGroupSubItem(List<PayWorkingGroupVO> list){
|
||||
list.forEach(p->{
|
||||
LambdaQueryWrapper<PayWorkingGroupSubItem> query = new LambdaQueryWrapper<>();
|
||||
query.eq(PayWorkingGroupSubItem::getWorkingGroupId,p.getId());
|
||||
List<PayWorkingGroupSubItem> listPayWorkingGroupSubItem = payWorkingGroupSubItemService.list(query);
|
||||
if(!CollectionUtils.isEmpty(listPayWorkingGroupSubItem)){
|
||||
PayWorkingGroupPayment payWorkingGroupPayment = new PayWorkingGroupPayment();
|
||||
// 已付全款
|
||||
List<PayWorkingGroupSubItem> listAllPayment = listPayWorkingGroupSubItem.stream()
|
||||
.filter(p1->(Objects.isNull(p1.getPaidAmount()) ? 0 : p1.getPaidAmount())
|
||||
== (Objects.isNull(p1.getReceivableAmount()) ? 0 : p1.getReceivableAmount())).collect(Collectors.toList());
|
||||
payWorkingGroupPayment.setAllPayment(listAllPayment.size());
|
||||
// 部分付款
|
||||
List<PayWorkingGroupSubItem> listPartPayment = listPayWorkingGroupSubItem.stream()
|
||||
.filter(p1->(Objects.isNull(p1.getPaidAmount()) ? 0 : p1.getPaidAmount())
|
||||
< (Objects.isNull(p1.getReceivableAmount()) ? 0 : p1.getReceivableAmount())).collect(Collectors.toList());
|
||||
payWorkingGroupPayment.setPartPayment(listPartPayment.size());
|
||||
// 未付款
|
||||
List<PayWorkingGroupSubItem> listNotPayment = listPayWorkingGroupSubItem.stream()
|
||||
.filter(p1->(Objects.isNull(p1.getPaidAmount()) ? 0 : p1.getPaidAmount()) == 0
|
||||
&& (Objects.isNull(p1.getReceivableAmount()) ? 0 : p1.getReceivableAmount()) != 0 )
|
||||
.collect(Collectors.toList());
|
||||
payWorkingGroupPayment.setNotPayment(listNotPayment.size());
|
||||
p.setObj(payWorkingGroupPayment);
|
||||
}else{
|
||||
PayWorkingGroupPayment payWorkingGroupPayment = new PayWorkingGroupPayment();
|
||||
payWorkingGroupPayment.setAllPayment(0);
|
||||
payWorkingGroupPayment.setPartPayment(0);
|
||||
payWorkingGroupPayment.setNotPayment(0);
|
||||
p.setObj(payWorkingGroupPayment);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
|
||||
+1
-1
@@ -34,6 +34,6 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
||||
* @Return
|
||||
* @Exception
|
||||
*/
|
||||
List<PayWorkingGroup> queryListByCompany(@Param("companyId") String companyId,@Param("year") String year);
|
||||
List<PayWorkingGroupVO> queryListByCompany(@Param("companyId") String companyId,@Param("workingGroupProject") String workingGroupProject, @Param("year") String year);
|
||||
|
||||
}
|
||||
|
||||
+4
-1
@@ -38,7 +38,7 @@
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
<select id="queryListByCompany" resultType="com.jero.project.entity.PayWorkingGroup">
|
||||
<select id="queryListByCompany" resultType="com.jero.project.vo.PayWorkingGroupVO">
|
||||
SELECT
|
||||
pwg.id,
|
||||
pwg.working_group_project AS workingGroupProject,
|
||||
@@ -64,6 +64,9 @@
|
||||
FROM pay_working_group pwg
|
||||
LEFT JOIN pay_working_group_subitem pwgs ON pwg.id = pwgs.working_group_id
|
||||
<where>
|
||||
<if test="workingGroupProject != null and workingGroupProject != ''">
|
||||
AND pwg.working_group_project = #{workingGroupProject}
|
||||
</if>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
AND pwgs.charge_company_id = #{companyId}
|
||||
</if>
|
||||
|
||||
+1
-1
@@ -32,5 +32,5 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
|
||||
* @Return
|
||||
* @Exception
|
||||
*/
|
||||
List<PayWorkingGroup> queryListByCompany(String companyId,String year);
|
||||
List<PayWorkingGroupVO> queryListByCompany(String companyId,String workingGroupProject,String year);
|
||||
}
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PayWorkingGroup> queryListByCompany(String companyId, String year) {
|
||||
return payWorkingGroupMapper.queryListByCompany(companyId,year);
|
||||
public List<PayWorkingGroupVO> queryListByCompany(String companyId,String workingGroupProject, String year) {
|
||||
return payWorkingGroupMapper.queryListByCompany(companyId,workingGroupProject,year);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ spring:
|
||||
job-store-type: jdbc
|
||||
initialize-schema: embedded
|
||||
#设置自动启动,默认为 true
|
||||
auto-startup: true
|
||||
auto-startup: false
|
||||
#启动时更新己存在的Job
|
||||
overwrite-existing-jobs: true
|
||||
overwrite-existing-jobs: false
|
||||
properties:
|
||||
org:
|
||||
quartz:
|
||||
@@ -137,14 +137,14 @@ spring:
|
||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
#url: jdbc:mysql://localhost:3306/jero-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
#username: root
|
||||
#password: root
|
||||
#driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/income_payments?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
# username: root
|
||||
# password: root
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#redis 配置
|
||||
redis:
|
||||
database: 14
|
||||
host: 192.168.18.254
|
||||
host: localhost
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8 #最大连接数据库连接数,设 0 为没有限制
|
||||
@@ -152,7 +152,7 @@ spring:
|
||||
max-wait: -1ms #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
|
||||
min-idle: 0 #最小等待连接中的数量,设 0 为没有限制
|
||||
shutdown-timeout: 100ms
|
||||
password: hzwlsoft.com
|
||||
password:
|
||||
port: 6379
|
||||
|
||||
#mybatis plus 设置
|
||||
|
||||
Reference in New Issue
Block a user