he2802 2 gadi atpakaļ
vecāks
revīzija
4d73e92bcc

+ 26 - 13
zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/UserController.java

@@ -164,21 +164,34 @@ public class UserController extends BaseController {
     @Log(title = "导入用户", businessType = BusinessType.IMPORT)
     @PreAuthorize("@ss.hasPermi('system:section:import')")
     @PostMapping("/importData")
-    public AjaxResult<Map<String,Object>> importData(MultipartFile file, String importNo) throws Exception
+    public AjaxResult<Map<String,Object>> importData(MultipartFile file, String importNo,Integer sign) throws Exception
     {
-        ExcelUtil<UserImportAddBo> util = new ExcelUtil<UserImportAddBo>(UserImportAddBo.class);
-        List<UserImportAddBo> userList = null;
-        try{
-            userList = util.importExcel(file.getInputStream());
-        }catch (Exception e){
-            e.printStackTrace();
-            throw new IllegalArgumentException("模板格式不正确,请重新下载模板");
+        Map<String, Object> rs = new HashMap<>();
+        if (ObjectUtils.isNotNull(sign) && sign == 1){
+            ExcelUtil<UserPeriodImportBo> util = new ExcelUtil<UserPeriodImportBo>(UserPeriodImportBo.class);
+            List<UserPeriodImportBo> userList = null;
+            try{
+                userList = util.importExcel(file.getInputStream());
+            }catch (Exception e){
+                e.printStackTrace();
+                throw new IllegalArgumentException("模板格式不正确,请重新下载模板");
+            }
+            rs = iUserService.importSevenUser(userList);
+        }else {
+            ExcelUtil<UserImportAddBo> util = new ExcelUtil<UserImportAddBo>(UserImportAddBo.class);
+            List<UserImportAddBo> userList = null;
+            try{
+                userList = util.importExcel(file.getInputStream());
+            }catch (Exception e){
+                e.printStackTrace();
+                throw new IllegalArgumentException("模板格式不正确,请重新下载模板");
+            }
+            Collections.reverse(userList);
+            if (userList.stream().allMatch(item -> ObjectUtils.isNull(item))){
+                throw new IllegalArgumentException("模板格式不正确,请重新下载模板");
+            }
+            rs = iUserService.importUser(userList,importNo);
         }
-        Collections.reverse(userList);
-        if (userList.stream().allMatch(item -> ObjectUtils.isNull(item))){
-            throw new IllegalArgumentException("模板格式不正确,请重新下载模板");
-        }
-        Map<String, Object> rs = iUserService.importUser(userList,importNo);
         return AjaxResult.success(rs);
     }
 

+ 5 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -1626,6 +1626,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         return baseMapper.getByCardNoTenant(idCard);
     }
 
+    @Override
+    public Map<String, Object> importSevenUser(List<UserPeriodImportBo> userList) {
+        return null;
+    }
+
 
     @Override
     public Map<String, Object> accountLogin(UserAppAccountLoginBo bo) {

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/bo/TopOldOrderAddBo.java

@@ -203,4 +203,13 @@ public class TopOldOrderAddBo {
 
     @ApiModelProperty("新B端订单审核标识:1需要 0不需要")
     private Integer checkSign;
+
+    @ApiModelProperty("对应客户Id")
+    private Integer oldCompanyId;
+
+    @ApiModelProperty("客户ID")
+    private Integer oldCustomerId;
+
+    @ApiModelProperty("订单所属机构")
+    private Integer oldInstitutionId;
 }

+ 55 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserPeriodImportBo.java

@@ -0,0 +1,55 @@
+package com.zhongzheng.modules.user.bo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年11月21日 10:40
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+public class UserPeriodImportBo implements Serializable {
+
+    @Excel(name = "*学员姓名")
+    private String userName;
+
+    @Excel(name = "*身份证号")
+    private String userCard;
+
+    @Excel(name = "*手机号")
+    private String userPhone;
+
+    @Excel(name = "性别")
+    private String sex;
+
+    @Excel(name = "培训岗位")
+    private String applyPost;
+
+    @Excel(name = "毕业院校")
+    private String school;
+
+    @Excel(name = "学历")
+    private String education;
+
+    @Excel(name = "所学专业")
+    private String major;
+
+    @Excel(name = "毕业时间(yyyy-MM-dd)")
+    private String graduationTime;
+
+    @Excel(name = "工作年限")
+    private String workingYears;
+
+    @Excel(name = "单位联系人")
+    private String unitContact;
+
+    @Excel(name = "联系电话")
+    private String unitTel;
+
+}

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java

@@ -142,4 +142,6 @@ public interface IUserService extends IService<User> {
     User getByIdNoTenant(Long userId);
 
     User getByCardNoTenant(String idCard);
+
+	Map<String, Object> importSevenUser(List<UserPeriodImportBo> userList);
 }

+ 6 - 0
zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderMapper.xml

@@ -1020,6 +1020,9 @@
             <if test="customerId != null and customerId != ''">
                 AND too.old_customer_id = #{customerId}
             </if>
+            <if test="tenantId != null and tenantId != ''">
+                AND too.tenant_id = #{tenantId}
+            </if>
             <if test="businessName != null and businessName != ''">
                 AND (SELECT COUNT(DISTINCT oog.order_sn) FROM top_old_order_goods oog WHERE too.order_sn = oog.order_sn AND INSTR(oog.business_full_name,#{businessName}) ) > 0
             </if>
@@ -1063,6 +1066,9 @@
                 WHERE o.order_sn = og.order_sn
                 AND INSTR(CONCAT(cet.education_name,cpt.project_name,cb.business_name),#{businessName}) ) > 0
             </if>
+            <if test="tenantId != null and tenantId != ''">
+                AND o.tenant_id = #{tenantId}
+            </if>
             <if test="customerName != null and customerName != ''">
                 AND (SELECT COUNT(s.tenant_id) FROM sys_tenant s WHERE o.tenant_id = s.tenant_id AND s.tenant_name LIKE CONCAT('%',#{customerName},'%')) > 0
             </if>