Aslee 2 лет назад
Родитель
Сommit
d2b1abfee0

+ 1 - 1
src/main/java/com/caimei/mapper/cmMapper/AuthProductMapper.java

@@ -91,7 +91,7 @@ public interface AuthProductMapper {
 
     void checkAuthProduct(Integer productId);
 
-    Integer insertProductRelation(@Param("authId") Integer authId, @Param("productId") Integer productId, @Param("authType") Integer authType);
+    void insertProductRelation(ProductRelationVo relationVo);
 
     ProductRelationVo getProductRelation(@Param("relationId") Integer relationId, @Param("productId") Integer productId, @Param("authId") Integer authId);
 

+ 8 - 3
src/main/java/com/caimei/service/auth/impl/AuthProductServiceImpl.java

@@ -311,8 +311,13 @@ public class AuthProductServiceImpl implements AuthProductService {
                 // 关联设备,更新设备
                 authProductMapper.updateProductByProductId(product);
             }
+            ProductRelationVo relationVo = new ProductRelationVo();
+            relationVo.setAuthId(authId);
+            relationVo.setProductId(product.getProductId());
+            relationVo.setAuthType(authType);
             // 插入机构设备关联关系
-            relationId = authProductMapper.insertProductRelation(authId, product.getProductId(), authType);
+            authProductMapper.insertProductRelation(relationVo);
+            relationId = relationVo.getRelationId();
         } else {
             if (1 == dbRelation.getAuthType()) {
                 // 更新设备
@@ -429,7 +434,7 @@ public class AuthProductServiceImpl implements AuthProductService {
                 map.put("addWord2_style", Font.BOLD);
                 map.put("addWord2_size", (int) Math.round(90 * rate));
                 map.put("addWord2_x", (int) Math.round(2168 * rate));
-                map.put("addWord2_y", (int) Math.round(3160 * rate));
+                map.put("addWord2_y", (int) Math.round(3157 * rate));
             }
             // 添加认证日期信息
             if (null != product.getCreateTime()) {
@@ -440,7 +445,7 @@ public class AuthProductServiceImpl implements AuthProductService {
                 map.put("addWord3_style", Font.PLAIN);
                 map.put("addWord3_size", (int) Math.round(90 * rate));
                 map.put("addWord3_x", (int) Math.round(2085 * rate));
-                map.put("addWord3_y", (int) Math.round(3292 * rate));
+                map.put("addWord3_y", (int) Math.round(3289 * rate));
             }
             // 添加二维码信息
             if (StringUtils.isNotEmpty(template.getQrPosition())) {

+ 2 - 2
src/main/java/com/caimei/service/auth/impl/AuthServiceImpl.java

@@ -398,7 +398,7 @@ public class AuthServiceImpl implements AuthService {
                 map.put("addWord1_style", Font.BOLD);
                 map.put("addWord1_size", (int) Math.round(90 * rate));
                 map.put("addWord1_x", (int) Math.round(2168 * rate));
-                map.put("addWord1_y", (int) Math.round(3160 * rate));
+                map.put("addWord1_y", (int) Math.round(3157 * rate));
             }
             // 添加认证日期信息
             if (null != auth.getAuthDate()) {
@@ -409,7 +409,7 @@ public class AuthServiceImpl implements AuthService {
                 map.put("addWord2_style", Font.PLAIN);
                 map.put("addWord2_size", (int) Math.round(90 * rate));
                 map.put("addWord2_x", (int) Math.round(2085 * rate));
-                map.put("addWord2_y", (int) Math.round(3292 * rate));
+                map.put("addWord2_y", (int) Math.round(3289 * rate));
             }
             // 添加二维码信息
             if (StringUtils.isNotEmpty(template.getQrPosition())) {

+ 4 - 4
src/main/resources/mapper/AuthProductMapper.xml

@@ -26,15 +26,15 @@
         insert into cm_brand_product_type_param (productTypeId, name, content)
         values (#{productTypeId}, #{paramName}, #{paramContent})
     </insert>
-    <insert id="insertProductRelation" useGeneratedKeys="true" keyColumn="id">
-        insert into cm_brand_product_relation (authId, productId, authType)
-        values (#{authId}, #{productId}, #{authType})
-    </insert>
     <insert id="addScanCount">
         update cm_brand_auth_product
         set scanCount = scanCount + 1
         where id = #{productId}
     </insert>
+    <insert id="insertProductRelation" useGeneratedKeys="true" parameterType="com.caimei.model.vo.ProductRelationVo" keyProperty="relationId" keyColumn="id">
+        insert into cm_brand_product_relation (authId, productId, authType)
+        values (#{authId}, #{productId}, #{authType})
+    </insert>
 
     <update id="updateProductStatusByProductId">
         update cm_brand_auth_product