wwh 2 lat temu
rodzic
commit
7354d8c7a4

+ 28 - 0
admin/pom.xml

@@ -28,6 +28,26 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
+        <!--必须-->
+        <dependency>
+            <groupId>org.jxls</groupId>
+            <artifactId>jxls</artifactId>
+            <version>2.6.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jxls</groupId>
+            <artifactId>jxls-poi</artifactId>
+            <version>1.1.0</version>
+        </dependency>
+        <!--      日志包  非必须  避免控制台提示日志相关警告信息-->
+
+        <dependency>
+            <groupId>e-iceblue</groupId>
+            <artifactId>spire.xls.free</artifactId>
+            <version>2.2.0</version>
+        </dependency>
+
+
 
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -143,6 +163,14 @@
 
     </dependencies>
 
+    <repositories>
+        <repository>
+            <id>com.e-iceblue</id>
+            <name>e-iceblue</name>
+            <url>https://repo.e-iceblue.cn/repository/maven-public/</url>
+        </repository>
+    </repositories>
+
     <build>
         <plugins>
             <plugin>

+ 41 - 1
admin/src/main/java/com/huimv/farm/damsubsidy/controller/BillLandingInspectionController.java

@@ -3,19 +3,28 @@ package com.huimv.farm.damsubsidy.controller;
 
 import cn.hutool.core.date.DateTime;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.lang.UUID;
 import com.huimv.farm.damsubsidy.common.token.TokenSign;
 import com.huimv.farm.damsubsidy.common.utils.Result;
 import com.huimv.farm.damsubsidy.common.utils.ResultCode;
+import com.huimv.farm.damsubsidy.common.utils.UploadImage;
 import com.huimv.farm.damsubsidy.entity.BillLandingInspection;
 import com.huimv.farm.damsubsidy.service.IBillLandingInspectionService;
 import com.huimv.farm.damsubsidy.service.impl.BillLandingInspectionServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
-import java.sql.Date;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
 import java.time.LocalDateTime;
+import java.util.Date;
+import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -84,4 +93,35 @@ public class BillLandingInspectionController {
     public Result listById(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
         return billLandingInspectionService.listById(httpServletRequest, paramsMap);
     }
+
+    @RequestMapping("/addPay")
+    public Result addPay(HttpServletRequest httpServletRequest,
+                         @RequestParam("idCordBackUrl") MultipartFile idCordBackUrl,
+                         @RequestParam("id") String id) {
+        String imgname = "成功";
+        String originalFilename = idCordBackUrl.getOriginalFilename();
+        String filenameExtension = StringUtils.getFilenameExtension(originalFilename);
+        String path = DateUtil.format(new Date(), "yyyy-MM");
+        try {
+            InputStream inputStream = idCordBackUrl.getInputStream();
+            BufferedInputStream in = new BufferedInputStream(inputStream);
+            ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
+            byte[] temp = new byte[1024];
+            int size = 0;
+            while ((size = in.read(temp)) != -1) {
+                out.write(temp, 0, size);
+            }
+            in.close();
+            byte[] content = out.toByteArray();
+            imgname = UUID.randomUUID() + "." + filenameExtension;
+            UploadImage.sshSftp(content, path, imgname);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        String content = "https://img.ifarmcloud.com/images/" + path + "/" + imgname;
+        Map<String, String> map = new HashMap<>();
+        map.put("id", id);
+        map.put("url", content);
+        return billLandingInspectionService.addPay(httpServletRequest, map);
+    }
 }

+ 25 - 0
admin/src/main/java/com/huimv/farm/damsubsidy/controller/BillSubsidyController.java

@@ -4,8 +4,12 @@ package com.huimv.farm.damsubsidy.controller;
 import cn.hutool.core.date.DateTime;
 import com.huimv.farm.damsubsidy.common.token.TokenSign;
 import com.huimv.farm.damsubsidy.common.utils.Result;
+import com.huimv.farm.damsubsidy.common.utils.ResultCode;
 import com.huimv.farm.damsubsidy.entity.BillSubsidy;
 import com.huimv.farm.damsubsidy.service.IBillSubsidyService;
+import com.huimv.farm.test.Print;
+import com.spire.xls.FileFormat;
+import com.spire.xls.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -74,4 +78,25 @@ public class BillSubsidyController {
         return iBillSubsidyService.getLast(httpServletRequest,parasMap);
     }
 
+    @PostMapping("/listPcSub")
+    public Result listPcSub(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> parasMap){
+        return subsidyService.listPcSub(httpServletRequest,parasMap);
+    }
+
+    //打印
+    @PostMapping("/print")
+    public Result print(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> parasMap) throws Exception {
+        Integer id=Integer.parseInt(parasMap.get("id"));
+        BillSubsidy subsidy = subsidyService.getById(id);
+        Print print = new Print();
+        String path = print.print(subsidy);
+
+        //加载Excel文档
+        Workbook wb = new Workbook();
+        wb.loadFromFile(path);
+
+        //调用方法保存为PDF格式
+        wb.saveToFile("I://"+subsidy.getFarmerName()+".pdf", FileFormat.PDF);
+        return new Result(ResultCode.SUCCESS,"I://"+subsidy.getFarmerName()+".pdf");
+    }
 }

+ 8 - 0
admin/src/main/java/com/huimv/farm/damsubsidy/entity/BillSubsidy.java

@@ -198,5 +198,13 @@ public class BillSubsidy extends BaseEntity implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDate revokeTime;
 
+    /*
+     * 0未上传验收,1未发放,2已发放'
+     * */
+    private Integer isPay;
 
+    /**
+     * 支付凭证
+     */
+    private String payImgUrl;
 }

+ 2 - 0
admin/src/main/java/com/huimv/farm/damsubsidy/service/IBillLandingInspectionService.java

@@ -20,6 +20,8 @@ public interface IBillLandingInspectionService extends IService<BillLandingInspe
 
     Result listById(HttpServletRequest httpServletRequest,Map<String,String> paramsMap);
 
+    Result addPay(HttpServletRequest httpServletRequest,Map<String,String> paramsMap);
+
     Result addApplication(HttpServletRequest httpServletRequest, BillLandingInspection billLandingInspection);
 
     Result cancelApplication(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);

+ 1 - 0
admin/src/main/java/com/huimv/farm/damsubsidy/service/IBillSubsidyService.java

@@ -30,6 +30,7 @@ public interface IBillSubsidyService extends IService<BillSubsidy> {
     Result saveApplication(HttpServletRequest httpServletRequest, BillSubsidy billSubsidy);
 
     //pc端
+    /*待受理*/
     Result listPcSub(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);
 
     Result editApplication(HttpServletRequest httpServletRequest, Map<String, String> paramsMap);

+ 59 - 91
admin/src/main/java/com/huimv/farm/damsubsidy/service/impl/BillLandingInspectionServiceImpl.java

@@ -48,123 +48,86 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
 
     @Override
     public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
-        String type = paramsMap.get("type");//信息类型
-        String date = paramsMap.get("date");
+        Integer type = Integer.parseInt(paramsMap.get("type"));//信息类型
+        String date = paramsMap.get("data");//状态
+        String pageSize = paramsMap.get("pageSize");
+        String pageNum = paramsMap.get("pageNum");
+        if (pageSize == null || pageSize == "") {
+            pageSize = "10";
+        }
+        if (pageNum == null || pageNum == "") {
+            pageNum = "1";
+        }
 
-        JSONArray jsonArray = new JSONArray();
-        if (type == "1") { //检疫申请
+        System.out.println(type);
+        if (type == 1) { //检疫申请
             QueryWrapper<BillLandingInspection> queryWrapper = new QueryWrapper<>();
             if (date == null || date == "") {
                 queryWrapper.orderByDesc("create_time");
             } else {
-                queryWrapper.orderByDesc("create_time").eq("inspection_sch",date);
-            }
-            List<BillLandingInspection> billLandingInspections = billLandingInspectionMapper.selectList(queryWrapper);
-            for (BillLandingInspection billLandingInspection : billLandingInspections) {
-                JSONObject jsonObject = new JSONObject();
-                jsonObject.put("name", billLandingInspection.getInspectionName());
-                jsonObject.put("id", billLandingInspection.getId());
-                jsonObject.put("time", billLandingInspection.getCreateTime());
-                jsonObject.put("state", billLandingInspection.getInspectionSch());
-                jsonObject.put("num", billLandingInspection.getInspectionNum());
-                jsonArray.add(jsonObject);
+                queryWrapper.orderByDesc("create_time").eq("inspection_sch", date);
             }
-            return new Result(ResultCode.SUCCESS, jsonArray);
+            Page<BillLandingInspection> billLandingInspectionPage = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+            return new Result(ResultCode.SUCCESS, billLandingInspectionMapper.selectPage(billLandingInspectionPage, queryWrapper));
         }
         //交易信息
-        if (type == "2") {
+        if (type == 2) {
             QueryWrapper<BillBuyInfo> queryWrapper = new QueryWrapper<>();
             queryWrapper.orderByDesc("create_time");
-            List<BillBuyInfo> billBuyInfos = buyInfoMapper.selectList(queryWrapper);
-            for (BillBuyInfo billBuyInfo : billBuyInfos) {
-                JSONObject jsonObject = new JSONObject();
-                jsonObject.put("name", billBuyInfo.getBuyName());
-                jsonObject.put("id", billBuyInfo.getId());
-                jsonObject.put("time", billBuyInfo.getCreateTime());
-                jsonObject.put("num", billBuyInfo.getInspectionNum());
-                jsonArray.add(jsonObject);
-            }
-            return new Result(ResultCode.SUCCESS, jsonArray);
+            Page<BillBuyInfo> buyInfoPage = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+            return new Result(ResultCode.SUCCESS, buyInfoMapper.selectPage(buyInfoPage, queryWrapper));
         }
         //补贴申请
-        if (type == "3") {
+        if (type == 3) {
             QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
             queryWrapper.orderByDesc("create_time");
-            List<BillSubsidy> billSubsidies = subsidyMapper.selectList(queryWrapper);
-            for (BillSubsidy billSubsidy : billSubsidies) {
-                JSONObject jsonObject = new JSONObject();
-                jsonObject.put("name", billSubsidy.getSubsidyName());
-                jsonObject.put("time", billSubsidy.getCreateTime());
-                jsonObject.put("id", billSubsidy.getId());
-                jsonObject.put("num", billSubsidy.getInspectionNum());
-                jsonArray.add(jsonObject);
-            }
+            Page<BillSubsidy> subsidyPage = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+            return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(subsidyPage, queryWrapper));
         }
         //验收信息
-        if (type == "4") {
+        if (type == 4) {
             QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
             queryWrapper.orderByDesc("create_time");
-
-            List<BillSubsidy> billSubsidies = subsidyMapper.selectList(queryWrapper);
-            for (BillSubsidy billSubsidy : billSubsidies) {
-                JSONObject jsonObject = new JSONObject();
-                jsonObject.put("name", billSubsidy.getSubsidyName());
-                jsonObject.put("time", billSubsidy.getCreateTime());
-                jsonObject.put("state", billSubsidy.getSubsidySch());
-                jsonObject.put("id", billSubsidy.getId());
-                jsonObject.put("num", billSubsidy.getInspectionNum());
-                jsonArray.add(jsonObject);
-            }
+            Page<BillSubsidy> subsidyPage = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+            return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(subsidyPage, queryWrapper));
         }
         //支付信息
-        if (type == "5") {
+        if (type == 5) {
             QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
             queryWrapper.orderByDesc("create_time").eq("subsidy_sch", 3);
-            List<BillSubsidy> billSubsidies = subsidyMapper.selectList(queryWrapper);
-            for (BillSubsidy billSubsidy : billSubsidies) {
-                JSONObject jsonObject = new JSONObject();
-                jsonObject.put("name", billSubsidy.getFarmerName() + "的支付信息");
-                if (ObjectUtil.isEmpty(billSubsidy.getPayTime())) {
-                    jsonObject.put("state", "未支付");
-                } else {
-                    jsonObject.put("state", "已支付");
-                }
-                jsonObject.put("id", billSubsidy.getId());
-                jsonObject.put("time", billSubsidy.getCreateTime());
-                jsonObject.put("num", billSubsidy.getInspectionNum());
-                jsonArray.add(jsonObject);
-            }
+            Page<BillSubsidy> subsidyPage = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+            return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(subsidyPage, queryWrapper));
         }
-        return new Result(ResultCode.SUCCESS, jsonArray);
+        return new Result(ResultCode.FAIL);
     }
 
     @Override
     public Result listById(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
         Integer id = Integer.valueOf(paramsMap.get("id"));
-        String num = paramsMap.get("num");
-        String type = paramsMap.get("type");
+        String num = paramsMap.get("num");//检疫证号
+        Integer type = Integer.parseInt(paramsMap.get("type"));//消息类型
         JSONObject jsonObject = new JSONObject();
-        if (type == "1") {
+        if (type == 1) {
             //检疫
             jsonObject.put("data1", billLandingInspectionMapper.selectById(id));
             jsonObject.put("data2", isolatedMapper.selectOne(new QueryWrapper<BillIsolated>().eq("inspection_num", num)));
         }
-        if (type == "2") {
+        if (type == 2) {
             //交易
             jsonObject.put("data1", buyInfoMapper.selectById(id));
             jsonObject.put("data2", billLandingInspectionMapper.selectOne(new QueryWrapper<BillLandingInspection>().eq("inspection_num", num)));
         }
-        if (type == "3") {
+        if (type == 3) {
             //补贴
             jsonObject.put("data1", subsidyMapper.selectById(id));
-            jsonObject.put("data2","");
+            jsonObject.put("data2", "");
         }
-        if (type == "4") {
+        if (type == 4) {
             //验收
             jsonObject.put("data1", subsidyMapper.selectById(id));
-            jsonObject.put("data2","");
+            jsonObject.put("data2", "");
         }
-        if (type == "5") {
+        if (type == 5) {
             //支付
             jsonObject.put("data1", subsidyMapper.selectById(id));
             jsonObject.put("data2", "");
@@ -174,19 +137,30 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
     }
 
     @Override
+    public Result addPay(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
+        String id = paramsMap.get("id");
+        String url = paramsMap.get("url");
+        BillSubsidy billSubsidy = subsidyMapper.selectById(id);
+        billSubsidy.setPayImgUrl(url);
+        billSubsidy.setIsPay(2);
+        subsidyMapper.updateById(billSubsidy);
+        return new Result(ResultCode.SUCCESS);
+    }
+
+    @Override
     public Result addApplication(HttpServletRequest httpServletRequest, BillLandingInspection billLandingInspection) {
         QueryWrapper<BillLandingInspection> landingInspectionQueryWrapper = new QueryWrapper<>();
-        landingInspectionQueryWrapper.eq("inspection_num",billLandingInspection.getInspectionNum());
-        if (this.count(landingInspectionQueryWrapper) != 0){
-            return new Result(10001,"存在相同检疫证号!",false);
+        landingInspectionQueryWrapper.eq("inspection_num", billLandingInspection.getInspectionNum());
+        if (this.count(landingInspectionQueryWrapper) != 0) {
+            return new Result(10001, "存在相同检疫证号!", false);
         }
-        billLandingInspection.setInspectionName(TokenSign.getUserName(httpServletRequest)+"的落地检疫申请");
+        billLandingInspection.setInspectionName(TokenSign.getUserName(httpServletRequest) + "的落地检疫申请");
         billLandingInspection.setCreateTime(DateTime.now());
         billLandingInspection.setCreateUser(TokenSign.getUserName(httpServletRequest));
         billLandingInspection.setInspectionType(0);
-        if (this.save(billLandingInspection)){
+        if (this.save(billLandingInspection)) {
             return Result.SUCCESS();
-        }else {
+        } else {
             return Result.FAIL();
         }
     }
@@ -210,8 +184,6 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
 
     @Override
     public Result listApplication(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
-        String pageNum = paramsMap.get("pageNum");
-        String pageSize = paramsMap.get("pageSize");
         String startTime = paramsMap.get("startTime");
         String endTime = paramsMap.get("endTime");
         String inspectionSch = paramsMap.get("inspectionSch");
@@ -233,15 +205,10 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
             landingInspectionQueryWrapper.le("create_time",endTime);
         }
         if (ObjectUtil.isNotEmpty(inspectionSch)){
-            if (inspectionSch.equals("4")){
-                landingInspectionQueryWrapper.eq("inspection_sch",4).or().eq("inspection_sch",5);
-            }else {
-                landingInspectionQueryWrapper.eq("inspection_sch",inspectionSch);
-            }
+            landingInspectionQueryWrapper.eq("inspection_sch",inspectionSch);
         }
         landingInspectionQueryWrapper.orderByDesc("create_time");
-        Page<BillLandingInspection> page = new Page(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
-        return new Result(ResultCode.SUCCESS,billLandingInspectionMapper.selectPage(page,landingInspectionQueryWrapper));
+        return new Result(ResultCode.SUCCESS,billLandingInspectionMapper.selectList(landingInspectionQueryWrapper));
     }
 
     @Override
@@ -249,7 +216,8 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
         String id = paramsMap.get("id");
         String rejectReason = paramsMap.get("rejectReason");
         BillLandingInspection billLandingInspection = this.getById(id);
-        billLandingInspection.setInspectionSch(5);
+//        billLandingInspection.setInspectionSch(4);
+        billLandingInspection.setInspectionSch(3);
         billLandingInspection.setRejectReason(rejectReason);
         billLandingInspection.setReviewed(TokenSign.getUserName(httpServletRequest));
         billLandingInspection.setReviewedTime(DateTime.now());
@@ -261,7 +229,7 @@ public class BillLandingInspectionServiceImpl extends ServiceImpl<BillLandingIns
     public Result agreeApplication(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
         String id = paramsMap.get("id");
         BillLandingInspection landingInspection = this.getById(id);
-        landingInspection.setInspectionSch(2);
+        landingInspection.setInspectionSch(1);
         landingInspection.setReviewed(TokenSign.getUserName(httpServletRequest));
         landingInspection.setReviewedTime(DateTime.now());
         if (this.updateById(landingInspection)){

+ 59 - 43
admin/src/main/java/com/huimv/farm/damsubsidy/service/impl/BillSubsidyServiceImpl.java

@@ -46,46 +46,42 @@ import java.util.Map;
 @Service
 public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillSubsidy> implements IBillSubsidyService {
 
-    @Resource
+    @Autowired
     private BillSubsidyMapper subsidyMapper;
-    @Resource
+    @Autowired
     private SysUserMapper sysUserMapper;
 
     @Override
     public Result list(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
-        Integer subsidySch = Integer.valueOf(paramsMap.get("subsidySch"));
-        String startTime = paramsMap.get("startTime");
-        String endTime = paramsMap.get("endTime");
-
-
-        if (startTime != null) {
-            startTime = startTime + " 00:00:00";
+        String type = paramsMap.get("subsidySch");
+        String pageSize = paramsMap.get("pageSize");
+        String pageNum = paramsMap.get("pageNum");
+        if (pageSize == null || pageSize == "") {
+            pageSize = "10";
         }
-        if (endTime != null) {
-            endTime = endTime + " 23:59:59";
+        if (pageNum == null || pageNum == "") {
+            pageNum = "1";
         }
 
-        //从近到远
         QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
+        if (type == null || type == "") {
+            queryWrapper.orderByDesc("sub_time");
+        } else {
+            queryWrapper.eq("subsidy_sch", type).orderByDesc("sub_time");
+        }
+        Page<BillSubsidy> page = new Page(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+//        List<BillSubsidy> billSubsidies = subsidyMapper.selectList(queryWrapper);
 
-            if (subsidySch == 7) { //全部进度
-                queryWrapper.orderByDesc("sub_time").between("sub_time",startTime,endTime);
-            } else {
-                queryWrapper.eq("subsidy_sch", subsidySch).orderByDesc("sub_time")
-                        .between("sub_time",startTime,endTime);
-            }
-            queryWrapper.eq("phone", paramsMap.get("phone"));
-            List<BillSubsidy> billSubsidies = subsidyMapper.selectList(queryWrapper);
-            JSONArray jsonArray = new JSONArray();
-            for (BillSubsidy billSubsidy : billSubsidies) {
-                JSONObject jsonObject = new JSONObject();
-                jsonObject.put("name", billSubsidy.getSubsidyName());
-                jsonObject.put("date", billSubsidy.getSubTime());
-                jsonObject.put("state", billSubsidy.getSubsidySch());
-                jsonObject.put("id", billSubsidy.getId());
-                jsonArray.add(jsonObject);
-            }
-            return new Result(ResultCode.SUCCESS, jsonArray);
+//        JSONArray jsonArray = new JSONArray();
+//        for (BillSubsidy billSubsidy : billSubsidies) {
+//            JSONObject jsonObject = new JSONObject();
+//            jsonObject.put("name", billSubsidy.getSubsidyName());
+//            jsonObject.put("date", billSubsidy.getSubTime());
+//            jsonObject.put("state", billSubsidy.getSubsidySch());
+//            jsonObject.put("id", billSubsidy.getId());
+//            jsonArray.add(jsonObject);
+//        }
+        return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(page, queryWrapper));
     }
 
     @Override
@@ -98,11 +94,11 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
 
     @Override
     public Result edit(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
-        String type = paramsMap.get("type");
+        Integer type = Integer.parseInt(paramsMap.get("type"));
         String id = paramsMap.get("id");
-        String stateType = paramsMap.get("stateType");
+        Integer stateType = Integer.parseInt(paramsMap.get("stateType"));
         //拒绝
-        if (type == "1") {
+        if (type == 1) {
             String refuseReason = paramsMap.get("refuseReason"); //拒绝理由
             if (refuseReason == "" || refuseReason == null) {
                 return new Result(ResultCode.FAIL, "拒绝理由不能为空!");
@@ -118,7 +114,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
             QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("id", id);
             BillSubsidy billSubsidy = subsidyMapper.selectOne(queryWrapper);
-            if (stateType == "1") { //驳回
+            if (stateType == 1) { //驳回
                 String rejectReason = paramsMap.get("rejectReason");
                 String workAccptUrl = paramsMap.get("workAccptUrl");
                 if (rejectReason == null || rejectReason == "") {
@@ -138,9 +134,11 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
                 billSubsidy.setAcceptTime(new Date());
                 String workAccptUrl = paramsMap.get("workAccptUrl");
                 if (workAccptUrl == null || workAccptUrl == "") {
-                    return new Result(ResultCode.FAIL, "工作验收表不能为空!");
+                    billSubsidy.setIsPay(0);
+                } else {
+                    billSubsidy.setWorkAccptUrl(workAccptUrl);
+                    billSubsidy.setIsPay(1);
                 }
-                billSubsidy.setWorkAccptUrl(workAccptUrl);
                 billSubsidy.setReviewedTime(new Date());
                 subsidyMapper.insert(billSubsidy);
                 return new Result(ResultCode.SUCCESS, "更新状态成功!");
@@ -170,6 +168,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
         }
         return new Result(ResultCode.SUCCESS, "更新状态成功!");
     }
+
     @Resource
     private BaseAnimalMapper baseAnimalMapper;
 
@@ -227,7 +226,24 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
 
     @Override
     public Result listPcSub(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
-        return null;
+        String userName = paramsMap.get("userName");
+        String date = paramsMap.get("date");
+        String pageSize = paramsMap.get("pageSize");
+        String pageNum = paramsMap.get("pageNum");
+        String type = paramsMap.get("type");
+        if (pageSize == null || pageSize == "") {
+            pageSize = "10";
+        }
+        if (pageNum == null || pageNum == "") {
+            pageNum = "1";
+        }
+        if (date != "") {
+            date = date + " 00:00:00";
+        }
+        QueryWrapper<BillSubsidy> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("sub_time", date).like("farmer_name", userName).eq("subsidy_sch",type);
+        Page<BillSubsidy> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+        return new Result(ResultCode.SUCCESS, subsidyMapper.selectPage(page, queryWrapper));
     }
 
     @Override
@@ -247,7 +263,7 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
 //            }
 //            return Result.SUCCESS();
 //        }
-        if ("1".equals(type)){
+        if ("1".equals(type)) {
             List<BaseAnimal> baseAnimals = baseAnimalMapper.selectList(new QueryWrapper<BaseAnimal>().eq("inspection_num", billSubsidy.getInspectionNum()));
             for (BaseAnimal baseAnimal : baseAnimals) {
                 baseAnimal.setIsLoated(0);
@@ -255,15 +271,15 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
             }
             this.removeById(billSubsidy);
             return Result.SUCCESS();
-        }else {
+        } else {
 //          养殖户申诉不通过补贴申请
             String appeal = paramsMap.get("appeal");
             billSubsidy.setAppeal(appeal);
             billSubsidy.setSubsidySch(5);
             billSubsidy.setAppealTime(new Date());
-            if (this.save(billSubsidy)){
+            if (this.save(billSubsidy)) {
                 return Result.SUCCESS();
-            }else {
+            } else {
                 return Result.ERROR();
             }
         }
@@ -281,8 +297,8 @@ public class BillSubsidyServiceImpl extends ServiceImpl<BillSubsidyMapper, BillS
 
         QueryWrapper<BillSubsidy> subsidyQueryWrapper = new QueryWrapper<>();
 
-        if (userType == 2 || userType == 3){
-            subsidyQueryWrapper.eq("creat_user",userName);
+        if (userType == 2 || userType == 3) {
+            subsidyQueryWrapper.eq("creat_user", userName);
         }
 //        if (startTime != null) {
 //            startTime = startTime + " 00:00:00";

+ 25 - 17
admin/src/main/java/com/huimv/farm/damsubsidy/service/impl/SysUserServiceImpl.java

@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.huimv.farm.damsubsidy.common.utils.Result;
 import com.huimv.farm.damsubsidy.common.utils.ResultCode;
+import com.huimv.farm.damsubsidy.entity.PovertyUserRegist;
 import com.huimv.farm.damsubsidy.entity.SysUser;
+import com.huimv.farm.damsubsidy.mapper.PovertyUserRegistMapper;
 import com.huimv.farm.damsubsidy.mapper.SysUserMapper;
 import com.huimv.farm.damsubsidy.service.ISysUserService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -33,6 +35,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 
     @Autowired
     private SysUserMapper userMapper;
+    @Autowired
+    private PovertyUserRegistMapper povertyUserRegistMapper;
     @Override
     public Result loginMultilevel(HttpServletRequest httpServletRequest, Map<String,String> paramsMap) {
         //TODO 验证码接口暂时不写,验证码验证接口写在此接口之前,这里默认验证码已经正确!
@@ -75,7 +79,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         SysUser user = new SysUser();
         user.setUserType(Integer.parseInt(paramsMap.get("type")));
         user.setUserName(paramsMap.get("userName"));
-        user.setIdCard(paramsMap.get("idCord"));
+        user.setIdCard(paramsMap.get("idCard"));
         user.setPhone(paramsMap.get("phone"));
         user.setIdCardFrontUrl(paramsMap.get("idCordFrontUrl"));
         user.setIdCardBackUrl(paramsMap.get("idCordBackUrl"));
@@ -84,6 +88,18 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         if (ObjectUtil.isNotEmpty(paramsMap.get("address"))) {
             user.setAddress(paramsMap.get("address"));
         }
+        if (Integer.parseInt(paramsMap.get("type")) == 3) {
+            QueryWrapper<PovertyUserRegist> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("XM", paramsMap.get("userName")).eq("ZJHM", paramsMap.get("idCard"));
+            PovertyUserRegist povertyUserRegist = povertyUserRegistMapper.selectOne(queryWrapper);
+            if (ObjectUtil.isEmpty(povertyUserRegist)) {
+                user.setFarmType(2);
+            } else if (povertyUserRegist.getIsDelete() == 1) {
+                user.setFarmType(1);
+            } else {
+                user.setFarmType(0);
+            }
+        }
         user.setAccoutType(0);
         user.setIsRealName(1);
 
@@ -129,8 +145,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 
     @Override
     public Result listPc(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
-        String startTime = paramsMap.get("startTime");
-        String endTime = paramsMap.get("endTime");
+        String date = paramsMap.get("date");
         String word = paramsMap.get("word");
         String role = paramsMap.get("role");
         String pageSize = paramsMap.get("pageSize");
@@ -142,15 +157,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         if (pageNum == null || pageNum == "") {
             pageNum = "1";
         }
-        if (startTime != "") {
-            startTime = startTime + " 00:00:00";
-        }
-        if (endTime != "") {
-            endTime = endTime + " 23:59:59";
+        if (date != "") {
+            date = date + " 00:00:00";
         }
 
         QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("accout_type", 0).between("create_time", startTime, endTime)
+        queryWrapper.eq("accout_type", 0).ge("create_time", date)
                 .eq("user_type", role).like("user_name", word).or().like("phone", word)
                 .or().like("id_card", word);
 
@@ -167,8 +179,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 
     @Override
     public Result listPc2(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
-        String startTime = paramsMap.get("startTime");
-        String endTime = paramsMap.get("endTime");
+        String date = paramsMap.get("startTime");
         String word = paramsMap.get("word");
         String role = paramsMap.get("role");
         String pageSize = paramsMap.get("pageSize");
@@ -180,14 +191,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         if (pageNum == null || pageNum == "") {
             pageNum = "1";
         }
-        if (startTime != "") {
-            startTime = startTime + " 00:00:00";
-        }
-        if (endTime != "") {
-            endTime = endTime + " 23:59:59";
+        if (date != "") {
+            date = date + " 00:00:00";
         }
         QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("accout_type", 1).or().eq("accout_typr",4).between("create_time", startTime, endTime)
+        queryWrapper.eq("accout_type", 1).or().eq("accout_typr",4).ge("create_time", date)
                 .eq("user_type", role).like("user_name", word).or().like("phone", word)
                 .or().like("id_card", word);
 

+ 18 - 0
admin/src/main/java/com/huimv/farm/test/ExcelToPDF.java

@@ -0,0 +1,18 @@
+//package com.huimv.farm.test;
+//
+//
+//import com.spire.xls.FileFormat;
+//import com.spire.xls.Workbook;
+//
+//public class ExcelToPDF {
+//    public static void main(String[] args) {
+//        //加载Excel文档
+//        Workbook wb = new Workbook();
+//        wb.loadFromFile("I://order_contract.xls");
+//
+//        //调用方法保存为PDF格式
+//        wb.saveToFile("I://ToPDF.pdf", FileFormat.PDF);
+//    }
+//
+//
+//}

+ 96 - 0
admin/src/main/java/com/huimv/farm/test/Print.java

@@ -0,0 +1,96 @@
+package com.huimv.farm.test;
+
+import com.huimv.farm.damsubsidy.entity.BillSubsidy;
+import org.jxls.common.Context;
+import org.jxls.util.JxlsHelper;
+import org.jxls.util.Util;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Print {
+    /**
+     * 打印方法  不插入图片
+     * @throws Exception
+     * @return
+     */
+    public  String print(BillSubsidy subsidy) throws Exception {
+        //准备数据
+
+        //获取模板文件,你自己当前模板的位置  我这里为当前项目下
+        //如果为系统路径 为: InputStream is = new FileInputStream("F://student.xlsx");
+        InputStream is = new FileInputStream("I://order_contract.xlsx");
+//        InputStream is = Print.class.getClassLoader().getResourceAsStream("student.xlsx");
+//        InputStream is = Print.class.getClassLoader().getResourceAsStream("order_contract.xls");
+        //根据模板生成的文件保存路径  我这里保存在本地D盘
+        OutputStream os = new FileOutputStream("I://order_contract.xls");
+        //绑定数据
+        Context context = new Context();
+        //涉及太多只写了一个单独的
+        context.putVar("userName", subsidy.getFarmerName());
+//        context.putVar("orderTime", new Date());
+        context.putVar("address",subsidy.getCargoOwnedetailedAdressr());
+        context.putVar("type",subsidy.getFarmerType());
+        context.putVar("farmName",subsidy.getFarmName());
+        context.putVar("idCard",subsidy.getIdCard());
+        context.putVar("phone", subsidy.getPhone());
+        context.putVar("num1", subsidy.getExistNum());
+        context.putVar("num2", subsidy.getImportNum());
+        context.putVar("typeAum", subsidy.getRewardType());
+        context.putVar("num3", subsidy.getRewardNum());
+        context.putVar("context1", subsidy.getRewardLastYear());
+        context.putVar("card", subsidy.getInspectionNum());
+        context.putVar("context2", subsidy.getLoanInfo());
+        context.putVar("earNum", subsidy.getEartagNo());
+        context.putVar("money", subsidy.getApplyMoney());
+        context.putVar("userNum", subsidy.getBankCardId());
+        //生成
+        JxlsHelper.getInstance().processTemplate(is, os, context);
+        String path = String.valueOf(os);
+        return path;
+    }
+
+
+//    /**
+//     * 打印方法  不插入图片
+//     *
+//     * 模板文件为student1.xlsx
+//     * 注意事项:模板文件新加入了一行,所以整体范围也就有所改变,大家注意一下批注中的结束范围
+//     * 图片所占用的范围为B2到C2
+//     *
+//     *
+//     * @throws Exception
+//     */
+//    public static void print1() throws Exception {
+//        //准备数据
+//
+//        //获取模板文件,你自己当前模板的位置  我这里为当前项目下
+//        //如果为系统路径 为: InputStream is = new FileInputStream("F://student.xlsx");
+//        InputStream is = Print.class.getClassLoader().getResourceAsStream("student1.xlsx");
+//        //根据模板生成的文件保存路径  我这里保存在本地D盘
+//        OutputStream os = new FileOutputStream("D://student1.xlsx");
+//
+//        //图片路径
+//        InputStream imageInputStream =Print.class.getClassLoader().getResourceAsStream("a.png");
+//        //转为字节码,插入的图片只能是字节码格式
+//        byte[] imageBytes = Util.toByteArray(imageInputStream);
+//        //绑定数据
+//        Context context = new Context();
+//        context.putVar("imageBytes", imageBytes);
+//        context.putVar("title", "学上统计表");
+////        context.putVar("list", list);
+//        //生成
+//        JxlsHelper.getInstance().processTemplate(is, os, context);
+//    }
+//
+//    public static void main(String[] args) throws Exception {
+//        print();
+////        print1();
+//    }
+
+}