Ver código fonte

会费公示

jz.kai 4 anos atrás
pai
commit
e41817e51b

+ 2 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/dao/BillInfoDAO.java

@@ -1,5 +1,6 @@
 package com.jpsoft.enterprise.modules.base.dao;
 
+import com.jpsoft.enterprise.modules.base.dto.DueListDTO;
 import com.jpsoft.enterprise.modules.base.entity.BillInfo;
 import com.jpsoft.enterprise.modules.common.dto.Sort;
 import org.springframework.stereotype.Repository;
@@ -20,4 +21,5 @@ public interface BillInfoDAO {
     int delete(String id);
     List<BillInfo> list();
     List<BillInfo> search(Map<String,Object> searchParams, List<Sort> sortList);
+    List<DueListDTO> dueList();
 }

+ 21 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/dto/DueListDTO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.enterprise.modules.base.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class DueListDTO {
+    @ApiModelProperty(value = "企业名称")
+    private String companyName;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @ApiModelProperty(value = "缴费时间")
+    private Date payTime;
+}

+ 2 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/service/BillInfoService.java

@@ -1,6 +1,7 @@
 package com.jpsoft.enterprise.modules.base.service;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.enterprise.modules.base.dto.DueListDTO;
 import com.jpsoft.enterprise.modules.base.entity.BillInfo;
 import com.jpsoft.enterprise.modules.common.dto.Sort;
 
@@ -21,4 +22,5 @@ public interface BillInfoService {
     int delete(String id);
     List<BillInfo> list();
     Page<BillInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
+    List<DueListDTO> dueList();
 }

+ 7 - 0
common/src/main/java/com/jpsoft/enterprise/modules/base/service/impl/BillInfoServiceImpl.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper;
 import com.jpsoft.enterprise.modules.base.dao.BillDetailInfoDAO;
 import com.jpsoft.enterprise.modules.base.dao.BillInfoDAO;
 import com.jpsoft.enterprise.modules.base.dao.OrderInfoDAO;
+import com.jpsoft.enterprise.modules.base.dto.DueListDTO;
 import com.jpsoft.enterprise.modules.base.entity.BillDetailInfo;
 import com.jpsoft.enterprise.modules.base.entity.BillInfo;
 import com.jpsoft.enterprise.modules.base.entity.OrderInfo;
@@ -111,4 +112,10 @@ public class BillInfoServiceImpl implements BillInfoService {
 
         return page;
     }
+
+    @Override
+    public List<DueListDTO> dueList() {
+        // TODO Auto-generated method stub
+        return billInfoDAO.dueList();
+    }
 }

+ 13 - 0
common/src/main/resources/mapper/base/BillInfo.xml

@@ -102,4 +102,17 @@
         </foreach>
     </select>
 
+    <resultMap id="DueListDTOMap" type="com.jpsoft.enterprise.modules.base.dto.DueListDTO">
+        <result property="companyName" column="company_name" />
+        <result property="payTime" column="pay_time" />
+    </resultMap>
+    <select id="dueList" resultMap="DueListDTOMap">
+        SELECT c.company_name,d.pay_time FROM base_bill_info a
+        LEFT JOIN base_bill_detail_info b ON a.id_ = b.bill_id
+        LEFT JOIN base_company_info c ON b.company_id = c.id_
+        LEFT JOIN base_order_info d ON b.order_id = d.id_
+        WHERE a.wx_show = TRUE
+        AND d.pay_time IS NOT NULL
+        ORDER BY d.pay_time ASC
+    </select>
 </mapper>

+ 57 - 0
web/src/main/java/com/jpsoft/enterprise/modules/mobile/controller/BillInfoApiController.java

@@ -0,0 +1,57 @@
+package com.jpsoft.enterprise.modules.mobile.controller;
+
+import cn.hutool.core.date.DateUtil;
+import com.github.pagehelper.Page;
+import com.jpsoft.enterprise.modules.base.dto.DueListDTO;
+import com.jpsoft.enterprise.modules.base.service.BillInfoService;
+import com.jpsoft.enterprise.modules.common.dto.MessageResult;
+import com.jpsoft.enterprise.modules.common.dto.Sort;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2021-1-4 9:24
+ */
+@RestController
+@RequestMapping("/mobile/billInfoApi")
+@Slf4j
+public class BillInfoApiController {
+    @Autowired
+    private BillInfoService billInfoService;
+
+    @PostMapping("dueList")
+    @ApiOperation(value = "会费缴费列表(公开接口)")
+    public MessageResult<List<DueListDTO>> dueList() {
+        MessageResult<List<DueListDTO>> messageResult = new MessageResult<>();
+
+        try {
+            List<DueListDTO> listDTOS = billInfoService.dueList();
+
+            messageResult.setData(listDTOS);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(),ex);
+            messageResult.setCode(400);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+}