收入合同-添加不存在成员单位的工作组列表接口

This commit is contained in:
梁琦涛
2021-09-07 16:52:58 +08:00
parent 915bf0a101
commit e4ee78e4b1
15 changed files with 179 additions and 60 deletions
@@ -103,9 +103,12 @@ public class PayIncomeContractController extends JeroController<PayIncomeContrac
// todo 缺少会议,会员项目,标协会员
Page<PayIncomeContractOutput> page = new Page<>(pageNo, pageSize);
IPage<PayIncomeContractOutput> pageList = payIncomeContractService.queryPageList(page, payIncomeContract,chargeStatus,projectName,startTime,endTime);
pageList.getRecords().forEach(p->{
System.out.println(JSONObject.toJSONString(p));
});
if(!CollectionUtils.isEmpty(pageList.getRecords())){
List<PayIncomeContractOutput> list = pageList.getRecords();
list.forEach(p->{
});
}
return Result.OK(pageList);
}
@@ -79,7 +79,7 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
*/
@AutoLog(value = "pay_spending_contract-编辑")
@ApiOperation(value="pay_spending_contract-编辑", notes="pay_spending_contract-编辑")
@PutMapping(value = "/edit")
@PostMapping(value = "/edit")
public Result<?> edit(@RequestBody PaySpendingContract paySpendingContract) {
paySpendingContractService.updateById(paySpendingContract);
return Result.OK("编辑成功!");
@@ -93,7 +93,7 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
*/
@AutoLog(value = "pay_spending_contract-通过id删除")
@ApiOperation(value="pay_spending_contract-通过id删除", notes="pay_spending_contract-通过id删除")
@DeleteMapping(value = "/delete")
@GetMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
paySpendingContractService.removeById(id);
return Result.OK("删除成功!");
@@ -107,7 +107,7 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
*/
@AutoLog(value = "pay_spending_contract-批量删除")
@ApiOperation(value="pay_spending_contract-批量删除", notes="pay_spending_contract-批量删除")
@DeleteMapping(value = "/deleteBatch")
@GetMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.paySpendingContractService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
@@ -17,8 +17,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* @Description: pay_spending_contract_installment
@@ -26,7 +24,7 @@ import io.swagger.annotations.ApiOperation;
* @Date: 2021-09-07
* @Version: V1.0
*/
@Api(tags="pay_spending_contract_installment")
//@Api(tags="pay_spending_contract_installment")
@RestController
@RequestMapping("/contract/paySpendingContractInstallment")
@Slf4j
@@ -44,7 +42,7 @@ public class PaySpendingContractInstallmentController extends JeroController<Pay
* @return
*/
@AutoLog(value = "pay_spending_contract_installment-分页列表查询")
@ApiOperation(value="pay_spending_contract_installment-分页列表查询", notes="pay_spending_contract_installment-分页列表查询")
// @ApiOperation(value="pay_spending_contract_installment-分页列表查询", notes="pay_spending_contract_installment-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(PaySpendingContractInstallment paySpendingContractInstallment,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@@ -63,7 +61,7 @@ public class PaySpendingContractInstallmentController extends JeroController<Pay
* @return
*/
@AutoLog(value = "pay_spending_contract_installment-添加")
@ApiOperation(value="pay_spending_contract_installment-添加", notes="pay_spending_contract_installment-添加")
// @ApiOperation(value="pay_spending_contract_installment-添加", notes="pay_spending_contract_installment-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody PaySpendingContractInstallment paySpendingContractInstallment) {
paySpendingContractInstallmentService.save(paySpendingContractInstallment);
@@ -77,8 +75,8 @@ public class PaySpendingContractInstallmentController extends JeroController<Pay
* @return
*/
@AutoLog(value = "pay_spending_contract_installment-编辑")
@ApiOperation(value="pay_spending_contract_installment-编辑", notes="pay_spending_contract_installment-编辑")
@PutMapping(value = "/edit")
// @ApiOperation(value="pay_spending_contract_installment-编辑", notes="pay_spending_contract_installment-编辑")
@PostMapping(value = "/edit")
public Result<?> edit(@RequestBody PaySpendingContractInstallment paySpendingContractInstallment) {
paySpendingContractInstallmentService.updateById(paySpendingContractInstallment);
return Result.OK("编辑成功!");
@@ -91,8 +89,8 @@ public class PaySpendingContractInstallmentController extends JeroController<Pay
* @return
*/
@AutoLog(value = "pay_spending_contract_installment-通过id删除")
@ApiOperation(value="pay_spending_contract_installment-通过id删除", notes="pay_spending_contract_installment-通过id删除")
@DeleteMapping(value = "/delete")
// @ApiOperation(value="pay_spending_contract_installment-通过id删除", notes="pay_spending_contract_installment-通过id删除")
@GetMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
paySpendingContractInstallmentService.removeById(id);
return Result.OK("删除成功!");
@@ -105,8 +103,8 @@ public class PaySpendingContractInstallmentController extends JeroController<Pay
* @return
*/
@AutoLog(value = "pay_spending_contract_installment-批量删除")
@ApiOperation(value="pay_spending_contract_installment-批量删除", notes="pay_spending_contract_installment-批量删除")
@DeleteMapping(value = "/deleteBatch")
// @ApiOperation(value="pay_spending_contract_installment-批量删除", notes="pay_spending_contract_installment-批量删除")
@GetMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.paySpendingContractInstallmentService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
@@ -119,7 +117,7 @@ public class PaySpendingContractInstallmentController extends JeroController<Pay
* @return
*/
@AutoLog(value = "pay_spending_contract_installment-通过id查询")
@ApiOperation(value="pay_spending_contract_installment-通过id查询", notes="pay_spending_contract_installment-通过id查询")
// @ApiOperation(value="pay_spending_contract_installment-通过id查询", notes="pay_spending_contract_installment-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
PaySpendingContractInstallment paySpendingContractInstallment = paySpendingContractInstallmentService.getById(id);
@@ -13,6 +13,10 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
/**
* @Description: pay_income_contract_associated
* @Author: jeecg-boot
@@ -34,14 +38,18 @@ public class PayIncomeContractAssociated implements Serializable {
/**合同id*/
@Excel(name = "合同id", width = 15)
@ApiModelProperty(value = "合同id")
@Size(max = 32, message = "合同id长度不能大于32个字符")
private java.lang.String contractId;
/**项目id*/
@Excel(name = "项目id", width = 15)
@ApiModelProperty(value = "项目id")
@Size(max = 32, message = "项目id长度不能大于32个字符")
private java.lang.String projectId;
/**项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目)*/
@Excel(name = "项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目)", width = 15)
@ApiModelProperty(value = "项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目)")
@Max(5)
@Min(1)
private java.lang.Integer projectType;
/**创建人*/
@ApiModelProperty(value = "创建人")
@@ -14,6 +14,10 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
/**
* @Description: pay_income_contract_audit
* @Author: jeecg-boot
@@ -35,15 +39,19 @@ public class PayIncomeContractAudit implements Serializable {
/**合同id*/
@Excel(name = "合同id", width = 15)
@ApiModelProperty(value = "合同id")
@Size(max = 32, message = "合同id长度不能大于32个字符")
private java.lang.String contractId;
/**合同状态(1:草稿,2:待审核,3:已通过,4:未通过,5:已归档)*/
@Excel(name = "合同状态(1:草稿,2:待审核,3:已通过,4:未通过,5:已归档)", width = 15)
@ApiModelProperty(value = "合同状态(1:草稿,2:待审核,3:已通过,4:未通过,5:已归档)")
@Dict(dicCode = "revenue_contract_status")
@Max(5)
@Min(1)
private java.lang.Integer contractStatus;
/**拒绝说明*/
@Excel(name = "拒绝说明", width = 15)
@ApiModelProperty(value = "拒绝说明")
@Size(max = 200, message = "拒绝说明长度不能大于200个字符")
private java.lang.String explainRemarks;
/**创建人*/
@ApiModelProperty(value = "创建人")
@@ -13,6 +13,9 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.Max;
import javax.validation.constraints.Size;
/**
* @Description: pay_income_contract_installment
* @Author: jeecg-boot
@@ -34,14 +37,17 @@ public class PayIncomeContractInstallment implements Serializable {
/**合同id*/
@Excel(name = "合同id", width = 15)
@ApiModelProperty(value = "合同id")
@Size(max = 32, message = "合同id长度不能大于32个字符")
private java.lang.String contractId;
/**阶段*/
@Excel(name = "阶段", width = 15)
@ApiModelProperty(value = "阶段")
@Size(max = 50, message = "阶段长度不能大于50个字符")
private java.lang.String phaseName;
/**应收金额*/
@Excel(name = "应收金额", width = 15)
@ApiModelProperty(value = "应收金额")
@Max(value = 999999999,message = "应收金额格式错误")
private java.lang.Integer accountsReceivableAmount;
/**应收时间*/
@Excel(name = "应收时间", width = 15, format = "yyyy-MM-dd")
@@ -52,6 +58,7 @@ public class PayIncomeContractInstallment implements Serializable {
/**实收金额*/
@Excel(name = "实收金额", width = 15)
@ApiModelProperty(value = "实收金额")
@Max(value = 999999999,message = "实收金额格式错误")
private java.lang.Integer paidAmount;
/**实收时间*/
@Excel(name = "实收时间", width = 15, format = "yyyy-MM-dd")
@@ -14,6 +14,9 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.Max;
import javax.validation.constraints.Size;
/**
* @Description: pay_spending_contract_installment
* @Author: jeecg-boot
@@ -35,14 +38,17 @@ public class PaySpendingContractInstallment implements Serializable {
/**合同id*/
@Excel(name = "合同id", width = 15)
@ApiModelProperty(value = "合同id")
@Size(max = 32, message = "合同id长度不能大于32个字符")
private String contractId;
/**阶段名称*/
@Excel(name = "阶段名称", width = 15)
@ApiModelProperty(value = "阶段名称")
@Size(max = 50, message = "阶段名称长度不能大于50个字符")
private String phaseName;
/**应收金额*/
@Excel(name = "应收金额", width = 15)
@ApiModelProperty(value = "应收金额")
@Max(value = 999999999,message = "应收金额格式错误")
private Integer accountsReceivableAmount;
/**应收时间*/
@Excel(name = "应收时间", width = 15, format = "yyyy-MM-dd")
@@ -53,6 +59,7 @@ public class PaySpendingContractInstallment implements Serializable {
/**实收金额*/
@Excel(name = "实收金额", width = 15)
@ApiModelProperty(value = "实收金额")
@Max(value = 999999999,message = "应收金额格式错误")
private Integer paidAmount;
/**实收时间*/
@Excel(name = "实收时间", width = 15, format = "yyyy-MM-dd")
@@ -3,13 +3,15 @@
<mapper namespace="com.jero.contract.mapper.PayIncomeContractMapper">
<!--缺少会议项目,会员项目-->
<select id="queryPageList" resultType="com.jero.contract.vo.PayIncomeContractOutput">
SELECT
SELECT * FROM
(
SELECT
pic.id,
pic.contract_num AS contractNum,
pic.contract_name AS contractName,
pic.signed_company_id AS signedCompanyId,
pic.signed_company_temporary_id AS signedCompanyTemporaryId,
pic.signed_company_temporary_name AS signedCompanyTemporaryName,
pic.signed_company_temporary_id AS signedCompanyTemporaryId,
pic.signed_company_temporary_name AS signedCompanyTemporaryName,
pic.signed_contacts_id AS signedContactsId,
pic.signed_contacts_temporary_id AS signedContactsTemporaryId,
pic.signed_contacts_temporary_name AS signedContactsTemporaryName,
@@ -35,45 +37,52 @@
pic.create_time AS createTime,
pic.update_by AS updateBy,
pic.update_time AS updateTime,
if(pic.chargeStatus > 0,1,0) AS chargeStatus
FROM
(
if(pic.chargeStatus > 0,1,0) AS chargeStatus,
GROUP_CONCAT(project.projectName) AS associatedProject
FROM
(
select pay_income_contract.*,(select count(*) from pay_income_contract_installment
where contract_id = pay_income_contract.id AND accounts_receivable_time > DATE_FORMAT(NOW(),'%Y-%m-%d')
AND accounts_receivable_amount != 0 AND accounts_receivable_amount &lt; paid_amount) AS chargeStatus
FROM pay_income_contract
) pic
LEFT JOIN pay_income_contract_associated pica ON pica.contract_id = pic.id
LEFT JOIN pay_common_project pcp ON pcp.id = pica.project_id
LEFT JOIN pay_working_group_subitem pwgs ON pwgs.id = pica.project_id
LEFT JOIN pay_working_group pwg ON pwg.id = pwgs.working_group_id
) pic
LEFT JOIN pay_income_contract_associated pica ON pica.contract_id = pic.id
LEFT JOIN
(
select id,charge_project AS projectName from pay_common_project
union all
select pwgs.id,pwg.working_group_project AS projectName from pay_working_group_subitem pwgs
left join pay_working_group pwg ON pwg.id = pwgs.working_group_id
WHERE pwg.working_group_project is not null and pwg.working_group_project!=''
) project ON project.id = pica.project_id
<where>
<if test="payIncomeContract.contractNum != null and payIncomeContract.contractNum != ''">
AND pic.contract_num LIKE CONCAT('%',CONCAT(#{payIncomeContract.contractNum},'%'))
</if>
<if test="payIncomeContract.contractName != null and payIncomeContract.contractName != ''">
AND pic.contract_name LIKE CONCAT('%',CONCAT(#{payIncomeContract.contractName},'%'))
</if>
<if test="startTime != null and startTime != ''">
AND pic.create_time >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND pic.create_time &lt;= #{endTime}
</if>
<if test="payIncomeContract.status != null and payIncomeContract.status != ''">
AND pic.status = #{payIncomeContract.status}
</if>
<if test="chargeStatus != null and chargeStatus != ''">
AND pic.chargeStatus = #{chargeStatus}
</if>
</where>
GROUP BY pic.id
) aa
<where>
<if test="payIncomeContract.contractNum != null and payIncomeContract.contractNum != ''">
AND pic.contract_num LIKE CONCAT('%',CONCAT(#{payIncomeContract.contractNum},'%'))
</if>
<if test="payIncomeContract.contractName != null and payIncomeContract.contractName != ''">
AND pic.contract_name LIKE CONCAT('%',CONCAT(#{payIncomeContract.contractName},'%'))
</if>
<if test="projectName != null and projectName != ''">
AND (
pcp.charge_project LIKE CONCAT('%',CONCAT(#{projectName},'%'))
OR pwg.working_group_project LIKE CONCAT('%',CONCAT(#{projectName},'%'))
)
</if>
<if test="startTime != null and startTime != ''">
AND pic.create_time >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND pic.create_time &lt;= #{endTime}
</if>
<if test="payIncomeContract.status != null and payIncomeContract.status != ''">
AND pic.status = #{payIncomeContract.status}
</if>
<if test="chargeStatus != null and chargeStatus != ''">
AND pic.chargeStatus = #{chargeStatus}
AND aa.associatedProject LIKE CONCAT('%',CONCAT(#{projectName},'%'))
</if>
</where>
GROUP BY pic.id ORDER BY pic.create_time desc
ORDER BY aa.chargeStatus,aa.createTime desc
</select>
<select id="getAssociated" resultType="com.jero.contract.vo.ProjectOutput">
SELECT * FROM (
@@ -509,6 +509,7 @@ public class PayIncomeContractServiceImpl extends ServiceImpl<PayIncomeContractM
throw new JeroBootException("请输入拒绝说明!");
}
if(Objects.equals(payIncomeContractAudit.getContractStatus(),PayIncomeContractCommon.STATUS3)){
// todo 缺少插入合同邮寄表
payIncomeContractAudit.setExplainRemarks("");
}
@@ -557,7 +558,7 @@ public class PayIncomeContractServiceImpl extends ServiceImpl<PayIncomeContractM
throw new JeroBootException("收入合同不存在!");
}
if(!Objects.equals(payIncomeContractStatus.getStatus(),PayIncomeContractCommon.STATUS1)
&& !Objects.equals(payIncomeContractStatus.getStatus(),PayIncomeContractCommon.STATUS4)){
&& Objects.equals(payIncomeContractStatus.getStatus(),PayIncomeContractCommon.STATUS4)){
throw new JeroBootException("收入合同不可删除!");
}
payIncomeContractService.removeById(id);
@@ -575,16 +576,19 @@ public class PayIncomeContractServiceImpl extends ServiceImpl<PayIncomeContractM
@Override
@Transactional
public void deletePayIncomeContractInputByIds(List<String> ids) {
ids.forEach(p->{
PayIncomeContract payIncomeContractStatus = payIncomeContractService.getById(p);
if(Objects.isNull(payIncomeContractStatus)){
throw new JeroBootException("收入合同不存在!");
}
if(!Objects.equals(payIncomeContractStatus.getStatus(),PayIncomeContractCommon.STATUS1)
&& !Objects.equals(payIncomeContractStatus.getStatus(),PayIncomeContractCommon.STATUS4)){
LambdaQueryWrapper<PayIncomeContract> query = new LambdaQueryWrapper<>();
query.in(PayIncomeContract::getId,ids);
List<PayIncomeContract> listPayIncomeContractStatus = payIncomeContractService.list(query);
if(CollectionUtils.isEmpty(listPayIncomeContractStatus)){
throw new JeroBootException("收入合同不存在!");
}
listPayIncomeContractStatus.forEach(p->{
if(!Objects.equals(p.getStatus(),PayIncomeContractCommon.STATUS1)
&& !Objects.equals(p.getStatus(),PayIncomeContractCommon.STATUS4)){
throw new JeroBootException("收入合同不可删除!");
}
});
payIncomeContractService.removeByIds(ids);
LambdaUpdateWrapper<PayIncomeContractInstallment> updatePayIncomeContractInstallment = new LambdaUpdateWrapper<>();
updatePayIncomeContractInstallment.in(PayIncomeContractInstallment::getContractId,ids);
@@ -1,6 +1,7 @@
package com.jero.contract.vo;
import com.jero.contract.entity.PayIncomeContract;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@@ -10,5 +11,11 @@ public class PayIncomeContractOutput extends PayIncomeContract implements Serial
/**
* 来款状态 0:全部 1:到期未付款
*/
@ApiModelProperty(value = "来款状态 0:全部 1:到期未付款")
private String chargeStatus;
/**
* 关联项目
*/
@ApiModelProperty(value = "关联项目")
private String associatedProject;
}
@@ -97,6 +97,7 @@ public class PayWorkingGroupController extends JeroController<PayWorkingGroup, I
return Result.OK(list);
}
/**
* 收入合同-根据成员单位列表查询
*
@@ -120,6 +121,23 @@ public class PayWorkingGroupController extends JeroController<PayWorkingGroup, I
}
return Result.OK(list);
}
/**
* 收入合同-查询不存在成员单位的列表
*
* @param companyId 企业id
* @return
*/
@AutoLog(value = "工作组项目-查询不存在成员单位的列表")
@ApiOperation(value="工作组项目-查询不存在成员单位的列表", notes="工作组项目-查询不存在成员单位的列表")
@GetMapping(value = "/queryListByNotCompany")
public Result<?> queryListByNotCompany(@RequestParam(name = "companyId") String companyId) {
if(StringUtils.isBlank(companyId)){
return Result.error("企业id不能为空!");
}
List<PayWorkingGroup> list = payWorkingGroupService.queryListByNotCompany(companyId);
return Result.OK(list);
}
/**
* @Description 获取进度
* @Author lqt
@@ -37,4 +37,14 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
List<PayWorkingGroupVO> queryListByCompany(@Param("companyId") String companyId,@Param("workingGroupProject") String workingGroupProject,
@Param("year") String year,@Param("projectType") String projectType);
/**
* @Description 查询不存在成员单位的列表
* @Author lqt
* @Date 2021/9/7
* @Param
* @Return
* @Exception
*/
List<PayWorkingGroup> queryListByNotCompany(@Param("companyId") String companyId);
}
@@ -73,4 +73,30 @@
</if>
GROUP BY pwg.id ORDER BY pwg.create_time DESC
</select>
<select id="queryListByNotCompany" resultType="com.jero.project.entity.PayWorkingGroup">
SELECT
id,
working_group_project AS workingGroupProject,
year,
principal_id_a AS principalIdA,
principal_name_a AS principalNameA,
principal_id_b AS principalIdB,
principal_name_b AS principalNameB,
convoke_num AS convokeNum,
operation_cycle AS operationCycle,
year_charge_a AS yearChargeA,
charge_notice_no_a AS chargeNoticeNoA,
charge_notice_a_id AS chargeNoticeAId,
year_charge_b AS yearChargeB,
charge_notice_no_b AS chargeNoticeNoB,
charge_notice_b_id AS chargeNoticeBId,
mission_and_objectives AS missionAndObjectives,
remarks,
create_by AS createBy,
create_time AS createTime,
update_by AS updateBy,
update_time AS updateTime
FROM pay_working_group
WHERE id NOT IN (SELECT working_group_id FROM pay_working_group_subitem WHERE charge_company_id=#{companyId})
</select>
</mapper>
@@ -33,4 +33,13 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
* @Exception
*/
List<PayWorkingGroupVO> queryListByCompany(String companyId,String workingGroupProject,String year,String projectType);
/**
* @Description 查询不存在成员单位的列表
* @Author lqt
* @Date 2021/9/7
* @Param
* @Return
* @Exception
*/
List<PayWorkingGroup> queryListByNotCompany(String companyId);
}
@@ -34,4 +34,9 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
public List<PayWorkingGroupVO> queryListByCompany(String companyId,String workingGroupProject, String year,String projectType) {
return payWorkingGroupMapper.queryListByCompany(companyId,workingGroupProject,year,projectType);
}
@Override
public List<PayWorkingGroup> queryListByNotCompany(String companyId) {
return payWorkingGroupMapper.queryListByNotCompany(companyId);
}
}