收入合同-导出excel 修改
This commit is contained in:
+2
-3
@@ -97,9 +97,6 @@ public class PayIncomeContractController extends JeroController<PayIncomeContrac
|
||||
if(!StringUtils.isBlank(payIncomeContract.getContractName()) && payIncomeContract.getContractName().length() > 50){
|
||||
return Result.error("合同名称长度不能大于50个字符!");
|
||||
}
|
||||
if(!StringUtils.isBlank(projectName) && projectName.length() > 50){
|
||||
return Result.error("关联项目长度不能大于50个字符!");
|
||||
}
|
||||
// todo 缺少会议,会员项目,标协会员
|
||||
Page<PayIncomeContractOutput> page = new Page<>(pageNo, pageSize);
|
||||
IPage<PayIncomeContractOutput> pageList = payIncomeContractService.queryPageList(page, payIncomeContract,chargeStatus,projectName,startTime,endTime);
|
||||
@@ -377,6 +374,8 @@ public class PayIncomeContractController extends JeroController<PayIncomeContrac
|
||||
exportList.forEach(p->{
|
||||
String str = JSON.toJSONString(p);
|
||||
Map<String,String> map = JSONObject.parseObject(str,Map.class);
|
||||
map.put("contractDate",DateUtils.date2Str(p.getContractDate(),new SimpleDateFormat("yyyy-MM-dd")));
|
||||
map.put("terminationDate",DateUtils.date2Str(p.getTerminationDate(),new SimpleDateFormat("yyyy-MM-dd")));
|
||||
map.put("opening",sysBaseAPI.translateDict("yn",String.valueOf(p.getOpening())));
|
||||
map.put("accountStatus",sysBaseAPI.translateDict("revenue_contract_account_status",String.valueOf(p.getAccountStatus())));
|
||||
map.put("pack",sysBaseAPI.translateDict("yn",String.valueOf(p.getPack())));
|
||||
|
||||
+41
-23
@@ -1,6 +1,7 @@
|
||||
package com.jero.contract.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -12,9 +13,13 @@ import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.contract.entity.PayIncomeContract;
|
||||
import com.jero.contract.entity.PaySpendingContract;
|
||||
import com.jero.contract.service.IPaySpendingContractService;
|
||||
import com.jero.contract.vo.PayIncomeContractOutput;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
@@ -22,12 +27,12 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description: pay_spending_contract
|
||||
* @Description: 支出合同
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-09-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="pay_spending_contract")
|
||||
@Api(tags="支出合同")
|
||||
@RestController
|
||||
@RequestMapping("/contract/paySpendingContract")
|
||||
@Slf4j
|
||||
@@ -38,23 +43,36 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param paySpendingContract
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @param paySpendingContract 支出合同
|
||||
* @param pageNo 页数
|
||||
* @param pageSize 条数
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "pay_spending_contract-分页列表查询")
|
||||
@ApiOperation(value="pay_spending_contract-分页列表查询", notes="pay_spending_contract-分页列表查询")
|
||||
@AutoLog(value = "支出合同-分页列表查询")
|
||||
@ApiOperation(value="支出合同-分页列表查询", notes="支出合同-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(PaySpendingContract paySpendingContract,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<PaySpendingContract> queryWrapper = QueryGenerator.initQueryWrapper(paySpendingContract, req.getParameterMap());
|
||||
Page<PaySpendingContract> page = new Page<PaySpendingContract>(pageNo, pageSize);
|
||||
IPage<PaySpendingContract> pageList = paySpendingContractService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
@RequestParam(name="startTime",required = false) String startTime,
|
||||
@RequestParam(name="endTime",required = false) String endTime) {
|
||||
if(!StringUtils.isBlank(paySpendingContract.getContractNum()) && paySpendingContract.getContractNum().length() > 50){
|
||||
return Result.error("合同编号长度不能大于50个字符!");
|
||||
}
|
||||
if(!StringUtils.isBlank(paySpendingContract.getContractName()) && paySpendingContract.getContractName().length() > 50){
|
||||
return Result.error("合同名称长度不能大于50个字符!");
|
||||
}
|
||||
// Page<PaySpendingContractOutput> page = new Page<>(pageNo, pageSize);
|
||||
// IPage<PaySpendingContract> pageList = payIncomeContractService.queryPageList(page, payIncomeContract,chargeStatus,projectName,startTime,endTime);
|
||||
// if(!CollectionUtils.isEmpty(pageList.getRecords())){
|
||||
// List<PayIncomeContractOutput> list = pageList.getRecords();
|
||||
// list.forEach(p->{
|
||||
//
|
||||
// });
|
||||
// }
|
||||
return Result.OK(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,8 +81,8 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
|
||||
* @param paySpendingContract
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "pay_spending_contract-添加")
|
||||
@ApiOperation(value="pay_spending_contract-添加", notes="pay_spending_contract-添加")
|
||||
@AutoLog(value = "支出合同-添加")
|
||||
@ApiOperation(value="支出合同-添加", notes="支出合同-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PaySpendingContract paySpendingContract) {
|
||||
paySpendingContractService.save(paySpendingContract);
|
||||
@@ -77,8 +95,8 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
|
||||
* @param paySpendingContract
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "pay_spending_contract-编辑")
|
||||
@ApiOperation(value="pay_spending_contract-编辑", notes="pay_spending_contract-编辑")
|
||||
@AutoLog(value = "支出合同-编辑")
|
||||
@ApiOperation(value="支出合同-编辑", notes="支出合同-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody PaySpendingContract paySpendingContract) {
|
||||
paySpendingContractService.updateById(paySpendingContract);
|
||||
@@ -91,8 +109,8 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "pay_spending_contract-通过id删除")
|
||||
@ApiOperation(value="pay_spending_contract-通过id删除", notes="pay_spending_contract-通过id删除")
|
||||
@AutoLog(value = "支出合同-通过id删除")
|
||||
@ApiOperation(value="支出合同-通过id删除", notes="支出合同-通过id删除")
|
||||
@GetMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
paySpendingContractService.removeById(id);
|
||||
@@ -105,8 +123,8 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "pay_spending_contract-批量删除")
|
||||
@ApiOperation(value="pay_spending_contract-批量删除", notes="pay_spending_contract-批量删除")
|
||||
@AutoLog(value = "支出合同-批量删除")
|
||||
@ApiOperation(value="支出合同-批量删除", notes="支出合同-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.paySpendingContractService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
@@ -119,8 +137,8 @@ public class PaySpendingContractController extends JeroController<PaySpendingCon
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "pay_spending_contract-通过id查询")
|
||||
@ApiOperation(value="pay_spending_contract-通过id查询", notes="pay_spending_contract-通过id查询")
|
||||
@AutoLog(value = "支出合同-通过id查询")
|
||||
@ApiOperation(value="支出合同-通过id查询", notes="支出合同-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
PaySpendingContract paySpendingContract = paySpendingContractService.getById(id);
|
||||
|
||||
+18
-20
@@ -55,29 +55,27 @@
|
||||
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 <= #{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 aa.contractNum LIKE CONCAT('%',CONCAT(#{payIncomeContract.contractNum},'%'))
|
||||
</if>
|
||||
<if test="payIncomeContract.contractName != null and payIncomeContract.contractName != ''">
|
||||
AND aa.contractName LIKE CONCAT('%',CONCAT(#{payIncomeContract.contractName},'%'))
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND DATE_FORMAT(aa.createTime,'%Y-%m-%d') >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(aa.createTime,'%Y-%m-%d') <= #{endTime}
|
||||
</if>
|
||||
<if test="payIncomeContract.status != null and payIncomeContract.status != ''">
|
||||
AND aa.status = #{payIncomeContract.status}
|
||||
</if>
|
||||
<if test="chargeStatus != null and chargeStatus != ''">
|
||||
AND aa.chargeStatus = #{chargeStatus}
|
||||
</if>
|
||||
<if test="projectName != null and projectName != ''">
|
||||
AND aa.associatedProject LIKE CONCAT('%',CONCAT(#{projectName},'%'))
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user