Browse Source

首页信息

LiFei 5 years ago
parent
commit
81cabe1902

+ 2 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlworder/mapper/HlwOrderMapper.java

@@ -18,4 +18,6 @@ public interface HlwOrderMapper extends BaseMapper<HlwOrder> {
     List<HlwOrder> getList(@Param("idcardNumber")String idcardNumber,@Param("subcontractorId") Integer subcontractorId,@Param("applicationId") Integer applicationId);
 
     List<HlwOrder> getListByApplicationId(Page<HlwOrder> page,@Param("applicationId") Integer applicationId);
+
+    int findSumOrder();
 }

+ 7 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlworder/mapper/xml/HlwOrderMapper.xml

@@ -26,4 +26,11 @@
         and a.work_contract is null
         and hr.application_id=#{applicationId}
     </select>
+
+
+    <select id="findSumOrder" resultType="int">
+        SELECT
+          ifnull(sum(a.id),0)
+        FROM hlw_order a
+    </select>
 </mapper>

+ 35 - 5
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/controller/HlwPaymentController.java

@@ -1,12 +1,10 @@
 package org.jeecg.modules.hlwpayment.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
@@ -21,11 +19,14 @@ import org.jeecg.modules.hlwcpmanager.service.IHlwCpSettingService;
 import org.jeecg.modules.hlwcpmanager.service.IHlwCpSubcontractorService;
 import org.jeecg.modules.hlworder.entity.HlwOrder;
 import org.jeecg.modules.hlworder.entity.HlwRequirement;
+import org.jeecg.modules.hlworder.mapper.HlwOrderMapper;
 import org.jeecg.modules.hlworder.service.IHlwOrderService;
 import org.jeecg.modules.hlworder.service.IHlwRequirementService;
 import org.jeecg.modules.hlwpayment.entity.HlwPayment;
 import org.jeecg.modules.hlwpayment.entity.HlwPaymentDetail;
+import org.jeecg.modules.hlwpayment.mapper.HlwPaymentDetailMapper;
 import org.jeecg.modules.hlwpayment.service.IHlwPaymentService;
+import org.jeecg.modules.hlwuser.mapper.HlwUserMapper;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
@@ -34,6 +35,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
@@ -41,8 +43,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import static org.jeecg.common.util.DateUtils.now;
-
 /**
  * @Description: 付款信息表
  * @Author: jeecg-boot
@@ -68,6 +68,10 @@ public class HlwPaymentController extends JeecgController<HlwPayment, IHlwPaymen
     private IHlwRequirementService hlwRequirementService;
     @Value(value = "${jeecg.oss.aliyunUrl}")
     private String aliyunUrl;
+    @Resource
+    private HlwUserMapper hlwUserMapper;
+    @Resource
+    private HlwOrderMapper hlwOrderMapper;
 
     /**
      * 分页列表查询
@@ -127,7 +131,7 @@ public class HlwPaymentController extends JeecgController<HlwPayment, IHlwPaymen
             pageList.getRecords().get(0).setSumTaxPayment(sumTaxPayment);
             pageList.getRecords().get(0).setSumCompanyNumber(list.size());
             pageList.getRecords().get(0).setSumPaymentNumber(paymentNumber);
-            for (int i = 0; i <pageList.getRecords().size() ; i++) {
+            for (int i = 0; i < pageList.getRecords().size(); i++) {
                 pageList.getRecords().get(i).setPersonalTaxPayment(businessAccountUtils.round(businessAccountUtils.mul(businessAccountUtils.div(pageList.getRecords().get(i).getPersonalNetPayment(), 1.06), 0.06), 2));
             }
         }
@@ -576,4 +580,30 @@ public class HlwPaymentController extends JeecgController<HlwPayment, IHlwPaymen
         return super.importExcel(request, response, HlwPayment.class);
     }
 
+
+    /**
+     * 查询首页所需信息
+     *
+     * @param
+     * @return
+     */
+    @AutoLog(value = "查询首页所需信息")
+    @ApiOperation(value = "查询首页所需信息", notes = "查询首页所需信息")
+    @PutMapping(value = "/getInfo")
+    public Result<?> getInfo() {
+        List list = new ArrayList();
+        int sumUser = hlwUserMapper.findSumUser();
+        int sumOrder = hlwOrderMapper.findSumOrder();
+        //查询总付款数
+        int sumPayment = hlwPaymentService.findSumPayment();
+        //查询总付款数(已付款)
+        int sumPaymentComplete = hlwPaymentService.findSumPaymentComplete();
+        list.add(sumUser);
+        list.add(sumOrder);
+        list.add(sumPayment);
+        list.add(sumPaymentComplete);
+        return Result.ok(list);
+    }
+
+
 }

+ 4 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/mapper/HlwPaymentMapper.java

@@ -40,4 +40,8 @@ public interface HlwPaymentMapper extends BaseMapper<HlwPayment> {
     List<HlwPayment> findListByCompanyIdAndSunId(@Param("companyId")Integer companyId, @Param("subcontractorId")Integer subcontractorId);
 
     List<HlwPayment> findHlwPaymentList();
+
+    int findSumPayment();
+
+    int findSumPaymentComplete();
 }

+ 15 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/mapper/xml/HlwPaymentMapper.xml

@@ -490,4 +490,19 @@
 		 and a.del_flag = '0'
 		 order by a.create_time desc
 	</select>
+
+
+	<select id="findSumPayment" resultType="int" >
+		SELECT
+		   ifnull(sum(a.id),0)
+		FROM hlw_payment a
+		WHERE  a.del_flag='0'
+	</select>
+
+	<select id="findSumPaymentComplete" resultType="int" >
+		SELECT
+		  ifnull(sum(a.id),0)
+		FROM hlw_payment a
+		WHERE  a.del_flag='0' and a.status=3
+	</select>
 </mapper>

+ 4 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/service/IHlwPaymentService.java

@@ -55,4 +55,8 @@ public interface IHlwPaymentService extends IService<HlwPayment> {
     List<HlwPayment> findListByCompanyIdAndSunId(Integer companyId, Integer subcontractorId);
 
     List<HlwPayment> findHlwPaymentList();
+
+    int findSumPayment();
+
+    int findSumPaymentComplete();
 }

+ 11 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/service/impl/HlwPaymentServiceImpl.java

@@ -1195,4 +1195,15 @@ public class HlwPaymentServiceImpl extends ServiceImpl<HlwPaymentMapper, HlwPaym
     public List<HlwPayment> findHlwPaymentList() {
         return baseMapper.findHlwPaymentList();
     }
+
+
+    @Override
+    public int findSumPayment() {
+        return baseMapper.findSumPayment();
+    }
+
+    @Override
+    public int findSumPaymentComplete() {
+        return baseMapper.findSumPaymentComplete();
+    }
 }

+ 2 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwuser/mapper/HlwUserMapper.java

@@ -17,4 +17,6 @@ public interface HlwUserMapper extends BaseMapper<HlwUser> {
     HlwUser getByIdcardNumber(@Param("hlwUser")HlwUser hlwUser);
 
     HlwUser getByUserCode(String userCode);
+
+    int findSumUser();
 }

+ 7 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwuser/mapper/xml/HlwUserMapper.xml

@@ -29,4 +29,11 @@
         FROM hlw_user a
         WHERE a.user_code = #{0}
     </select>
+
+
+    <select id="findSumUser" resultType="int">
+        SELECT
+            ifnull(sum(a.id),0)
+        FROM hlw_user a
+    </select>
 </mapper>