Sfoglia il codice sorgente

Merge branch 'master' into develop

FengChaoYu 3 mesi fa
parent
commit
9c8c25cb55

+ 4 - 4
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/config/GlobalDefaultExceptionHandler.java

@@ -30,12 +30,12 @@ public class GlobalDefaultExceptionHandler {
 
         if(ex instanceof RemoteServiceException){
             //自定义错误就不抛出栈异常
-            //log.error("网络异常:",ex);
-            log.error("网络异常:"+ex.getMessage()+req.getRequestURI()+JSONObject.toJSONString(this.bodyParam(req)));
+            log.error("网络异常:",ex);
+            log.error("网络异常:"+ex+req.getRequestURI()+JSONObject.toJSONString(this.bodyParam(req)));
             return ResponseHelper.error(((RemoteServiceException) ex).getCode(),"温馨提示:"+ex.getMessage());
         }
-
-        log.error("系统错误:"+ex.getMessage()+req.getRequestURI()+JSONObject.toJSONString(this.bodyParam(req)),ex);
+        log.error("网络异常:",ex);
+        log.error("系统错误:"+ex+req.getRequestURI()+JSONObject.toJSONString(this.bodyParam(req)),ex);
         return ResponseHelper.error(501,"系统出小差了,请稍后再试");
     }
 

+ 2 - 2
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/user/UserLogic.java

@@ -1030,8 +1030,8 @@ public class UserLogic {
                         .list();
                 if (CollectionUtil.isNotEmpty(adminWebsitList)) {
                     final List<WorkerSignConfirm> signConfirms = workerSignConfirmService.lambdaQuery()
-                            .eq(WorkerSignConfirm::getCompanyWechatId, currentCompanyWechat.getCurrentCompanyWechatId())
-                            .eq(WorkerSignConfirm::getWorkerNumber, currentCompanyWechat.getUser().getWorkerNumber())
+                            .eq(WorkerSignConfirm::getCompanyWechatId, user.getCompanyWechatId())
+                            .eq(WorkerSignConfirm::getWorkerNumber, user.getWorkerNumber())
                             .list();
                     Map<String, WorkerSignConfirm> confirmMap = new HashMap<>();
                     if (CollectionUtil.isNotEmpty(signConfirms)) {

+ 60 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/settle/SettlementWorkerLogicVO.java

@@ -0,0 +1,60 @@
+package com.gree.mall.manager.bean.settle;
+
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.plus.entity.SettlementOrder;
+import com.gree.mall.manager.plus.entity.SettlementOrderItem;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel
+@Data
+@ZfireField(tbName = "a")
+public class SettlementWorkerLogicVO  {
+
+    @ApiModelProperty(value = "网点编号")
+    private String websitId;
+
+    @ApiModelProperty(value = "网点名称")
+    private String websitName;
+
+
+    @ApiModelProperty(value = "工程师编号")
+    private String workerNumber;
+
+    @ApiModelProperty(value = "工程师名称")
+    private String workerName;
+
+    @ApiModelProperty(value = "工程师手机号")
+    private String workerMobile;
+
+    @ApiModelProperty(value = "工单号")
+    private String workerOrderId;
+
+    @ApiModelProperty(value = "工单类型")
+    private String orderSmallTypeText;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty(value = "商品名称")
+    private String goodsName;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty(value = "数量")
+    private BigDecimal num;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty(value = "收费标准")
+    private BigDecimal normAmount;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty(value = "订单金额")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty(value = "支付时间")
+    private Date payTime;
+
+
+}

+ 7 - 0
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/WebsitSalesRetCMapper.java

@@ -3,6 +3,7 @@ package com.gree.mall.manager.commonmapper;
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.bean.settle.SettlementWorkerLogicVO;
 import com.gree.mall.manager.bean.websit.*;
 import com.gree.mall.manager.bean.worker.SettlementPgOrderVO;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
@@ -42,4 +43,10 @@ public interface WebsitSalesRetCMapper {
                                            @Param("overTime") String overTime,
                                            @Param("overEndTime") String overEndTime
                                               );
+
+    IPage<SettlementWorkerLogicVO> pageV3(Page page,@Param("ex") ZfireParamBean zfireParam,
+                                          @Param("companyWechatIds")List<String> companyWechatIds
+            ,@Param("orderBaseIds")List<String> orderBaseIds,
+            @Param("value")String value
+                                          );
 }

+ 26 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/websit/SettlementOrderNewController.java

@@ -4,6 +4,7 @@ import cn.hutool.core.lang.TypeReference;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.binarywang.wxpay.exception.WxPayException;
 import com.gree.mall.manager.annotation.ZfireList;
+import com.gree.mall.manager.bean.settle.SettlementWorkerLogicVO;
 import com.gree.mall.manager.bean.websit.SettlementOrderDetail;
 import com.gree.mall.manager.bean.websit.SettlementOrderLogicVO;
 import com.gree.mall.manager.bean.websit.WorkerSettlementLineVO;
@@ -11,6 +12,7 @@ import com.gree.mall.manager.bean.websit.WorkerSettlementVO;
 import com.gree.mall.manager.bean.worker.SettlementPgOrderVO;
 import com.gree.mall.manager.helper.ResponseHelper;
 import com.gree.mall.manager.logic.websit.SettlementOrderLogic;
+import com.gree.mall.manager.zfire.bean.SettlementZfireParamBean;
 import com.gree.mall.manager.zfire.bean.WorkerParamBean;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
@@ -117,4 +119,28 @@ public class SettlementOrderNewController {
     }
 
 
+
+
+    @ZfireList
+    @PostMapping("/list/pageV3")
+    @ApiOperation(value = "师傅电子支付查询")
+    public ResponseHelper<IPage<SettlementWorkerLogicVO>> pageV3(
+            @RequestBody SettlementZfireParamBean zfireParamBean
+    ) {
+        IPage<SettlementWorkerLogicVO> page = settlementOrderLogic.pageV3(zfireParamBean);
+        return ResponseHelper.success(page, new TypeReference<SettlementWorkerLogicVO>() {});
+    }
+
+    @PostMapping("/pageV3Export")
+    @ApiOperation(value = "师傅电子支付查询导出")
+    public void listPageV3Export(@RequestBody SettlementZfireParamBean zfireParamBean, HttpServletRequest request, HttpServletResponse response) throws Exception {
+        //1.组装查询条件
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
+        //2.查询要导出的内容
+        IPage<SettlementWorkerLogicVO> page = settlementOrderLogic.pageV3(zfireParamBean);
+        //3.导出
+        FieldUtils.exportData(page.getRecords(), zfireParam.getExportFields(), request, response);
+    }
+
+
 }

+ 46 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/websit/SettlementOrderLogic.java

@@ -17,6 +17,7 @@ import com.gree.mall.manager.bean.SalesCustomerPartsItemBean;
 import com.gree.mall.manager.bean.WorkerNormStockBean;
 import com.gree.mall.manager.bean.admin.AdminUserCom;
 import com.gree.mall.manager.bean.material.stock.WorkerStockDTO;
+import com.gree.mall.manager.bean.settle.SettlementWorkerLogicVO;
 import com.gree.mall.manager.bean.websit.SettlementOrderDetail;
 import com.gree.mall.manager.bean.websit.SettlementOrderLogicVO;
 import com.gree.mall.manager.bean.websit.WorkerSettlementLineVO;
@@ -37,6 +38,7 @@ import com.gree.mall.manager.logic.material.stock.WorkerStockLogic;
 import com.gree.mall.manager.plus.entity.*;
 import com.gree.mall.manager.plus.service.*;
 import com.gree.mall.manager.utils.StringUtil;
+import com.gree.mall.manager.zfire.bean.SettlementZfireParamBean;
 import com.gree.mall.manager.zfire.bean.WorkerParamBean;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
@@ -136,6 +138,10 @@ public class SettlementOrderLogic {
     @Autowired
     UserService userService;
 
+    @Autowired
+    PartsImportService partsImportService;
+
+
 
     public IPage<SettlementOrderLogicVO> pageV2(ZfireParamBean zfireParamBean) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
@@ -898,6 +904,46 @@ public class SettlementOrderLogic {
 
     }
 
+    public IPage<SettlementWorkerLogicVO> pageV3(SettlementZfireParamBean zfireParamBean) {
+
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        List<String> companyWechatIds = adminUser.getCompanyWechatIds();
+        List<String> websitIds = adminUser.getAdminWebsitIds();
+
+        List<String> orderBaseIds = new ArrayList<>();
+        List<String> mName = new ArrayList<>();
+
+        List<PartsImport> partsImportList = partsImportService.lambdaQuery()
+                .select(PartsImport::getPartName)
+                .list();
+
+        List<WebsitNormCharge> chargeList = websitNormChargeService.lambdaQuery()
+                .eq(WebsitNormCharge::getNormType, "M")
+                .select(WebsitNormCharge::getNormName)
+                .list();
+
+        mName.addAll(partsImportList.stream().map(PartsImport::getPartName).collect(Collectors.toList()));
+        mName.addAll(chargeList.stream().map(WebsitNormCharge::getNormName).collect(Collectors.toList()));
+
+        if (!StringUtil.isEmpty(zfireParamBean.getStartTime())) {
+            List<PgOrderBase> pgOrderBaseList = pgOrderBaseService.lambdaQuery()
+                    .between(PgOrderBase::getOverTime, zfireParamBean.getStartTime(), zfireParamBean.getEndTime())
+                    .select(PgOrderBase::getId).list();
+
+            orderBaseIds.addAll(pgOrderBaseList.stream().map(PgOrderBase::getId).collect(Collectors.toList()));
+        }
+
+
+        //1.组装查询条件
+        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean, SettlementWorkerLogicVO.class, adminUser);
+        IPage<SettlementWorkerLogicVO> settlementOrderLogicVOIPage = websitSalesRetCMapper.pageV3(new Page(zfireParamBean.getPageNum(),
+                        zfireParamBean.getPageSize()),
+                zfireParam
+                , companyWechatIds,orderBaseIds,zfireParamBean.getValue());
+
+        return settlementOrderLogicVOIPage;
+    }
+
 /*
 
     private void addSettlementOrder(WorkerOrder workerOrder, List<WorkerOrderItem> workerOrderItems) {

+ 26 - 0
mall-server-api/src/main/java/com/gree/mall/manager/zfire/bean/SettlementZfireParamBean.java

@@ -0,0 +1,26 @@
+package com.gree.mall.manager.zfire.bean;
+
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.gree.mall.manager.plus.entity.AdminField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+@Data
+public class SettlementZfireParamBean extends ZfireParamBean{
+
+    @ApiModelProperty(value = "开始时间")
+    private String startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    @ApiModelProperty(value = "条件内容")
+    private String value;
+
+}

+ 38 - 0
mall-server-api/src/main/resources/mapper/WebsitSalesCMapper.xml

@@ -201,4 +201,42 @@
         GROUP BY
           b.worker_number,a.order_small_type,b.websit_id
     </select>
+    <select id="pageV3" resultType="com.gree.mall.manager.bean.settle.SettlementWorkerLogicVO">
+        select
+        ${ex.selected}
+        from
+        settlement_order a
+        join settlement_order_item b on a.settlement_order_id = b.settlement_order_id
+        ${ex.query}
+
+        <if test="value != null and value !=''">
+            AND  (a.worker_name like concat('%',#{value},'%') or a.worker_mobile like concat('%',#{value},'%')
+            or a.worker_number like concat('%',#{value},'%')
+             )
+        </if>
+
+        <if test="companyWechatIds != null and companyWechatIds.size > 0">
+            AND a.company_wechat_id IN
+            <foreach item="item" index="index" collection="companyWechatIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+
+        <if test="orderBaseIds != null and orderBaseIds.size > 0">
+            AND a.worker_order_id IN
+            <foreach item="item" index="index" collection="orderBaseIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
+            AND a.websit_id IN
+            <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            order by a.create_time desc
+        </if>
+        ${ex.orderBy}
+    </select>
 </mapper>