Explorar o código

增加联系留言列表

FengChaoYu hai 1 semana
pai
achega
a19c0a545a

+ 48 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/message/MessageVO.java

@@ -0,0 +1,48 @@
+package com.gree.mall.manager.bean.message;
+
+import com.gree.mall.manager.annotation.ZfireField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@ApiModel
+@ZfireField(tbName = "a")
+public class MessageVO {
+
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "id")
+    private String id;
+
+    @ApiModelProperty(value = "问题")
+    private String question;
+
+    @ApiModelProperty(value = "名")
+    private String firstName;
+
+    @ApiModelProperty(value = "姓")
+    private String lastName;
+
+    @ApiModelProperty(value = "公司名称")
+    private String companyName;
+
+    @ApiModelProperty(value = "联系电话")
+    private String mobile;
+
+    @ApiModelProperty(value = "留言")
+    private String message;
+
+    @ApiModelProperty(value = "账号")
+    private String accountNumber;
+
+    @ApiModelProperty(value = "电子邮件")
+    private String eMail;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+}

+ 8 - 0
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/CommonMapper.java

@@ -16,6 +16,7 @@ import com.gree.mall.manager.bean.listvo.param.WorkOrderZfireParam;
 import com.gree.mall.manager.bean.listvo.workorder.*;
 import com.gree.mall.manager.bean.member.UserCompanyCreditVO;
 import com.gree.mall.manager.bean.member.UserCompanyDeliveryVO;
+import com.gree.mall.manager.bean.message.MessageVO;
 import com.gree.mall.manager.bean.order.LeaseOrderVO;
 import com.gree.mall.manager.bean.order.OrderPickTimeConfigVO;
 import com.gree.mall.manager.bean.order.refund.OrderOfflineRefundVO;
@@ -672,4 +673,11 @@ public interface CommonMapper {
      * @return
      */
     IPage<GoodsApplyPurchaseVO> goodsApplyPurchaseList(Page page, @Param("ex") ZfireParamBean zfireParamBean);
+
+    /**
+     * 联系留言列表
+     * @param page
+     * @return
+     */
+    IPage<MessageVO> messagePage(Page page, @Param("ex") ZfireParamBean zfireParamBean);
 }

+ 54 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/message/MessageController.java

@@ -0,0 +1,54 @@
+package com.gree.mall.manager.controller.message;
+
+import cn.hutool.core.lang.TypeReference;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gree.mall.manager.annotation.ZfireList;
+import com.gree.mall.manager.bean.message.MessageVO;
+import com.gree.mall.manager.helper.ResponseHelper;
+import com.gree.mall.manager.logic.message.MessageLogic;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Slf4j
+@RestController
+@Api(value = "联系留言API", tags ={"联系留言API"} )
+@RequestMapping(value = "/message", produces = "application/json; charset=utf-8")
+public class MessageController {
+
+    @Resource
+    MessageLogic messageLogic;
+
+    @ZfireList
+    @PostMapping("/list")
+    @ApiOperation(value = "列表")
+    public ResponseHelper<IPage<MessageVO>> list(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) {
+        IPage<MessageVO> page = messageLogic.list(zfireParamBean);
+        return ResponseHelper.success(page, new TypeReference<MessageVO>() {});
+    }
+
+    @PostMapping("/list/export")
+    @ApiOperation(value = "列表-导出")
+    public void listExport(
+            @RequestBody ZfireParamBean zfireParamBean,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        //2.查询要导出的内容
+        IPage<MessageVO> page = messageLogic.list(zfireParamBean);
+        //3.导出
+        FieldUtils.exportData(page.getRecords(), zfireParamBean.getExportFields(), request, response);
+    }
+}

+ 32 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/message/MessageLogic.java

@@ -0,0 +1,32 @@
+package com.gree.mall.manager.logic.message;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.bean.admin.AdminUserCom;
+import com.gree.mall.manager.bean.message.MessageVO;
+import com.gree.mall.manager.commonmapper.CommonMapper;
+import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class MessageLogic {
+
+    private final CommonMapper commonMapper;
+    private final CommonLogic commonLogic;
+
+
+    public IPage<MessageVO> list(ZfireParamBean zfireParamBean) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        FieldUtils.supplyParam(zfireParamBean, MessageVO.class);
+
+        IPage<MessageVO> page = commonMapper.messagePage(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
+        return page;
+    }
+
+}

+ 11 - 0
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -1308,5 +1308,16 @@
         ${ex.orderBy}
     </select>
 
+    <select id="messagePage" resultType="com.gree.mall.manager.bean.message.MessageVO">
+        SELECT
+        ${ex.selected}
+        FROM message a
+        ${ex.query}
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
+
 
 </mapper>