Jelajahi Sumber

广电电渠报备接口

mac 2 tahun lalu
induk
melakukan
af2a0dc24d

+ 55 - 0
kxs-product/kxs-product-api/src/main/java/com/kxs/product/api/dto/kxsapp/gd/GdDqReportDTO.java

@@ -0,0 +1,55 @@
+package com.kxs.product.api.dto.kxsapp.gd;
+
+import com.kxs.common.core.valid.Phone;
+import com.kxs.common.core.valid.Sn;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+
+/**
+ * 广电报备-提交报备-dto
+ *
+ * @author 系统
+ * @date 2024-04-23 10:44:27
+ */
+@Data
+public class GdDqReportDTO {
+
+
+    /**
+     * sn码
+     */
+    @Schema(description = "sn码")
+    @NotBlank(message = "sn码不能为空")
+    @Sn(message = "请输入正确的SN")
+    private String gdSn;
+
+    /**
+     * 广电手机号码
+     */
+    @Schema(description = "广电手机号码")
+    @NotBlank(message = "广电手机号码不能为空")
+    @Phone
+    private String gdMobile;
+
+    /**
+     * 入网类型  0工号报备 1电渠报备
+     */
+    @NotBlank(message = "入网类型不能为空")
+    @Schema(description = "入网类型")
+    private String putType;
+
+    /**
+     * 客户姓名
+     */
+    @NotBlank(message = "客户姓名不能为空")
+    @Schema(description = "客户姓名")
+    private String putName;
+
+
+
+
+
+}

+ 5 - 0
kxs-product/kxs-product-api/src/main/java/com/kxs/product/api/dto/kxsapp/gd/GdReportDTO.java

@@ -33,6 +33,11 @@ public class GdReportDTO {
     @Sn(message = "请输入正确的SN")
     private String gdSn;
 
+    /**
+     * 入网类型  0工号报备 1电渠报备
+     */
+    @NotBlank(message = "入网类型不能为空")
+    private String putType;
 
     /**
      * 广电手机号码

+ 8 - 1
kxs-product/kxs-product-api/src/main/java/com/kxs/product/api/model/KxsGdReport.java

@@ -145,12 +145,19 @@ public class KxsGdReport extends Model<KxsGdReport> implements Serializable {
 
 
     /**
-     * 匹配状态
+     * 匹配状态 1已匹配
      */
     @Schema(description = "匹配状态")
     private Integer isCheck;
 
 
+    /**
+     * 入网类型  0工号报备 1电渠报备
+     */
+    @Schema(description = "入网类型  0工号报备 1电渠报备")
+    private String putType;
+
+
 
 
 }

+ 50 - 0
kxs-product/kxs-product-api/src/main/java/com/kxs/product/api/vo/kxsapp/gd/GdDqDotNumVO.java

@@ -0,0 +1,50 @@
+package com.kxs.product.api.vo.kxsapp.gd;
+
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * 广电报备-数量接口vo
+ *
+ * @author 系统
+ * @date 2024-04-23 10:44:27
+ */
+@Data
+@Schema(description = "广电报备-数量接口返回实体")
+public class GdDqDotNumVO implements Serializable {
+
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+
+    /**
+     * 全部
+     */
+    @Schema(description = "全部")
+    private Object allNum;
+
+
+    /**
+     * 已报备
+     */
+    @Schema(description = "已报备")
+    private Object reportNum;
+
+
+    /**
+     * 已完成
+     */
+    @Schema(description = "已完成")
+    private Object endNum;
+
+
+
+
+
+	
+
+}

+ 5 - 0
kxs-product/kxs-product-api/src/main/java/com/kxs/product/api/vo/kxsapp/gd/GdReportListVO.java

@@ -68,6 +68,11 @@ public class GdReportListVO implements Serializable {
     @Schema(description = "状态 未处理=0 已作废=-1 报备成功=1")
     private Integer status;
 
+    /**
+     * 匹配状态 1已匹配
+     */
+    private Integer isCheck;
+
 
 
 

+ 37 - 0
kxs-product/kxs-product-biz/src/main/java/com/kxs/product/biz/controller/kxsapp/GdController.java

@@ -3,6 +3,7 @@ package com.kxs.product.biz.controller.kxsapp;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.kxs.common.core.util.R;
 import com.kxs.common.security.annotation.Inner;
+import com.kxs.product.api.dto.kxsapp.gd.GdDqReportDTO;
 import com.kxs.product.api.dto.kxsapp.gd.GdReportDTO;
 import com.kxs.product.api.dto.kxsapp.gd.GdReportPutDTO;
 import com.kxs.product.api.model.KxsGdReport;
@@ -111,7 +112,43 @@ public class GdController {
         return R.ok(kxsGdReportService.report(param));
     }
 
+    /**
+     * 广电报备-电渠列表
+     *
+     * @param page 分页对象
+     * @param status 状态
+     * @param keyword 关键字
+     * @return 广电报备-列表
+     */
+    @GetMapping("/dqPage")
+    public R dqPage(Page<GdReportListVO> page, @RequestParam("status") Integer status, @RequestParam(value = "keyword", required = false) String keyword) {
+
+        return R.ok(kxsGdReportService.getDqByPage(page, status, keyword));
+    }
+
+    /**
+     * 广电报备-电渠报备
+     *
+     * @param param 实体对象
+     * @return 广电报备-报备
+     */
+    @PostMapping("/dqReport")
+    public R dqReport(@RequestBody @Valid GdDqReportDTO param) {
+
+        return R.ok(kxsGdReportService.dqReport(param));
+    }
+
 
+    /**
+     * 广电报备-电渠数量接口
+     *
+     * @return 广电报备-数量接口
+     */
+    @GetMapping("/dqDot")
+    public R dqDot() {
+
+        return R.ok(kxsGdReportService.dqDotNum());
+    }
 
 
 

+ 2 - 0
kxs-product/kxs-product-biz/src/main/java/com/kxs/product/biz/mapper/KxsGdReportMapper.java

@@ -37,5 +37,7 @@ public interface KxsGdReportMapper extends BaseMapper<KxsGdReport> {
      * @return {@link IPage}<{@link MachineUnBindListVO}>
      */
     IPage<MachineUnBindListVO> getByUnBindPage(Page<MachineUnBindListVO> page, @Param("userId") Long userId, @Param("posSn") String posSn);
+
+    IPage<GdReportListVO> getDqByPage(Page<GdReportListVO> page, @Param("userId") Long userId, @Param("status") Integer status, @Param("keyword") String keyword);
 }
 

+ 28 - 0
kxs-product/kxs-product-biz/src/main/java/com/kxs/product/biz/service/KxsGdReportService.java

@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.kxs.common.core.util.R;
+import com.kxs.product.api.dto.kxsapp.gd.GdDqReportDTO;
 import com.kxs.product.api.dto.kxsapp.gd.GdReportDTO;
 import com.kxs.product.api.dto.kxsapp.gd.GdReportPutDTO;
 import com.kxs.product.api.model.KxsGdReport;
 import com.kxs.product.api.vo.kxsapp.gd.GdDotNumVO;
+import com.kxs.product.api.vo.kxsapp.gd.GdDqDotNumVO;
 import com.kxs.product.api.vo.kxsapp.gd.GdReportListVO;
 import com.kxs.product.api.vo.kxsapp.machine.MachineUnBindListVO;
 
@@ -35,6 +37,16 @@ public interface KxsGdReportService extends IService<KxsGdReport> {
      */
     IPage<GdReportListVO> getByPage(Page<GdReportListVO> page,  Integer status, String keyword);
 
+    /**
+     * 电渠分页
+     *
+     * @param page    页
+     * @param keyword 关键词
+     * @return {@link IPage}<{@link GdReportListVO}>
+     */
+    IPage<GdReportListVO> getDqByPage(Page<GdReportListVO> page, Integer status, String keyword);
+
+
     /**
      * 数量接口
      *
@@ -83,5 +95,21 @@ public interface KxsGdReportService extends IService<KxsGdReport> {
      * @return {@link IPage}<{@link MachineUnBindListVO}>
      */
     IPage<MachineUnBindListVO> getByUnBindPage(Page<MachineUnBindListVO> page, String posSn);
+
+    /**
+     * 电渠报备
+     *
+     * @param param 参数
+     * @return {@link R}
+     */
+    Boolean dqReport(GdDqReportDTO param);
+
+    /**
+     * 电渠数量接口
+     *
+     * @return {@link GdDqDotNumVO}
+     */
+    GdDqDotNumVO dqDotNum();
+
 }
 

+ 40 - 0
kxs-product/kxs-product-biz/src/main/java/com/kxs/product/biz/service/impl/KxsGdReportServiceImpl.java

@@ -13,11 +13,13 @@ import com.kxs.common.core.exception.GlobalCustomerException;
 import com.kxs.common.core.util.R;
 import com.kxs.common.core.util.RetOps;
 import com.kxs.common.security.util.SecurityUtils;
+import com.kxs.product.api.dto.kxsapp.gd.GdDqReportDTO;
 import com.kxs.product.api.dto.kxsapp.gd.GdReportDTO;
 import com.kxs.product.api.dto.kxsapp.gd.GdReportPutDTO;
 import com.kxs.product.api.model.KxsGdReport;
 import com.kxs.product.api.res.gd.GdQueryOrderRes;
 import com.kxs.product.api.vo.kxsapp.gd.GdDotNumVO;
+import com.kxs.product.api.vo.kxsapp.gd.GdDqDotNumVO;
 import com.kxs.product.api.vo.kxsapp.gd.GdReportListVO;
 import com.kxs.product.api.vo.kxsapp.machine.MachineUnBindListVO;
 import com.kxs.product.biz.constant.enums.GdReportEnum;
@@ -75,6 +77,14 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
         return baseMapper.getByPage(page, userId, status, keyword);
     }
 
+    @Override
+    public IPage<GdReportListVO> getDqByPage(Page<GdReportListVO> page, Integer status, String keyword) {
+
+        Long userId = SecurityUtils.getUser().getId();
+
+        return baseMapper.getDqByPage(page, userId, status, keyword);
+    }
+
     @Override
     public GdDotNumVO dotNum() {
 
@@ -163,6 +173,36 @@ public class KxsGdReportServiceImpl extends ServiceImpl<KxsGdReportMapper, KxsGd
         return baseMapper.getByUnBindPage(page, userId, posSn);
     }
 
+    @Override
+    public Boolean dqReport(GdDqReportDTO param) {
+
+        R<KxsUser> kxsUserR = remoteKxsUserService.loadUserById(SecurityUtils.getUser().getId(), SecurityConstants.FROM_IN);
+        KxsUser user = RetOps.of(kxsUserR)
+                .getData()
+                .orElseThrow(() -> new GlobalCustomerException(ErrorTypeEnum.USER_NOT_FOUND.getDescription()));
+
+        KxsGdReport kxsGdReport = new KxsGdReport();
+        BeanUtil.copyProperties(param, kxsGdReport);
+        kxsGdReport.setUserId(user.getId());
+        kxsGdReport.setUsername(user.getUsername());
+        kxsGdReport.setUserCode(user.getUserCode());
+        kxsGdReport.setStatus(GdReportEnum.REPORT.getType());
+
+        return this.save(kxsGdReport);
+    }
+
+    @Override
+    public GdDqDotNumVO dqDotNum() {
+
+        Long userId = SecurityUtils.getUser().getId();
+        GdDqDotNumVO gdDotNumVO = new GdDqDotNumVO();
+        gdDotNumVO.setAllNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getUserId, userId))).orElse(0L));
+        gdDotNumVO.setReportNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getUserId, userId).eq(KxsGdReport::getStatus, GdReportEnum.REPORT.getType()))).orElse(0L));
+        gdDotNumVO.setEndNum(Optional.of(this.count(Wrappers.<KxsGdReport>lambdaQuery().eq(KxsGdReport::getUserId, userId).eq(KxsGdReport::getIsCheck, GdReportEnum.CHECK_SUC).eq(KxsGdReport::getStatus, GdReportEnum.CANCEL.getType()))).orElse(0L));
+
+        return gdDotNumVO;
+    }
+
 
 }
 

+ 20 - 0
kxs-product/kxs-product-biz/src/main/resources/mapper/KxsGdReportMapper.xml

@@ -20,6 +20,7 @@
         <result column="gd_sn" property="gdSn" />
         <result column="gd_mobile" property="gdMobile" />
         <result column="is_check" property="isCheck" />
+        <result column="put_type" property="putType" />
 
     </resultMap>
     <select id="getByPage" resultType="com.kxs.product.api.vo.kxsapp.gd.GdReportListVO">
@@ -50,5 +51,24 @@
             </if>
         </where>
     </select>
+    <select id="getDqByPage" resultType="com.kxs.product.api.vo.kxsapp.gd.GdReportListVO">
+        select id, create_time, put_name, put_mobile, gd_sn, gd_mobile, status, is_check
+        from kxs_gd_report
+        <where>
+            and del_flag = 0
+            and user_id = #{userId}
+            <if test="status != null and status == 1">
+                and status = 1
+            </if>
+            <if test="status != null and status == 2">
+                and status = 1
+                and is_check = 1
+            </if>
+            <if test="keyword != null and keyword != ''">
+                and (put_name = #{keyword} or put_mobile = #{keyword} or gd_mobile = #{keyword})
+            </if>
+        </where>
+        order by id desc
+    </select>
 
 </mapper>

+ 1 - 1
kxs-user/kxs-user-api/src/main/java/com/kxs/user/api/feign/RemoteKxsUserService.java

@@ -71,7 +71,7 @@ public interface RemoteKxsUserService {
 	 * @return R
 	 */
 	@GetExchange("/user/loadUserById")
-	R<KxsUser> loadUserById(@RequestParam("userId") Integer userId, @RequestHeader(SecurityConstants.FROM) String from);
+	R<KxsUser> loadUserById(@RequestParam("userId") Object userId, @RequestHeader(SecurityConstants.FROM) String from);
 
 	/**
 	 * 通过用户ID查询用户实名认证信息