Răsfoiți Sursa

Merge remote-tracking branch 'origin/test' into test

haoyu 2 ani în urmă
părinte
comite
5041e1dd3e

+ 4 - 4
docker/shell-test.sh

@@ -3,7 +3,7 @@
 # Dockerfile路径
 DOCKER_FILE_PATH=/usr/local/java/insAgency
 # 容器id
-CID=$(''docker ps | grep "ins" | awk '{print $1}''')
+CID=$(''docker ps | grep "ins-test" | awk '{print $1}''')
 echo $CID
 # 运行docker容器
 function run(){
@@ -19,20 +19,20 @@ function run(){
     # 删除容器
     sudo docker rm $CID
     # 删除镜像
-    sudo docker rmi ins
+    sudo docker rmi ins-test
     echo "删除镜像和容器成功,下面开始构建新镜像"
   else
     echo "不存在people-healthy容器,下面直接开始构建镜像"
   fi
   # 构建镜像
-  docker build -t ins .
+  docker build -t ins-test .
   echo "创建容器成功"
   docker images
   # 杀死特定端口进程
   # mypid=$(netstat -apn|grep 9001|awk '{print $7}'|cut -d/ -f1);
   # echo $mypid
   # kill -9 $mypid
-  docker run -it --name ins -p 8080:8888 -e "--spring.profiles.active=test" -p 9999:9999 --restart=always -v /usr/local/java/insAgency:/ins --mount type=bind,source=/nasData,destination=/nasData -v /usr/local/java/insAgency/logs:/ins/logs -d ins:latest
+  docker run -it --name ins-test -p 8080:8888 -e "--spring.profiles.active=test" -p 9999:9999 --restart=always -v /usr/local/java/insAgency:/ins --mount type=bind,source=/nasData,destination=/nasData -v /usr/local/java/insAgency/logs:/ins/logs -d ins-test:latest
 }
 
 #入口

+ 2 - 0
src/main/java/com/ydtech/modules/admin/model/vo/SysUserBaseVO.java

@@ -42,5 +42,7 @@ public class SysUserBaseVO {
     private String roleName;
     @ApiModelProperty(value = "工号类型")
     private String noType;
+    @ApiModelProperty(value = "是否绑定协议")
+    private Boolean flag;
 
 }

+ 1 - 1
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java

@@ -2810,7 +2810,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         nonExportFee.setOtherCostsProportion(nonOtherCostsProportion);
         nonExportFee.setOtherCostsPremiums(insFeeOrderNew.getNoPremium().multiply(nonOtherCostsProportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
         nonExportFee.setTotalProportion(nonExportSuperviseCosts.add(nonOtherCostsProportion));
-        nonExportFee.setTotalAmount(nonExportSuperviseCosts.add(nonOtherCostsProportion));
+        nonExportFee.setTotalAmount(nonExportFee.getSuperviseCostsPremiums().add(nonExportFee.getOtherCostsPremiums()));
         exportFeeList.add(nonExportFee);
 
         feeOrderNewVo.setEntranceFee(entranceFeeList);

+ 42 - 0
src/main/java/com/ydtech/modules/inv/controller/invAccountExcelController.java

@@ -3,15 +3,28 @@ package com.ydtech.modules.inv.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.ydtech.constants.enums.inv.InvPayMethodEnum;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.core.page.PageResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.inv.dao.InvAccountExcelMapper;
 import com.ydtech.modules.inv.model.InvAccountExcel;
+import com.ydtech.modules.inv.model.excel.InvDisburseExcel;
+import com.ydtech.modules.inv.model.po.InvSettlementSource;
+import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
+import com.ydtech.modules.inv.model.vo.InvSettlementSourceQueryVo;
 import com.ydtech.modules.inv.service.InvAccountExcelService;
+import com.ydtech.modules.inv.utils.EasyExcelUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.Date;
 import java.util.List;
 
@@ -28,12 +41,34 @@ public class invAccountExcelController {
     @Autowired
     private InvAccountExcelService invAccountExcelService;
 
+    @Resource
+    private InvAccountExcelMapper invAccountExcelMapper;
+
+    @Value("${upload.file.path}")
+    private String uploadPath;
+
+    @Value("${upload.file.url}")
+    private String uploadUrl;
+
     @PostMapping("excel")
     @ApiOperation("导出资金申请模板")
     public HttpResult excelAccountOperate(@RequestBody List<String> idList) {
         return invAccountExcelService.excelAccount(idList);
     }
 
+    @PostMapping("deriveReport")
+    @ApiOperation("导出支出报表")
+    public HttpResult deriveReport(@RequestBody List<String> idList) throws IOException {
+        List<InvAccountExcel> insAccountExcels = invAccountExcelMapper.selectBatchIds(idList);
+        String uploadPath = this.uploadPath + "/excel/";
+        Path path = Paths.get(uploadPath);
+        if (!Files.exists(path)) {
+            Files.createDirectories(path);
+        }
+        String fileName = EasyExcelUtils.downExcel(uploadPath, "支出报表", InvDisburseExcel.class, insAccountExcels);
+        return HttpResult.ok(uploadUrl + "excel/" + fileName);
+    }
+
     @PostMapping("insert")
     @ApiOperation("插入资金模板信息")
     public HttpResult invertAccount(@RequestBody InvAccountExcel invAccountExcel) {
@@ -113,6 +148,13 @@ public class invAccountExcelController {
         return invAccountExcelService.selectAccountExcel(invAccountExcel);
     }
 
+    @ApiOperation("支出报表查看")
+    @PostMapping("getDisburse")
+    public HttpResult getDisburse(@RequestBody InvAccountExcelVo invAccountExcelVo) {
+        return invAccountExcelService.selectDisburse(invAccountExcelVo);
+    }
+
+
     @ApiOperation("删除资金模板")
     @DeleteMapping("{excelAccountOperateId}")
     public HttpResult deleteAccountExcel(@PathVariable("excelAccountOperateId") String excelAccountOperateId) {

+ 3 - 0
src/main/java/com/ydtech/modules/inv/dao/InvAccountExcelMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.inv.model.InvAccountExcel;
+import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
 import org.apache.ibatis.annotations.Param;
 
 /**
@@ -15,6 +16,8 @@ import org.apache.ibatis.annotations.Param;
 */
 public interface InvAccountExcelMapper extends BaseMapper<InvAccountExcel> {
     IPage<InvAccountExcel> selectExcelAccount(Page page, @Param("insAccountExcel") InvAccountExcel insAccountExcel);
+
+    IPage<InvAccountExcelVo> selectDisburse(Page page, @Param("insAccountExcel") InvAccountExcelVo insAccountExcelVo);
 }
 
 

+ 46 - 0
src/main/java/com/ydtech/modules/inv/model/excel/InvDisburseExcel.java

@@ -0,0 +1,46 @@
+package com.ydtech.modules.inv.model.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class InvDisburseExcel implements Serializable {
+    @ExcelProperty("日期")
+    @ApiModelProperty(value = "申请时间")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @NotBlank
+    private Date applyTime;
+
+    @ExcelProperty("费用类型")
+    @ApiModelProperty(value = "资金用途")
+    private String fundUse;
+
+    @ExcelProperty("摘要")
+    @ApiModelProperty("备注")
+    private String remark;
+
+    @ExcelProperty("支出金额")
+    @ApiModelProperty(value = "申请金额")
+    private String applyAmount;
+
+    @ExcelProperty("支出部门")
+    @ApiModelProperty(value = "申请部门")
+    private String applySector;
+
+    @ExcelProperty("支出账户")
+    @ApiModelProperty(value = "单位")
+    private String company;
+
+    /**
+     * 收款单位信息
+     */
+    @ExcelProperty("收款方")
+    @ApiModelProperty(value = "收款单位信息")
+    private String collectionMessage;
+}

+ 68 - 0
src/main/java/com/ydtech/modules/inv/model/vo/InvAccountExcelVo.java

@@ -0,0 +1,68 @@
+package com.ydtech.modules.inv.model.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class InvAccountExcelVo implements Serializable {
+
+    @ApiModelProperty(value = "资金申请表id")
+    private String excelAccountOperateId;
+
+    @ExcelProperty("日期")
+    @ApiModelProperty(value = "申请时间")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @NotBlank
+    private Date applyTime;
+
+    @ExcelProperty("费用类型")
+    @ApiModelProperty(value = "资金用途")
+    private String fundUse;
+
+    @ExcelProperty("摘要")
+    @ApiModelProperty("备注")
+    private String remark;
+
+    @ExcelProperty("支出金额")
+    @ApiModelProperty(value = "申请金额")
+    private String applyAmount;
+
+    @ExcelProperty("支出部门")
+    @ApiModelProperty(value = "申请部门")
+    private String applySector;
+
+    @ExcelProperty("支出账户")
+    @ApiModelProperty(value = "单位")
+    private String company;
+
+    /**
+     * 收款单位信息
+     */
+    @ExcelProperty("收款方")
+    @ApiModelProperty(value = "收款单位信息")
+    private String collectionMessage;
+
+    @ApiModelProperty(value = "申请时间起")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(exist = false)
+    private Date applyTimeStart;
+
+    /**
+     * 申请时间止
+     */
+    @ApiModelProperty(value = "申请时间止")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(exist = false)
+    private Date applyTimeEnd;
+
+    private int pageNum;
+
+    private int PageSize;
+}

+ 3 - 0
src/main/java/com/ydtech/modules/inv/service/InvAccountExcelService.java

@@ -4,6 +4,7 @@ package com.ydtech.modules.inv.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.inv.model.InvAccountExcel;
+import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
 
 import java.util.List;
 
@@ -17,6 +18,8 @@ public interface InvAccountExcelService extends IService<InvAccountExcel> {
 
     HttpResult selectAccountExcel(InvAccountExcel invAccountExcel);
 
+    HttpResult selectDisburse(InvAccountExcelVo InvAccountExcelVo);
+
     HttpResult updateTransferFlag(String excelAccountOperateId);
 
 }

+ 18 - 0
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExcelServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.inv.service.impl;
 
 
+import com.alibaba.excel.util.WorkBookUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -12,8 +13,13 @@ import com.ydtech.exception.SystemException;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.inv.dao.InvAccountExcelMapper;
 import com.ydtech.modules.inv.model.*;
+import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
 import com.ydtech.modules.inv.service.*;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -100,6 +106,18 @@ public class InvAccountExcelServiceImpl extends ServiceImpl<InvAccountExcelMappe
         return HttpResult.ok("", invAccountExcelIPage);
     }
 
+    //支出报表查看
+    @Override
+    public HttpResult selectDisburse(InvAccountExcelVo invAccountExcelVo){
+        PageRequest pageRequest = new PageRequest();
+        pageRequest.setPageNum(invAccountExcelVo.getPageNum());
+        pageRequest.setPageSize(invAccountExcelVo.getPageSize());
+        Page page = PageRequest.buildPageRequest(pageRequest);
+        IPage<InvAccountExcelVo> invAccountExcelIPage = insAccountExcelMapper.selectDisburse(page, invAccountExcelVo);
+        return HttpResult.ok("", invAccountExcelIPage);
+    }
+
+
     /**
      * 修改已转账状态
      *

+ 1 - 1
src/main/resources/mapper/modules/admin/SysUserLinkPtlAgreementMapper.xml

@@ -74,7 +74,7 @@
         FROM
         sys_user_link_pl_agreement link
         LEFT JOIN sys_user USER ON link.user_id = USER.id
-        LEFT JOIN sys_dept t2 ON t1.dept_id = t2.id
+        LEFT JOIN sys_dept t2 ON USER.dept_id = t2.id
         LEFT JOIN sys_dept sd2 ON sd2.id = t2.parent_id
         LEFT JOIN ptl_agreement agree ON link.ptl_agreement_id = agree.id
         left join esm_ins_company com on link.id = agree.partner_companies_id

+ 6 - 1
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -551,7 +551,11 @@
             t2.id AS deptId,
             t2.`name` AS deptName,
             sd2.id AS pDeptId,
-            sd2.`name` AS pDeptName
+            sd2.`name` AS pDeptName,
+            CASE
+            WHEN ( SELECT count( 0 ) FROM sys_user_link_pl_agreement link WHERE link.user_id = t1.id) > 0 THEN
+            true ELSE false
+            END AS flag
         FROM
             sys_user t1
                 LEFT JOIN sys_dept t2 ON t1.dept_id = t2.id
@@ -573,5 +577,6 @@
                 and t2.id = #{user.deptId}
             </if>
         </if>
+        order by flag
     </select>
 </mapper>

+ 41 - 0
src/main/resources/mapper/modules/inv/InvAccountExcelMapper.xml

@@ -119,4 +119,45 @@
         order by create_time
         desc
     </select>
+
+
+    <select id="selectDisburse" resultMap="BaseResultMap">
+        SELECT
+            a.excel_account_operate_id,
+            a.apply_time,
+            a.fund_use,
+            a.remark,
+            a.apply_amount,
+            a.apply_sector,
+            a.company,
+            a.collection_message
+        from inv_account_excel a
+            LEFT JOIN inv_account_expenses b ON a.fund_fen = b.category
+        WHERE
+            a.fund_use != '往来款'
+	    AND collection_message LIKE '外部用户%'
+        AND a.del_flag = '0'
+        <if test="insAccountExcel.applyTimeStart!= null">
+            and apply_time &gt;= #{insAccountExcel.applyTimeStart}
+        </if>
+        <if test="insAccountExcel.applyTimeEnd!= null">
+            and apply_time &lt;= #{insAccountExcel.applyTimeEnd}
+        </if>
+        <if test="insAccountExcel.applySector!= null and insAccountExcel.applySector!= ''">
+            and apply_sector = #{insAccountExcel.applySector}
+        </if>
+        <if test="insAccountExcel.collectionMessage!= null and insAccountExcel.collectionMessage!= ''">
+            and collection_message like concat('%',#{insAccountExcel.collectionMessage},'%')
+        </if>
+        <if test="insAccountExcel.company!= null and insAccountExcel.company!= ''">
+            and company like concat('%',#{insAccountExcel.company},'%')
+        </if>
+        <if test="insAccountExcel.fundUse!= null and insAccountExcel.fundUse!= ''">
+            and fund_use = #{insAccountExcel.fundUse}
+        </if>
+        <if test="insAccountExcel.applyAmount!= null and insAccountExcel.applyAmount!= ''">
+            and apply_amount = #{insAccountExcel.applyAmount}
+        </if>
+        order by apply_time desc
+    </select>
 </mapper>