소스 검색

no message

FengChaoYu 1 주 전
부모
커밋
77be3607b5

+ 6 - 2
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/bean/user/CurrentCompanyWechat.java

@@ -5,11 +5,14 @@ import com.gree.mall.miniapp.plus.entity.AdminCompanyWechatOther;
 import com.gree.mall.miniapp.plus.entity.User;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
-import io.swagger.models.auth.In;
 import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
 
 import java.math.BigDecimal;
 
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
 @ApiModel
 @Data
 public class CurrentCompanyWechat extends AdminCompanyWechat{
@@ -40,5 +43,6 @@ public class CurrentCompanyWechat extends AdminCompanyWechat{
     @ApiModelProperty("账期天数(1-30天)")
     private Integer paymentGracePeriod = new Integer("0");
 
-
+    @ApiModelProperty("培训文件夹id")
+    private String trainingFolderId;
 }

+ 11 - 1
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/controller/common/CommonController.java

@@ -161,12 +161,14 @@ public class CommonController {
     @ApiNotAuth
     @GetMapping("/config/get")
     @ApiOperation("获取小程序配置")
-    public ResponseHelper<AdminCompanyWechat> getConfig(HttpServletRequest request) {
+    public ResponseHelper<CurrentCompanyWechat> getConfig(HttpServletRequest request) {
         final AdminPlatform adminPlatform = adminPlatformService.getById(1);
         CurrentCompanyWechat currentCompanyWechat = new CurrentCompanyWechat();
         //剔除不返回的内容
         currentCompanyWechat.setMinAppName(adminPlatform.getMinAppName())
                 .setMinLogo1(adminPlatform.getMinLogo1());
+
+        currentCompanyWechat.setTrainingFolderId(adminPlatform.getTrainingFolderId());
         return ResponseHelper.success(currentCompanyWechat);
     }
 
@@ -231,4 +233,12 @@ public class CommonController {
         List<AdminCompanyWechat> region = commonLogic.companyList();
         return ResponseHelper.success(region);
     }
+
+    @ApiNotAuth
+    @PostMapping("/training/list")
+    @ApiOperation(value = "培训列表")
+    public ResponseHelper<List<CommonFile>> trainingList(@ApiParam(required = true, value = "文件夹id") @RequestParam String id) {
+        List<CommonFile> region = commonLogic.trainingList(id);
+        return ResponseHelper.success(region);
+    }
 }

+ 6 - 3
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/controller/user/UserController.java

@@ -251,13 +251,16 @@ public class UserController {
     @GetMapping("/leave/message")
     @ApiOperation(value = "留言")
     public ResponseHelper leaveMessage(
-            @ApiParam(value = "姓", required = true) @RequestParam String firstName,
-            @ApiParam(value = "名", required = true) @RequestParam String lastName,
+            @ApiParam(value = "问题") @RequestParam(required = false) String question,
+            @ApiParam(value = "名", required = true) @RequestParam String firstName,
+            @ApiParam(value = "姓") @RequestParam(required = false) String lastName,
             @ApiParam(value = "公司名称", required = true) @RequestParam String companyName,
             @ApiParam(value = "联系电话", required = true) @RequestParam String mobile,
+            @ApiParam(value = "账号") @RequestParam(required = false) String accountNumber,
+            @ApiParam(value = "电子邮件") @RequestParam(required = false) String email,
             @ApiParam(value = "留言", required = true) @RequestParam String message
     ) throws Exception {
-        userLogic.leaveMessage(firstName, lastName, companyName, mobile, message);
+        userLogic.leaveMessage(question, firstName, lastName, companyName, mobile, accountNumber, email, message);
         return ResponseHelper.success();
     }
 

+ 6 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/common/CommonLogic.java

@@ -452,4 +452,10 @@ public class CommonLogic {
     public List<AdminCompanyWechat> companyList() {
         return adminCompanyWechatService.list();
     }
+
+    public List<CommonFile> trainingList(String id) {
+        return commonFileService.lambdaQuery()
+                .eq(CommonFile::getObjId, id)
+                .list();
+    }
 }

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

@@ -849,12 +849,16 @@ public class UserLogic {
                 .update();
     }
 
-    public void leaveMessage(String firstName, String lastName, String companyName, String mobile, String message) {
+    public void leaveMessage(String question, String firstName, String lastName, String companyName, String mobile,
+                             String accountNumber, String email, String message) {
         Message obj = new Message();
-        obj.setFirstName(firstName)
+        obj.setQuestion(question)
+                .setFirstName(firstName)
                 .setLastName(lastName)
                 .setCompanyName(companyName)
                 .setMobile(mobile)
+                .setAccountNumber(accountNumber)
+                .setEMail(email)
                 .setMessage(message)
                 .setCreateTime(DateUtil.date())
                 .insert();