Przeglądaj źródła

20220422_协议上传接口优化

mashengyi 2 lat temu
rodzic
commit
67f78fe31c

+ 1 - 1
src/main/java/com/jkcredit/invoice/controller/business/CustomerController.java

@@ -290,7 +290,7 @@ public class CustomerController {
     @GetMapping("/generateWord")
     @ApiOperation(value="文档下载", notes="文档下载")
     public RespR generateWord(String customerRecId,HttpServletResponse response){
-        CustomerRec customerRec = (CustomerRec) customerService.contractDownload(customerRecId).getData();
+        CustomerRec customerRec = (CustomerRec) customerService.generateWordDownload(customerRecId).getData();
         if(null == customerRec || null ==customerRec.getServiceStartTime() || null ==customerRec.getServiceEndTime()){
             return new RespR(false,"企业维护信息缺失服务时间,请手动维护");
         }

+ 1 - 0
src/main/java/com/jkcredit/invoice/mapper/customer/CustomerRecMapper.java

@@ -20,6 +20,7 @@ public interface CustomerRecMapper extends BaseMapper<CustomerRec> {
 
     CustomerRec selectByPrimaryKey(String id);
     CustomerRec selectByPrimaryKeyHasBase64(Integer id);
+    CustomerRec selectByPrimaryKeyHasNoLocalBase64(Integer id);
     List<CustomerRec> selectByCustomerName(String customerName);
     List<CustomerRec> selectByCustomerNameAll(String customerName);
     List<CustomerRec> selectByCustomerNameCpAll(@Param("customerRec") CustomerRec record);

+ 8 - 0
src/main/java/com/jkcredit/invoice/service/customer/CustomerService.java

@@ -70,6 +70,14 @@ public interface CustomerService extends IService<Customer>{
      */
     RespR  contractDownload(String id);
 
+
+    /**
+     * 生成文档下载
+     * @param id
+     * @return
+     */
+    RespR  generateWordDownload(String id);
+
     /**
      * 用户备案
      * @param customerRec

+ 8 - 0
src/main/java/com/jkcredit/invoice/service/customer/impl/CustomerServiceImpl.java

@@ -125,6 +125,14 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper,Customer> im
         return new RespR(customerRec);
     }
 
+
+
+    @Override
+    public RespR generateWordDownload(String id) {
+        CustomerRec customerRec = customerRecMapper.selectByPrimaryKeyHasNoLocalBase64(Integer.valueOf(id));
+        return new RespR(customerRec);
+    }
+
     @Override
     public RespR customeRec(CustomerRec customerRec){
         log.info("开始客户注册:CustomerServiceImpl.customeRec{}",customerRec);

+ 4 - 4
src/main/java/com/jkcredit/invoice/util/QueryDemo_Test.java

@@ -109,11 +109,11 @@ public class QueryDemo_Test {
 	      dataJson.put("mobile",SHA256Utils.String2SHA256("13104866236"));
 	      dataJson.put("encrypt","SHA256");*/
 		  dataJson.put("companyNum", "10004849");
-	      dataJson.put("serviceStartTime","2022-04-15T17:30:37");
-	      dataJson.put("serviceEndTime","2023-04-15T21:30:37");
-	      dataJson.put("contractFileName","spring高级源码笔记msy.pdf");
+	      dataJson.put("serviceStartTime","2022-04-22T17:30:37");
+	      dataJson.put("serviceEndTime","2023-04-22T21:30:37");
+	      dataJson.put("contractFileName","马圣毅测试了啊.pdf");
 	      dataJson.put("serviceType","3");
-	      dataJson.put("base64Str",Base64Util.getPDFBinary(new File("C:\\Users\\msy\\Desktop\\spring高级源码笔记.pdf")));
+	      dataJson.put("base64Str",Base64Util.getPDFBinary(new File("C:\\Users\\msy\\Desktop\\服务及承诺函.pdf")));
 		 /* List<String> list = new ArrayList<>();
 			list.add("13752639577");
 	        dataJson.put("msisdnmd5list",list);*/

+ 41 - 2
src/main/resources/mapper/customer/CustomerRecMapper.xml

@@ -57,7 +57,35 @@
     <result column="service_type" property="serviceType" jdbcType="INTEGER" />
     <result column="contractFileName" property="contractFileName" jdbcType="VARCHAR" />
     <result column="contractSuc" property="contractSuc" jdbcType="INTEGER" />
-    <result column="base64Str" property="base64Str" jdbcType="VARCHAR" />
+    <result column="contrantNum" property="contrantNum" jdbcType="VARCHAR" />
+    <result column="lowerFileName" property="lowerFileName" jdbcType="VARCHAR" />
+    <result column="lowerBase64Str" property="lowerBase64Str" jdbcType="VARCHAR" />
+
+  </resultMap>
+  <resultMap id="BaseResultMapNoLocalBase64Str" type="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
+    <id column="id" property="id" jdbcType="INTEGER" />
+    <result column="customerName" property="customerName" jdbcType="VARCHAR" />
+    <result column="company_leader" property="companyLeader" jdbcType="VARCHAR" />
+    <result column="company_leader_Phone" property="companyLeaderPhone" jdbcType="VARCHAR" />
+    <result column="company_name" property="companyName" jdbcType="VARCHAR" />
+    <result column="company_referenceNum" property="companyReferencenum" jdbcType="VARCHAR" />
+    <result column="company_openbank" property="companyOpenbank" jdbcType="VARCHAR" />
+    <result column="company_openbank_acc" property="companyOpenbankAcc" jdbcType="VARCHAR" />
+    <result column="company_adress" property="companyAdress" jdbcType="VARCHAR" />
+    <result column="company_phone" property="companyPhone" jdbcType="VARCHAR" />
+    <result column="createTime" property="createtime" jdbcType="VARCHAR" />
+    <result column="company_belong_name" property="companyBelongName" jdbcType="VARCHAR" />
+    <result column="rec_status" property="recStatus" jdbcType="INTEGER" />
+    <result column="inter_type" property="interType" jdbcType="INTEGER" />
+    <result column="bussiness_type" property="bussinessType" jdbcType="INTEGER" />
+    <result column="company_type" property="companyType" jdbcType="INTEGER" />
+    <result column="operating_rangeType" property="operatingRangeType" jdbcType="INTEGER" />
+    <result column="company_num" property="companyNum" jdbcType="VARCHAR" />
+    <result column="service_startTime" property="serviceStartTime" jdbcType="VARCHAR" />
+    <result column="service_endTime" property="serviceEndTime" jdbcType="VARCHAR" />
+    <result column="service_type" property="serviceType" jdbcType="INTEGER" />
+    <result column="contractFileName" property="contractFileName" jdbcType="VARCHAR" />
+    <result column="contractSuc" property="contractSuc" jdbcType="INTEGER" />
     <result column="contrantNum" property="contrantNum" jdbcType="VARCHAR" />
     <result column="lowerFileName" property="lowerFileName" jdbcType="VARCHAR" />
   </resultMap>
@@ -154,10 +182,21 @@
   </select>
   <select id="selectByPrimaryKeyHasBase64" resultMap="BaseResultMapNoBase64Str" parameterType="java.lang.Integer" >
     select
-    <include refid="Base_Column_List" />,base64Str
+    <include refid="Base_Column_List" />,lowerBase64Str
     from t_customer_rec
     where id = #{id,jdbcType=INTEGER}
   </select>
+
+
+  <select id="selectByPrimaryKeyHasNoLocalBase64" resultMap="BaseResultMapNoLocalBase64Str" parameterType="java.lang.Integer" >
+    select
+    <include refid="Base_Column_List" />
+    from t_customer_rec
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+
+
+
   <select id="selectByCustomerName" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select
     <include refid="Base_Column_List" />