Browse Source

微信消息推送

chao 3 years ago
parent
commit
605060b7b7
22 changed files with 1502 additions and 3 deletions
  1. 16 0
      src/main/java/com/caimei/modules/bulkpurchase/dao/CommissionsDao.java
  2. 80 0
      src/main/java/com/caimei/modules/bulkpurchase/entity/Commissions.java
  3. 37 0
      src/main/java/com/caimei/modules/bulkpurchase/service/CommissionsService.java
  4. 77 0
      src/main/java/com/caimei/modules/bulkpurchase/web/CommissionsController.java
  5. 17 0
      src/main/java/com/caimei/modules/newhome/dao/AnnouncementDao.java
  6. 77 0
      src/main/java/com/caimei/modules/newhome/entity/Announcementmanagement.java
  7. 58 0
      src/main/java/com/caimei/modules/newhome/service/AnnouncementService.java
  8. 117 0
      src/main/java/com/caimei/modules/newhome/web/AnnouncementController.java
  9. 4 0
      src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java
  10. 23 0
      src/main/java/com/caimei/modules/order/service/NewOrderService.java
  11. 1 0
      src/main/java/com/caimei/modules/order/service/NewShopOrderService.java
  12. 99 0
      src/main/java/com/caimei/modules/order/service/WeChatService.java
  13. 2 2
      src/main/java/com/caimei/modules/order/web/NewOrderController.java
  14. 188 0
      src/main/java/com/caimei/modules/utils/RequestUtil.java
  15. 28 0
      src/main/resources/mappings/modules/bulkpurchase/CommissionsMapper.xml
  16. 80 0
      src/main/resources/mappings/modules/newhome/AnnouncementMapper.xml
  17. 11 0
      src/main/resources/mappings/modules/order/ShopOrderMapper.xml
  18. 163 0
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/addCommissionsForm.jsp
  19. 43 0
      src/main/webapp/WEB-INF/views/modules/bulkpurchase/cmCommissionsForm.jsp
  20. 268 0
      src/main/webapp/WEB-INF/views/modules/newhome/announcementForm.jsp
  21. 112 0
      src/main/webapp/WEB-INF/views/modules/newhome/announcementList.jsp
  22. 1 1
      src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp

+ 16 - 0
src/main/java/com/caimei/modules/bulkpurchase/dao/CommissionsDao.java

@@ -0,0 +1,16 @@
+package com.caimei.modules.bulkpurchase.dao;
+
+import com.caimei.modules.bulkpurchase.entity.Commissions;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/3/25
+ */
+@MyBatisDao
+public interface CommissionsDao extends CrudDao<Commissions> {
+
+}

+ 80 - 0
src/main/java/com/caimei/modules/bulkpurchase/entity/Commissions.java

@@ -0,0 +1,80 @@
+package com.caimei.modules.bulkpurchase.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+import java.util.Date;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/3/25
+ */
+public class Commissions extends DataEntity<Commissions> {
+    private String id;
+    //订单表id
+    private String orderId;
+    //记录人
+    private String name;
+    //创建时间
+    private Date addTime;
+    //提成情况
+    private String sales;
+    //备注
+    private String script;
+
+    @Override
+    public String getId() {
+        return id;
+    }
+
+    @Override
+    public void setId(String id) {
+        this.id = id;
+    }
+
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+
+
+    public String getSales() {
+        return sales;
+    }
+
+    public void setSales(String sales) {
+        this.sales = sales;
+    }
+
+    public String getScript() {
+        return script;
+    }
+
+    public void setScript(String script) {
+        this.script = script;
+    }
+
+    public String getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(String orderId) {
+        this.orderId = orderId;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(Date addTime) {
+        this.addTime = addTime;
+    }
+}

+ 37 - 0
src/main/java/com/caimei/modules/bulkpurchase/service/CommissionsService.java

@@ -0,0 +1,37 @@
+package com.caimei.modules.bulkpurchase.service;
+
+import com.caimei.modules.bulkpurchase.dao.CommissionsDao;
+import com.caimei.modules.bulkpurchase.entity.Commissions;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/3/25
+ */
+@Service
+@Transactional(readOnly = true)
+public class CommissionsService extends CrudService<CommissionsDao,Commissions> {
+
+    @Autowired
+    CommissionsDao commissionsDao;
+
+
+   public List<Commissions> findList(Commissions commissions){
+
+        return commissionsDao.findList(commissions);
+    }
+
+    @Transactional(readOnly = false)
+    public int insert(Commissions commissions){
+       return commissionsDao.insert(commissions);
+    }
+
+}

+ 77 - 0
src/main/java/com/caimei/modules/bulkpurchase/web/CommissionsController.java

@@ -0,0 +1,77 @@
+package com.caimei.modules.bulkpurchase.web;
+
+import com.caimei.modules.bulkpurchase.entity.Commissions;
+import com.caimei.modules.bulkpurchase.service.CommissionsService;
+
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.web.BaseController;
+
+import com.thinkgem.jeesite.modules.sys.security.SystemAuthorizingRealm;
+import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/3/25
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/bulkpurchase/commissions")
+public class CommissionsController extends BaseController {
+
+    @Autowired
+    CommissionsService commissionsService;
+
+    public static String orderId;
+
+    @RequestMapping(value = {""})
+    public String list(Commissions commissions, HttpServletRequest request, HttpServletResponse response, Model model) {
+        List<Commissions> list=commissionsService.findList(commissions);
+        orderId=commissions.getOrderId();
+        model.addAttribute("list",list);
+        model.addAttribute("orderId",commissions.getOrderId());
+        return "/modules/bulkpurchase/cmCommissionsForm";
+    }
+
+
+    @RequestMapping(value = {"list"})
+    public String lists(Commissions commissions, HttpServletRequest request, HttpServletResponse response, Model model) {
+
+        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/commissions?orderId="+orderId;
+    }
+
+
+    @RequestMapping(value = "form")
+    public String form(Commissions commissions, Model model) {
+
+
+        return "modules/bulkpurchase/addCommissionsForm";
+    }
+
+
+
+    @RequestMapping(value = "save")
+    public String save(Commissions commissions, Model model) {
+
+        Date date = new Date();
+        SystemAuthorizingRealm.Principal principal = UserUtils.getPrincipal();
+        commissions.setAddTime(date);
+        commissions.setName( principal.getName());
+        commissions.setOrderId(orderId);
+            int i = commissionsService.insert(commissions);
+
+        model.addAttribute("commissions",commissions);
+        return "redirect:" + Global.getAdminPath() + "/bulkpurchase/commissions?orderId="+orderId;
+        }
+
+    }
+

+ 17 - 0
src/main/java/com/caimei/modules/newhome/dao/AnnouncementDao.java

@@ -0,0 +1,17 @@
+package com.caimei.modules.newhome.dao;
+
+import com.caimei.modules.newhome.entity.Announcementmanagement;
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+
+@MyBatisDao
+public interface AnnouncementDao extends CrudDao<Announcementmanagement> {
+    Announcementmanagement announlist(Announcementmanagement announcementmanagement);
+
+    int online(Announcementmanagement announcementmanagement);
+
+    int line(Announcementmanagement announcementmanagement);
+
+    int deletes(Announcementmanagement announcementmanagement);
+
+}

+ 77 - 0
src/main/java/com/caimei/modules/newhome/entity/Announcementmanagement.java

@@ -0,0 +1,77 @@
+package com.caimei.modules.newhome.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+import java.sql.Timestamp;
+import java.util.Date;
+
+
+public class Announcementmanagement extends DataEntity<Announcementmanagement> {
+    private String id;
+    private String title;                      //标题
+    private String capacity;                  //类容
+    private String state;                    //状态1为上线2为下线
+    private Date creationtime;              //创建时间
+    private Date  livetime;                 //上线时间
+    private Date  offlinetime;             //下线时间
+
+    @Override
+    public String getId() {
+        return id;
+    }
+
+    @Override
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getCapacity() {
+        return capacity;
+    }
+
+    public void setCapacity(String capacity) {
+        this.capacity = capacity;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getCreationtime() {
+        return creationtime;
+    }
+
+    public void setCreationtime(Date creationtime) {
+        this.creationtime = creationtime;
+    }
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getLivetime() {
+        return livetime;
+    }
+
+    public void setLivetime(Date livetime) {
+        this.livetime = livetime;
+    }
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getOfflinetime() {
+        return offlinetime;
+    }
+
+    public void setOfflinetime(Date offlinetime) {
+        this.offlinetime = offlinetime;
+    }
+}

+ 58 - 0
src/main/java/com/caimei/modules/newhome/service/AnnouncementService.java

@@ -0,0 +1,58 @@
+package com.caimei.modules.newhome.service;
+
+import com.caimei.modules.newhome.dao.AnnouncementDao;
+import com.caimei.modules.newhome.entity.Announcementmanagement;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+@Service
+@Transactional(readOnly = true)
+public class AnnouncementService extends CrudService<AnnouncementDao, Announcementmanagement> {
+
+    @Autowired
+    AnnouncementDao announcementDao;
+
+    @Transactional(readOnly = false)
+    public List<Announcementmanagement> findList(Announcementmanagement announcementmanagement) {
+        return announcementDao.findList(announcementmanagement);
+    }
+
+    @Transactional(readOnly = false)
+    public Page<Announcementmanagement> findPage(Page<Announcementmanagement> page, Announcementmanagement announcementmanagement) {
+        return super.findPage(page, announcementmanagement);
+    }
+
+    @Transactional(readOnly = false)
+    public int insert(Announcementmanagement announcementmanagement) {
+        return announcementDao.insert(announcementmanagement);
+    }
+
+    @Transactional(readOnly = false)
+    public Announcementmanagement announlist(Announcementmanagement announcementmanagement){
+        return announcementDao.announlist(announcementmanagement);
+    }
+
+    @Transactional(readOnly = false)
+    public int update(Announcementmanagement announcementmanagement) {
+        return announcementDao.update(announcementmanagement);
+    }
+
+    @Transactional(readOnly = false)
+    public int online(Announcementmanagement announcementmanagement) {
+        return announcementDao.online(announcementmanagement);
+    }
+
+    @Transactional(readOnly = false)
+    public int line(Announcementmanagement announcementmanagement) {
+        return announcementDao.line(announcementmanagement);
+    }
+    @Transactional(readOnly = false)
+    public int deteles(Announcementmanagement announcementmanagement) {
+        return announcementDao.deletes(announcementmanagement);
+    }
+}

+ 117 - 0
src/main/java/com/caimei/modules/newhome/web/AnnouncementController.java

@@ -0,0 +1,117 @@
+package com.caimei.modules.newhome.web;
+
+import com.caimei.modules.newhome.entity.Announcementmanagement;
+import com.caimei.modules.newhome.service.AnnouncementService;
+import com.caimei.modules.user.entity.ClubTemporary;
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.swing.*;
+import java.io.PrintWriter;
+import java.sql.Timestamp;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+@Controller
+@RequestMapping(value = "${adminPath}/newhome/Announcement")
+public class AnnouncementController extends BaseController {
+
+    @Autowired
+    AnnouncementService announcementService;
+
+    public static String id;
+
+    @RequiresPermissions("newhome:announcementList:view")
+    @RequestMapping(value = {""})
+    public String list(Announcementmanagement announcementmanagement, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<Announcementmanagement> page = announcementService.findPage(new Page<Announcementmanagement>(request, response), announcementmanagement);
+        model.addAttribute("page", page);
+        return "modules/newhome/announcementList";
+    }
+
+    @RequiresPermissions("newhome:announcementForm:view")
+    @RequestMapping(value = "form")
+    public String form(Announcementmanagement announcementmanagement, Model model) {
+        if (!announcementmanagement.getId().equals(null) || !announcementmanagement.getId().equals("")) {
+            announcementmanagement = announcementService.announlist(announcementmanagement);
+            id = announcementmanagement.getId();
+            model.addAttribute("Announcementmanagement", announcementmanagement);
+        }
+        return "modules/newhome/announcementForm";
+    }
+
+    @RequiresPermissions("newhome:announcementForm:view")
+    @RequestMapping(value = "forms")
+    public String forms(Announcementmanagement announcementmanagement, Model model) {
+
+        return "modules/newhome/announcementForm";
+    }
+
+    @RequiresPermissions("newhome:announcementForm:view")
+    @RequestMapping(value = "save")
+    public String save(Announcementmanagement announcementmanagement, Model model) {
+        if (id != null) {
+            announcementmanagement.setId(id);
+            announcementService.update(announcementmanagement);
+        } else {
+            Date date = new Date();
+            announcementmanagement.setCreationtime(date);
+            announcementmanagement.setLivetime(date);
+            announcementmanagement.setState("1");
+            int i = announcementService.insert(announcementmanagement);
+        }
+        return "redirect:" + Global.getAdminPath() + "/newhome/Announcement/";
+    }
+
+    @RequiresPermissions("newhome:announcementForm:view")
+    @RequestMapping(value = "line")
+    public String line(Announcementmanagement announcementmanagement, Model model, HttpServletRequest request, HttpServletResponse response) {
+        Object[] options = {"取消", "确认"};  //自定义按钮上的文字
+        int m = JOptionPane.showOptionDialog(null, "确定下线该公告吗?", "提示", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
+        if (m == 1) {
+
+
+            Date date = new Date();
+            announcementmanagement.setOfflinetime(date);
+            announcementmanagement.setState("2");
+
+            announcementService.line(announcementmanagement);
+        }
+        return "redirect:" + Global.getAdminPath() + "/newhome/Announcement/";
+    }
+
+    @RequiresPermissions("newhome:announcementForm:view")
+    @RequestMapping(value = "online")
+    public String online(Announcementmanagement announcementmanagement, Model model) {
+        Object[] options = {"取消", "确认"};  //自定义按钮上的文字
+        int m = JOptionPane.showOptionDialog(null, "确定上线该公告吗?", "提示", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
+        if (m == 1) {
+            Date date = new Date();
+            announcementmanagement.setLivetime(date);
+            announcementmanagement.setState("1");
+            announcementService.online(announcementmanagement);
+        }
+        return "redirect:" + Global.getAdminPath() + "/newhome/Announcement/";
+    }
+
+    @RequiresPermissions("newhome:announcementForm:view")
+    @RequestMapping(value = "detele")
+    public String detele(Announcementmanagement announcementmanagement, Model model) {
+        Object[] options = {"取消", "确认"};  //自定义按钮上的文字
+        int m = JOptionPane.showOptionDialog(null, "确定删除该公告吗?", "提示", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
+        if (m == 1) {
+            announcementService.deteles(announcementmanagement);
+        }
+        return "redirect:" + Global.getAdminPath() + "/newhome/Announcement/";
+    }
+
+}

+ 4 - 0
src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java

@@ -16,12 +16,16 @@ import java.util.List;
 @MyBatisDao
 @MyBatisDao
 public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
 public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
 
 
+    List<String> getOpenidListByPermission(@Param("userid")Integer userid,@Param("unionid") String unionid);
+
     int deleteByOrderID(@Param("orderID") Integer orderID);
     int deleteByOrderID(@Param("orderID") Integer orderID);
 
 
     NewShopOrder findByShopOrderID(@Param("shopOrderID") Integer shopOrderID);
     NewShopOrder findByShopOrderID(@Param("shopOrderID") Integer shopOrderID);
 
 
     List<NewShopOrder> findListByOrderID(@Param("orderID") Integer orderID);
     List<NewShopOrder> findListByOrderID(@Param("orderID") Integer orderID);
 
 
+    String getOpenidunionId(Integer userid);
+
     int updateByShopOrderNo(NewShopOrder newShopOrder);
     int updateByShopOrderNo(NewShopOrder newShopOrder);
 
 
     int updateStatusByOrderID(@Param("orderID") Integer orderID, @Param("status") Integer status);
     int updateStatusByOrderID(@Param("orderID") Integer orderID, @Param("status") Integer status);

+ 23 - 0
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -124,6 +124,8 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
     private CmCouponClubDao cmCouponClubDao;
     private CmCouponClubDao cmCouponClubDao;
     @Autowired
     @Autowired
     private HeHeNewOrderDao heHeNewOrderDao;
     private HeHeNewOrderDao heHeNewOrderDao;
+    @Autowired
+    private WeChatService weChatService;
 
 
     @Transactional(readOnly = false)
     @Transactional(readOnly = false)
     public void updateClauseContent(NewOrder newOrder) {
     public void updateClauseContent(NewOrder newOrder) {
@@ -1517,6 +1519,27 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
 
 
         String statusSuffix = "";
         String statusSuffix = "";
         if (shopOrders.stream().allMatch(s -> "3".equals(s.getSendOutStatus()))) {
         if (shopOrders.stream().allMatch(s -> "3".equals(s.getSendOutStatus()))) {
+            Date date=new Date();
+            if("0".equals(order.getSecondHandOrderFlag()) && "0".equals(order.getRebateFlag())) {
+                logger.info("*************发货微信消息推送****************");
+                try {
+                    String accessToken = weChatService.getAccessToken();
+                    Integer userid = order.getUserID();
+                    String unionid = newShopOrderDao.getOpenidunionId(order.getUserID());
+                    List<String> openidList = newShopOrderDao.getOpenidListByPermission(userid, unionid);
+                    logger.info("userid>>>>>>>>>>>>>>>" + order.getUserID() + "unionid" + newShopOrderDao.getOpenidunionId(order.getUserID()) + "openid" + openidList);
+                    String orderNo = order.getOrderNo();
+                    String time = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
+                    String company = StringUtils.strip(logisticsInfo.keySet().toString(), "[]");
+                    String companyno = StringUtils.strip(logisticsInfo.values().toString(), "[]");
+                    String pagePath = "pages/user/order/order-details?orderId=" + order.getOrderID();
+                    for (String openid : openidList) {
+                        weChatService.sendTemplateMsgy(accessToken, openid, orderNo, time, company, companyno, pagePath);
+                    }
+                } catch (Exception e) {
+                    logger.error("【订单发货通知】获取微信公众号access_token异常!", e);
+                }
+            }
             //所有的子订单都已经完成发货了
             //所有的子订单都已经完成发货了
             statusSuffix = "3";
             statusSuffix = "3";
             order.setSendOutStatus("3");
             order.setSendOutStatus("3");

+ 1 - 0
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -208,6 +208,7 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
             liv.setLogisticsInformationList(lis);
             liv.setLogisticsInformationList(lis);
             liv.setLogisticsRecordList(lrs);
             liv.setLogisticsRecordList(lrs);
             result.add(liv);
             result.add(liv);
+
         }
         }
         return result;
         return result;
     }
     }

+ 99 - 0
src/main/java/com/caimei/modules/order/service/WeChatService.java

@@ -0,0 +1,99 @@
+package com.caimei.modules.order.service;
+import com.alibaba.fastjson.JSONObject;
+import com.caimei.modules.utils.RequestUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2022/4/12
+ */
+@Service
+public class WeChatService {
+    @Value("${wx.crm-app-id}")
+    private String crmAppId;
+    @Value("${wx.crm-app-secret}")
+    private String crmAppSecret;
+
+    protected Logger logger = LoggerFactory.getLogger(getClass());
+
+    /**
+     * 微信公众号获取access_token
+     *
+     * @return access_token
+     */
+    public String getAccessToken() throws Exception {
+        String link = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
+        link = link.replace("APPID", "wx91c4152b60ca91a3");
+        link = link.replace("APPSECRET", "a563dd2c07c9c815a4e697c8b6cb73dc");
+        String result = RequestUtil.sendGet(link);
+        logger.info("微信公众号获取access_token>>>" + result);
+        Map<String, Object> map = JSONObject.parseObject(result, Map.class);
+        String access_token = (String) map.get("access_token");
+
+        return access_token;
+    }
+
+    /**
+     * 发货消息推送
+     * @param accessToken
+     * @param openid
+     * @param orderno 订单编号
+     * @param time 发货时间
+     * @param company 快递名称
+     * @param companyno 快递编号
+     * @param pagePath 跳转链接
+     */
+    public void sendTemplateMsgy(String accessToken, String openid, String orderno,String time, String company, String companyno, String pagePath) {
+        JSONObject first = new JSONObject();
+        first.put("value", "尊敬的采美客户,您购买的订单已经发货啦~");
+        JSONObject keyword1 = new JSONObject();
+        keyword1.put("value", orderno);
+        JSONObject keyword2 = new JSONObject();
+        keyword2.put("value", time);
+        JSONObject keyword3 = new JSONObject();
+        keyword3.put("value", company);
+        JSONObject keyword4 = new JSONObject();
+        keyword4.put("value", companyno);
+        JSONObject remark = new JSONObject();
+        remark.put("value", "收到货后请记得确认收货哟~");
+        remark.put("color", "#c4c400");
+
+        JSONObject data = new JSONObject();
+        data.put("first", first);
+        data.put("keyword1", keyword1);
+        data.put("keyword2", keyword2);
+        data.put("keyword3", keyword3);
+        data.put("keyword4", keyword4);
+        data.put("remark", remark);
+
+        JSONObject miniProgram = new JSONObject();
+        miniProgram.put("appid", "wxf3cd4ae0cdd11c36");
+        miniProgram.put("pagepath", pagePath);
+
+        JSONObject json = new JSONObject();
+        json.put("touser", openid);
+        json.put("template_id", "_Zc6WiUp3hM4yBgT30HkTyA-SmcCN-sjnGpIa6n3rKI");
+        json.put("url", "https://www.caimei365.com/");
+        json.put("miniprogram", miniProgram);
+        json.put("data", data);
+        // json 字符串
+        String jsonString = json.toJSONString();
+        logger.info(">>>>>>>>推送微信模板消息:" + jsonString);
+        try {
+            String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+accessToken;
+            // 发送请求
+            String result = RequestUtil.httpRequest(requestUrl, "POST", jsonString);
+            logger.info(">>>>>>>>推送结果:" + result);
+        } catch (Exception e) {
+            logger.info(">>>>>>>>>推送微信模板消息失败:",e);
+        }
+    }
+}

+ 2 - 2
src/main/java/com/caimei/modules/order/web/NewOrderController.java

@@ -36,7 +36,6 @@ import com.caimei.modules.user.service.CmUserService;
 import com.caimei.modules.user.service.NewCmShopService;
 import com.caimei.modules.user.service.NewCmShopService;
 import com.caimei.modules.user.utils.UserType;
 import com.caimei.modules.user.utils.UserType;
 import com.caimei.po.ProductLadderPrice;
 import com.caimei.po.ProductLadderPrice;
-import com.caimei.utils.AppKeys;
 import com.caimei.utils.AppUtils;
 import com.caimei.utils.AppUtils;
 import com.caimei.utils.MathUtil;
 import com.caimei.utils.MathUtil;
 import com.caimei.utils.StringUtil;
 import com.caimei.utils.StringUtil;
@@ -786,7 +785,6 @@ public class NewOrderController extends BaseController {
         r.put("data", orderProductList);
         r.put("data", orderProductList);
         return r;
         return r;
     }
     }
-
     @RequestMapping("toShipLogistic")
     @RequestMapping("toShipLogistic")
     public String toShipLogistic(Integer orderID, Model model) {
     public String toShipLogistic(Integer orderID, Model model) {
         model.addAttribute("orderID", orderID);
         model.addAttribute("orderID", orderID);
@@ -889,6 +887,7 @@ public class NewOrderController extends BaseController {
             result.put("msg", e.getMessage());
             result.put("msg", e.getMessage());
             return result;
             return result;
         }
         }
+
         result.put("success", true);
         result.put("success", true);
         result.put("logisticsBatchId", logisticsBatchId);
         result.put("logisticsBatchId", logisticsBatchId);
         return result;
         return result;
@@ -1381,6 +1380,7 @@ public class NewOrderController extends BaseController {
     public String logisticsDetails(Integer orderID, String logisticsBatchID, Model model, Integer orderType) {
     public String logisticsDetails(Integer orderID, String logisticsBatchID, Model model, Integer orderType) {
         List<LogisticsInfoVo> logisticsInfoVos = new ArrayList<>();
         List<LogisticsInfoVo> logisticsInfoVos = new ArrayList<>();
         logisticsInfoVos = newShopOrderService.logisticsDetails(orderID, logisticsBatchID);
         logisticsInfoVos = newShopOrderService.logisticsDetails(orderID, logisticsBatchID);
+
         model.addAttribute("orderID", orderID);
         model.addAttribute("orderID", orderID);
         model.addAttribute("orderType", orderType);
         model.addAttribute("orderType", orderType);
         model.addAttribute("logisticsInfoVos", logisticsInfoVos);
         model.addAttribute("logisticsInfoVos", logisticsInfoVos);

+ 188 - 0
src/main/java/com/caimei/modules/utils/RequestUtil.java

@@ -0,0 +1,188 @@
+package com.caimei.modules.utils;
+
+import org.springframework.util.StringUtils;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import java.io.*;
+import java.net.URL;
+import java.net.URLConnection;
+import java.nio.charset.StandardCharsets;
+import java.security.cert.X509Certificate;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 请求工具类
+ *
+ * @author : Charles
+ * @date : 2021/3/8
+ */
+public class RequestUtil {
+
+    /**
+     * 向指定URL发送GET方法的请求
+     *
+     * @param url   发送请求的URL,请求参数应该是 name1=value1&name2=value2 的形式。
+     * @return 远程资源的响应结果
+     */
+    public static String sendGet(String url) throws Exception {
+        StringBuilder result = new StringBuilder();
+        BufferedReader in = null;
+        try {
+
+            URL realUrl = new URL(url);
+            // 打开和URL之间的连接
+            URLConnection connection = realUrl.openConnection();
+            // 设置通用的请求属性
+            connection.setRequestProperty("accept", "*/*");
+            connection.setRequestProperty("connection", "Keep-Alive");
+            connection.setRequestProperty("Accept-Charset", "utf-8");
+            connection.setRequestProperty("contentType", "utf-8");
+            connection.setConnectTimeout(5000);
+            // 建立实际的连接
+            connection.connect();
+            // 获取所有响应头字段
+            Map<String, List<String>> map = connection.getHeaderFields();
+            // 定义 BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(new InputStreamReader(
+                    connection.getInputStream()));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result.append(line);
+            }
+        }
+        // 使用finally块来关闭输入流
+        finally {
+            if (in != null) {
+                in.close();
+            }
+        }
+        return result.toString();
+    }
+
+    /**
+     * 向指定 URL 发送POST方法的请求
+     *
+     * @param url 发送请求的 URL
+     * @param paramMap 请求参数
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendPost(String url, Map<String, ?> paramMap) throws Exception{
+        PrintWriter out = null;
+        BufferedReader in = null;
+        StringBuilder result = new StringBuilder();
+
+        StringBuilder param = new StringBuilder();
+
+        for (String key : paramMap.keySet()) {
+            param.append(key).append("=").append(paramMap.get(key)).append("&");
+        }
+
+        try {
+            URL realUrl = new URL(url);
+            // 打开和URL之间的连接
+            URLConnection conn = realUrl.openConnection();
+            // 设置通用的请求属性
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("Accept-Charset", "utf-8");
+            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            // 发送POST请求必须设置如下两行
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            out = new PrintWriter(conn.getOutputStream());
+            // 发送请求参数
+            out.print(param);
+            // flush输出流的缓冲
+            out.flush();
+            // 定义BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result.append(line);
+            }
+        }
+        //使用finally块来关闭输出流、输入流
+        finally{
+            if(out!=null){
+                out.close();
+            }
+            if(in!=null){
+                in.close();
+            }
+        }
+        return result.toString();
+    }
+
+    /**
+     * 向指定 URL 发送请求
+     * @param requestUrl 发送请求的 URL
+     * @param requestMethod 请求方法GET/POST
+     * @param jsonString json字符串参数
+     * @return 远程资源的响应结果
+     */
+    public static String httpRequest(String requestUrl, String requestMethod, String jsonString) {
+        StringBuffer buffer = new StringBuffer();
+        try {
+            // 创建SSLContext对象,并使用我们指定的信任管理器初始化
+            TrustManager[] tm = {
+                    new javax.net.ssl.X509TrustManager(){
+                        @Override
+                        public void checkClientTrusted(X509Certificate[] chain, String authType) {
+                        }
+                        @Override
+                        public void checkServerTrusted(X509Certificate[] chain, String authType) {
+                        }
+                        @Override
+                        public X509Certificate[] getAcceptedIssuers() {
+                            return null;
+                        }
+                    }
+            };
+            SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
+            sslContext.init(null, tm, new java.security.SecureRandom());
+            // 从上述SSLContext对象中得到SSLSocketFactory对象
+            SSLSocketFactory ssf = sslContext.getSocketFactory();
+
+            URL url = new URL(requestUrl);
+            HttpsURLConnection httpUrlConn = (HttpsURLConnection) url.openConnection();
+            httpUrlConn.setSSLSocketFactory(ssf);
+            httpUrlConn.setDoOutput(true);
+            httpUrlConn.setDoInput(true);
+            httpUrlConn.setUseCaches(false);
+            // 设置请求方式(GET/POST)
+            httpUrlConn.setRequestMethod(requestMethod);
+            if ("GET".equalsIgnoreCase(requestMethod)) {
+                httpUrlConn.connect();
+            }
+            // 当有数据需要提交时
+            if (StringUtils.hasLength(jsonString)) {
+                OutputStream outputStream = httpUrlConn.getOutputStream();
+                // 注意编码格式,防止中文乱码
+                outputStream.write(jsonString.getBytes(StandardCharsets.UTF_8));
+                outputStream.close();
+            }
+
+            // 将返回的输入流转换成字符串
+            InputStream inputStream = httpUrlConn.getInputStream();
+            InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
+            BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
+            String str = null;
+            while ((str = bufferedReader.readLine()) != null) {
+                buffer.append(str);
+            }
+            bufferedReader.close();
+            inputStreamReader.close();
+            // 释放资源
+            inputStream.close();
+            httpUrlConn.disconnect();
+            return buffer.toString();
+        } catch (Exception ignored) {}
+        return null;
+    }
+
+}

+ 28 - 0
src/main/resources/mappings/modules/bulkpurchase/CommissionsMapper.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.modules.bulkpurchase.dao.CommissionsDao">
+
+<select id="findList" resultType="com.caimei.modules.bulkpurchase.entity.Commissions">
+    SELECT id,orderid,`name`,`addtime`,sales,script
+    FROM `sales_commissions`
+    WHERE orderid=#{orderId}
+    ORDER BY `addtime` DESC
+</select>
+
+
+    <insert id="insert" parameterType="com.caimei.modules.bulkpurchase.entity.Commissions" keyProperty="id"
+            useGeneratedKeys="true">
+        INSERT INTO `sales_commissions`
+        (orderid,
+         name,
+         `addtime`,
+         `sales`,
+         script)
+        VALUES (#{orderId},
+                #{name},
+                #{addTime},
+                #{sales},
+                #{script})
+    </insert>
+
+</mapper>

+ 80 - 0
src/main/resources/mappings/modules/newhome/AnnouncementMapper.xml

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.modules.newhome.dao.AnnouncementDao">
+
+
+    <select id="findList" resultType="com.caimei.modules.newhome.entity.Announcementmanagement">
+        SELECT id,title,`state`,Creationtime,livetime,Offlinetime
+        FROM `announcement_management`
+
+        <where>
+            <if test="title != null and title != ''">
+                AND title = #{title}
+            </if>
+            <if test="state != null and state != 0">
+                AND `state` = #{state}
+            </if>
+        </where>
+        order by Creationtime desc
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+        </choose>
+    </select>
+
+
+    <select id="announlist" resultType="com.caimei.modules.newhome.entity.Announcementmanagement">
+        SELECT id,title,capacity,`state`,Creationtime,livetime,Offlinetime
+        FROM `announcement_management`
+
+        <where>
+            <if test="id != null and id != ''">
+                AND id = #{id}
+            </if>
+        </where>
+    </select>
+
+
+    <insert id="insert" parameterType="com.caimei.modules.newhome.entity.Announcementmanagement" keyProperty="id"
+            useGeneratedKeys="true">
+        INSERT INTO `announcement_management`
+        (title,
+         capacity,
+         `state`,
+         Creationtime,
+         livetime)
+        VALUES (#{title},
+                #{capacity},
+                #{state},
+                #{creationtime},
+                #{livetime})
+    </insert>
+
+
+    <update id="update">
+
+        UPDATE announcement_management SET title = #{title}, capacity = #{capacity}
+        WHERE id = #{id}
+
+    </update>
+
+    <update id="online">
+
+        UPDATE announcement_management SET state = #{state}, livetime=#{livetime},offlinetime= #{offlinetime}
+        WHERE id = #{id}
+
+    </update>
+
+    <update id="line">
+
+        UPDATE announcement_management SET state = #{state}, offlinetime= #{offlinetime}
+        WHERE id = #{id}
+
+    </update>
+
+<delete id="deletes">
+    DELETE FROM announcement_management WHERE id=#{id}
+</delete>
+
+</mapper>

+ 11 - 0
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -1107,4 +1107,15 @@
         GROUP BY a.shopOrderID
         GROUP BY a.shopOrderID
         ORDER BY a.shopOrderID DESC
         ORDER BY a.shopOrderID DESC
     </select>
     </select>
+    <select id="getOpenidListByPermission" resultType="java.lang.String">
+        SELECT DISTINCT cm.crmopenid FROM  `cm_mall_operation_user` cm
+         LEFT JOIN `user` u ON u.userID = cm.userID
+        WHERE u.userID=#{userid} AND cm.unionId= #{unionid}
+    </select>
+
+    <select id="getOpenidunionId" resultType="java.lang.String">
+        SELECT DISTINCT cm.unionId FROM  `cm_mall_operation_user` cm
+        LEFT JOIN `user` u ON u.userID = cm.userID
+        WHERE u.userID=#{userid}  AND cm.id=1068
+    </select>
 </mapper>
 </mapper>

+ 163 - 0
src/main/webapp/WEB-INF/views/modules/bulkpurchase/addCommissionsForm.jsp

@@ -0,0 +1,163 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>订单备注</title>
+	<meta name="decorator" content="default"/>
+	<style>
+        .form-horizontal .controls {
+            margin-left: 0;
+        }
+
+        .dateInput input {
+            width: 150px;
+        }
+
+        .clause span {
+            margin-left: 30px;
+        }
+
+        #productTable th {
+            text-align: center;
+            white-space: nowrap;
+        }
+
+        #productTable td {
+            text-align: center;
+            white-space: nowrap;
+        }
+        .controls{
+            font-size: 0;
+        }
+        .controls .conList{
+            display: inline-block;
+            margin-right: 15px;
+        }
+        .conList .btn:nth-of-type(1){
+            margin-left: 25px;
+        }
+        .upload-content {
+            margin-top: -70px;
+            display: inline-block;
+        }
+        .upload-content .conList .btn:nth-of-type(1) {
+            width: 90px;
+            height: 100px;
+            border: 2px solid #eee;
+            background: #fff;
+            position: relative;
+        }
+        .upload-content .conList .btn:nth-of-type(1)>div {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            color: #666;
+        }
+        .upload-content .conList .btn:nth-of-type(1) span {
+            font-size: 35px;
+        }
+        .upload-content .conList .btn:nth-of-type(1) h5 {
+            color: #666;
+        }
+        .cancel-upload {
+            background: transparent;
+            border: none;
+            box-shadow: none;
+            position: relative;
+            top: -38px;
+            left: -25px;
+            cursor: pointer;
+            z-index: 100;
+        }
+         .upload-content .conList ol li {
+            width: 114px;
+            min-height: 80px;
+            text-align: center;
+            background: #fff;
+            position: relative;
+            top: 120px;
+            margin-left: 2px;
+        }
+        .hide-pic {
+            display: none !important;
+        }
+        #file-list-display p .del {
+            color: #2fa4e7;
+            font-size: 12px;
+            cursor: pointer;
+            margin-left: 20px;
+        }
+        #bx{
+            display: none;
+        }
+
+    </style>
+
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/order/detail?id=${orderId}">订单详细</a></li>
+    <li><a href="${ctx}/bulkpurchase/commissions/list">销售提成记录</a></li>
+    <li class="active"><a href="${ctx}/bulkpurchase/commissions/form">添加销售提成记录</a></li>
+</ul>
+<br/>
+<form:form id="inputForm" modelAttribute="commissions" onsubmit="return cm()" action="${ctx}/bulkpurchase/commissions/save" method="post" class="form-horizontal">
+    <sys:message content="${message}"/>
+
+    <div style="height: 272px;overflow-y: auto;overflow-x: hidden;word-break:break-all">
+        <tr>
+            <td>
+                    <%--                        <form:radiobutton path="sales" onclick="hi()" name="sales" value="1" label="已计算提成情况"/>--%>
+                    <%--                        <br/> <br/>--%>
+                    <%--                        <form:radiobutton path="sales" onclick="hi()" name="sales" value="2" label="已退销售提成"/>--%>
+
+                <input type="radio" id="sales"  name="sales" value="已计算提成情况">已计算提成情况 &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp;
+                <input type="radio" id="sales" value="已退销售提成" name="sales">已退销售提成
+                        <span id="bx">*必填</span>
+
+            </td>
+        </tr>
+
+        <br/>
+        <tr>
+            <td>
+                <div class="control-group">
+                    <label class="control-label"><font color="red">*</font>备注内容:</label>
+                    <textarea id='script' name='script'  rows='5' placeholder="不超过200字。" cols='12' style="width: 700px" maxlength="300"></textarea>
+                </div>
+            </td>
+        </tr>
+    </div>
+    <td colspan="5" style="text-align:center;">
+
+        <input id="btnSave" class="btn btn-primary" type="submit"  value="保 存"/>
+        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+
+    </td>
+
+</form:form>
+
+<script>
+
+    function cm(){
+          var sales=document.getElementsByName("sales");
+        var bx =document.getElementById("bx");
+        var script =document.getElementById("script");
+          if (sales[0].checked || sales[1].checked){
+             return true;
+          }else {
+              bx.style.color="red"
+             bx.style.display="block";
+              return false;
+          }
+          if(script.innerText.length>200){
+              script.focus();
+              alertx("备注不能超过200字");
+          }
+
+    }
+</script>
+
+</body>
+</html>

+ 43 - 0
src/main/webapp/WEB-INF/views/modules/bulkpurchase/cmCommissionsForm.jsp

@@ -0,0 +1,43 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>订单备注</title>
+	<meta name="decorator" content="default"/>
+</head>
+<body>
+<ul class="nav nav-tabs">
+	<li><a href="${ctx}/order/detail?id=${orderId}">订单详细</a></li>
+	<li class="active"><a href="${ctx}/bulkpurchase/commissions/list">销售提成记录</a></li>
+	<li><a href="${ctx}/bulkpurchase/commissions/form">添加销售提成记录</a></li>
+</ul>
+<br/>
+<form:form id="inputForm" modelAttribute="commissions" action="${ctx}/bulkpurchase/commissions/save" method="post" class="form-horizontal">
+	<sys:message content="${message}"/>
+
+
+	<div style="height: 272px;overflow-y: auto;overflow-x: hidden;word-break:break-all">
+	<c:forEach items="${list}" var="list" varStatus="remark">
+		<c:if test="${not empty list}">
+			<tr>
+				<td>${list.name} &nbsp; &nbsp; &nbsp; &nbsp; <span><fmt:formatDate value="${list.addTime}" type="both" pattern="yyyy-MM-dd HH:mm"/></span>
+				</td>
+				<br>
+				<td>${list.sales}</td>
+			</tr>
+			<c:if test="${not empty list.script}">
+				<br>
+				<td>备注:${list.script}</td>
+			</c:if>
+			<hr style="height:1px;border:none;border-top:1px dashed #0066CC;" />
+	</c:if>
+		<c:if test="${empty list.name}">
+
+			<font size="2" style="text-align: center;display: block;line-height: 60px;" color="#0066CC">暂无信息,有需要请备注!!</font>
+		</c:if>
+	</div>
+
+	</c:forEach>
+</form:form>
+</body>
+</html>

+ 268 - 0
src/main/webapp/WEB-INF/views/modules/newhome/announcementForm.jsp

@@ -0,0 +1,268 @@
+<%@ page import="com.thinkgem.jeesite.common.config.Global" %>
+<%@ taglib prefix="input" uri="/struts-tags" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>编辑商品</title>
+    <meta name="decorator" content="default"/>
+    <style>
+        .red {
+            color: red;
+            display: none;
+        }
+
+        .blue {
+            color: rgb(0, 100, 180);
+        }
+
+        #inputForm {
+            max-width: 1200px;
+            width: 100%;
+        }
+
+        #inputForm table {
+            width: 100%;
+            line-height: 18px;
+            margin-bottom: 50px;
+        }
+
+        #inputForm th, #inputForm td {
+            font-weight: normal;
+            text-align: left;
+            padding: 8px 5px;
+            border-bottom: 1px solid rgb(238, 238, 238);
+        }
+
+        #inputForm th {
+            width: 15%;
+            text-align: right;
+            white-space: nowrap;
+            font-weight: bold;
+        }
+
+        #inputForm td input[type="text"] {
+            width: 320px;
+            height: 16px;
+            line-height: 16px;
+        }
+
+        #inputForm td input.short {
+            width: 110px;
+        }
+
+        #inputForm td b.line {
+            margin: 0 15px 0 20px;
+            font-weight: normal
+        }
+
+        #allAreaInput {
+            padding: 10px 0 0 100px;
+        }
+
+        #inputForm .item {
+            line-height: 28px;
+        }
+
+        #ladderPriceBox {
+            border-top: 1px solid rgb(238, 238, 238);
+            margin-top: 8px;
+            padding-top: 8px;
+        }
+
+        #ladderPriceBox > div {
+            margin-bottom: 5px;
+        }
+
+        .priceIcon:before {
+            content: '\2729';
+            color: #aaa;
+            font-size: 18px;
+            font-style: normal;
+        }
+
+        .priceIcon.full:before {
+            content: '\272E';
+            color: #ffbd14;
+        }
+
+        #slider {
+            width: 335px;
+        }
+
+        .skword input {
+            margin: 2px 0;
+        }
+
+        .skword p {
+            margin: 2px 0;
+        }
+
+        .params input {
+            margin: 2px 0;
+        }
+
+        .tags input {
+            margin: 2px 0;
+        }
+
+        #tagsList {
+            margin: 2px 0;
+            display: none;
+            width: 600px;
+        }
+
+        .tags-li {
+            margin: 10px;
+            display: inline-block;
+            padding: 5px 10px;
+            line-height: 16px;
+            text-align: center;
+            position: relative;
+            font-size: 12px;
+            border: 1px solid #EBEBEB;
+            border-radius: 4px;
+        }
+
+        .tags-li i {
+            font-style: normal;
+            line-height: 20px;
+            display: block;
+            position: absolute;
+            width: 16px;
+            height: 16px;
+            text-align: center;
+            background: rgba(0, 0, 0, 0.2);
+            border-radius: 50%;
+            top: -8px;
+            right: -7px;
+            cursor: pointer;
+        }
+
+        .tags-li .tags-s {
+            background: #FFF;
+            width: auto !important;
+            outline: none;
+            border: none;
+        }
+    </style>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/newhome/Announcement/">公告管理</a></li>
+    <li class="active"><a href="${ctx}/newhome/Announcement/forms">添加</a></li>
+</ul>
+<form id="inputForm" modelAttribute="announcementmanagement" onsubmit="return um()" action="${ctx}/newhome/Announcement/save" method="post" class="form-horizontal">
+    <sys:message content="${message}"/>
+    <table border="0" cellspacing="0" cellpadding="0" width="100%">
+        <tr>
+            <th><span id="bx4" class="red">*</span>标题:</th>
+            <td colspan="3">
+                <input name="title" id="title" maxlength="100" value="${Announcementmanagement.title}"
+                       onchange="checkmaxlength(this.value)"
+                       style="width: 360px;" placeholder="请输入公告标题,30字以内。" class="input-small required"/>
+                <span id="bx3" class="red">*必填</span>
+                <span id="bx1" class="red">*标题不能大于30字</span>
+            </td>
+
+
+        </tr>
+
+        <tr>
+            <th><span id="bx2" class="red">*</span>内容: <span id="bx5" class="red">*必填</span></th>
+            <td colspan="4" style="vertical-align: top;">
+                <div class="detailInfoEditor" style="width: 620px;">
+                    <textarea name="capacity" id="capacity">${Announcementmanagement.capacity}</textarea>
+                </div>
+
+            </td>
+
+        </tr>
+
+        <tr>
+            <td colspan="5" style="text-align:center;">
+                <shiro:hasPermission name="product:product:edit">
+                    <input id="btnSave" class="btn btn-primary" type="submit" value="保 存"/>
+                </shiro:hasPermission>
+                <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+            </td>
+        </tr>
+        <c:if test="${not empty Announcementmanagement.id}">
+            <tr id="zt">
+                <td colspan="4" style="vertical-align: top;">
+                    <c:if test="${Announcementmanagement.state==1}">
+                        状态:已上线<br>
+                        上线时间:<fmt:formatDate value="${Announcementmanagement.livetime}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/>
+                    </c:if>
+                    <c:if test="${Announcementmanagement.state==2}">
+                        状态:已下线<br>
+                        下线时间:<fmt:formatDate value="${Announcementmanagement.offlinetime}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/>
+                    </c:if>
+                </td>
+            </tr>
+        </c:if>
+    </table>
+</form>
+
+<!-- 富文本编辑器 -->
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
+<script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
+<script type="text/javascript">
+
+
+//判断非空
+    function um(){
+        var capacity=document.getElementById("capacity").value.length;
+        var title=document.getElementById("title").value.length;
+        var bx1=document.getElementById("bx1");
+        var bx2=document.getElementById("bx2");
+        var bx3=document.getElementById("bx3");
+        var bx4=document.getElementById("bx4");
+        var bx5=document.getElementById("bx5");
+        if(capacity==0){
+            bx2.style.display="block";
+            bx3.style.display="block";
+            bx4.style.display="block";
+            bx5.style.display="block";
+            return false;
+        }
+
+        if(title==0){
+            bx2.style.display="block";
+            bx3.style.display="block";
+            bx4.style.display="block";
+            bx5.style.display="block";
+        return false;
+       }
+        if(title>30){
+            bx1.style.display="block";
+            return false;
+        }
+    }
+
+    function changeTR(selectedValue) {
+        var tr1 = document.getElementById("zt");
+
+        if (selectedValue == 0) {
+            tr1.style.display = 'block';
+        } else {
+            tr1.style.display = 'none';
+        }
+    }
+
+    //富文本框
+    ClassicEditor.create(document.querySelector('#capacity'), {
+        ckfinder: {
+            uploadUrl: '${caimeiCore}/tools/image/upload/ckeditor'
+        }
+    }).then(function (capacity) {
+        window.detailInfoEditor = capacity;
+    }).catch(function (error) {
+        console.log(error);
+    });
+</script>
+
+</body>
+</html>
+
+

+ 112 - 0
src/main/webapp/WEB-INF/views/modules/newhome/announcementList.jsp

@@ -0,0 +1,112 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<html>
+<head>
+    <title>公告列表</title>
+    <meta name="decorator" content="default"/>
+    <style type="text/css">
+        .table th {
+            text-align: center;
+        }
+
+        .table td {
+            text-align: center;
+        }
+    </style>
+    <script type="text/javascript">
+        $(document).ready(function () {
+
+        });
+
+        function page(n, s) {
+            $("#pageNo").val(n);
+            $("#pageSize").val(s);
+            $("#searchForm").submit();
+            return false;
+        }
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li class="active"><a href="${ctx}/newhome/Announcement/">公告管理</a></li>
+    <li><a href="${ctx}/newhome/Announcement/forms">添加</a></li>
+</ul>
+<form id="searchForm" modelAttribute="announcementmanagement" action="${ctx}/newhome/Announcement" method="post"
+           class="breadcrumb form-search">
+    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+    <div class="ul-form">
+        <label>标题:</label>
+        <input name="title" maxlength="50" class="input-medium"/>
+        <label>状态:</label>
+        <select name="state" class="input-medium">
+            <option selected value="0">全部</option>
+            <option value="1">已上线</option>
+            <option value="2">已下线</option>
+        </select>
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+    </div>
+    &nbsp;
+</form>
+<sys:message content="${message}"/>
+<table id="contentTable" class="table table-striped table-bordered table-condensed">
+    <thead>
+    <tr>
+        <th>序号</th>
+        <th>标题</th>
+        <th>状态</th>
+        <th>创建时间</th>
+        <th>上线时间</th>
+        <th>下线时间</th>
+        <th>操作</th>
+    </tr>
+    </thead>
+    <tbody>
+    <c:forEach items="${page.list}" var="cmop">
+        <tr>
+            <td>
+                ${cmop.id}
+            </td>
+            <td>
+                    ${empty cmop.title ? "________" : cmop.title}
+            </td>
+            <c:if test="${cmop.state==1}">
+                <td style="color: green">
+                       已上线
+                </td>
+            </c:if>
+            <c:if test="${cmop.state==2}">
+                <td style="color: red">
+                    已下线
+                </td>
+            </c:if>
+
+            <td>
+                <fmt:formatDate value="${cmop.creationtime}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/>
+            </td>
+            <td><fmt:formatDate value="${cmop.livetime}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+
+            <td><fmt:formatDate value="${cmop.offlinetime}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/></td>
+            <td>
+                <a href="${ctx}/newhome/Announcement/form?id=${cmop.id}">编辑</a>
+                <c:if test="${cmop.state==2}">
+                    <a href="${ctx}/newhome/Announcement/online?id=${cmop.id}">上线</a>
+                </c:if>
+                <c:if test="${cmop.state==1}">
+                    <a href="${ctx}/newhome/Announcement/line?id=${cmop.id}">下线</a>
+                </c:if>
+
+                <a href="${ctx}/newhome/Announcement/detele?id=${cmop.id}">删除</a>
+            </td>
+        </tr>
+    </c:forEach>
+    </tbody>
+</table>
+<div class="pagination">${page}</div>
+<script type="text/javascript" language="javascript">
+
+</script>
+</body>
+</html>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp

@@ -713,7 +713,7 @@
                     <a href="${ctx}/order/exportOrder?id=${order.orderID}">订单导出</a>
                     <a href="${ctx}/order/exportOrder?id=${order.orderID}">订单导出</a>
                     <%--                        <a href="javascript:void(0);" onclick="remarks('${order.orderID}','')">备注</a>--%>
                     <%--                        <a href="javascript:void(0);" onclick="remarks('${order.orderID}','')">备注</a>--%>
                     <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2">订单备注</a>
                     <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2">订单备注</a>
-                    <%--包含订单充值商品就不显示--%>
+                    <a href="${ctx}/bulkpurchase/commissions?orderId=${order.orderID}">销售提成记录</a>                    <%--包含订单充值商品就不显示--%>
                     <c:if test="${empty order.rechargeGoods}">
                     <c:if test="${empty order.rechargeGoods}">
                         <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6}">
                         <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6}">
                             <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}">发货记录</a>
                             <a href="${ctx}/order/logisticsDetails?orderID=${order.orderID}">发货记录</a>