修改区域公司

dev-discount
袁野 2 years ago
parent 5f749c0ba9
commit 85659987ac
  1. 35
      hai-bweb/src/main/java/com/bweb/controller/BsMsgController.java
  2. 5
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  3. 2
      hai-bweb/src/main/resources/dev/application.yml
  4. 2
      hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java
  5. 5
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  6. 2
      hai-cweb/src/main/resources/dev/application.yml
  7. BIN
      hai-service/src/main/java/com/hai/entity/._BsMsg.java
  8. 3
      hai-service/src/main/java/com/hai/service/BsMsgService.java
  9. 30
      hai-service/src/main/java/com/hai/service/impl/BsMsgServiceImpl.java

@ -2,6 +2,9 @@ package com.bweb.controller;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject; import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
@ -19,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -86,7 +90,11 @@ public class BsMsgController {
bsMsg.setCompanyId(userInfoModel.getBsCompany().getId()); bsMsg.setCompanyId(userInfoModel.getBsCompany().getId());
bsMsg.setOpId(userInfoModel.getSecUser().getId()); bsMsg.setOpId(userInfoModel.getSecUser().getId());
bsMsg.setOpName(userInfoModel.getSecUser().getUserName()); bsMsg.setOpName(userInfoModel.getSecUser().getUserName());
bsMsgService.insertMsg(bsMsg); bsMsg.setMsgType(2);
bsMsg.setStatus(1);
bsMsg.setCreateTime(new Date());
bsMsg.setUpdateTime(new Date());
bsMsgService.insertMsg(bsMsg , null);
return ResponseMsgUtil.success("新增成功"); return ResponseMsgUtil.success("新增成功");
} catch (Exception e) { } catch (Exception e) {
@ -94,4 +102,29 @@ public class BsMsgController {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }
@RequestMapping(value = "/pushMsg", method = RequestMethod.GET)
@ApiOperation(value = "发布站内信")
@ResponseBody
public ResponseData pushMsg(@RequestParam(value = "id", required = true) Long id) {
try {
BsMsg bsMsg = bsMsgService.findMsg(id);
if (bsMsg == null) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR, "为查询到相关内容!");
}
if (bsMsg.getStatus() !=1) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前状态错误");
}
bsMsg.setStatus(2);
bsMsg.setUpdateTime(new Date());
bsMsgService.updateMsg(bsMsg);
return ResponseMsgUtil.success("发布成功");
} catch (Exception e) {
log.error("CmsContentController --> delContent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

File diff suppressed because one or more lines are too long

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://139.159.177.244:3306/hsg_order?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: HF123456. password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource

@ -75,7 +75,7 @@ public class CmsContentController {
object.put("sort" , cmsCategory.getSort()); object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode()); object.put("code" , cmsCategory.getCode());
object.put("childCategory" , cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform)); object.put("childCategory" , cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform));
} else if(cmsCategory.getType() == 6) { } else if(cmsCategory.getType() == 6 || cmsCategory.getType() == 9) {
object.put("type" , cmsCategory.getType()); object.put("type" , cmsCategory.getType());
object.put("name" , cmsCategory.getName()); object.put("name" , cmsCategory.getName());
object.put("sort" , cmsCategory.getSort()); object.put("sort" , cmsCategory.getSort());

File diff suppressed because one or more lines are too long

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://139.159.177.244:3306/hsg_order?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: HF123456. password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource

@ -1,6 +1,7 @@
package com.hai.service; package com.hai.service;
import com.hai.entity.BsMsg; import com.hai.entity.BsMsg;
import com.hai.entity.HighUser;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -22,7 +23,7 @@ public interface BsMsgService {
* @Param [bsMsg] * @Param [bsMsg]
* @Return void * @Return void
*/ */
void insertMsg(BsMsg bsMsg); void insertMsg(BsMsg bsMsg , HighUser user);
/** /**
* @Author Sum1Dream * @Author Sum1Dream

@ -1,15 +1,22 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.hai.dao.BsMsgMapper; import com.hai.dao.BsMsgMapper;
import com.hai.dao.BsMsgUserMapper;
import com.hai.entity.BsMsg; import com.hai.entity.BsMsg;
import com.hai.entity.BsMsgExample; import com.hai.entity.BsMsgExample;
import com.hai.entity.BsMsgUser;
import com.hai.entity.HighUser;
import com.hai.service.BsMsgService; import com.hai.service.BsMsgService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.beans.Transient;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.jar.JarEntry;
/** /**
* @author sum1dream * @author sum1dream
@ -20,9 +27,25 @@ public class BsMsgServiceImpl implements BsMsgService {
@Resource @Resource
private BsMsgMapper bsMsgMapper; private BsMsgMapper bsMsgMapper;
@Resource
private BsMsgUserMapper bsMsgUserMapper;
@Override @Override
public void insertMsg(BsMsg bsMsg) { @Transactional
public void insertMsg(BsMsg bsMsg , HighUser user) {
bsMsgMapper.insert(bsMsg); bsMsgMapper.insert(bsMsg);
if (bsMsg.getMsgType()==1){
BsMsgUser bsMsgUser = new BsMsgUser();
bsMsgUser.setCreateTime(new Date());
bsMsgUser.setUpdateTime(new Date());
bsMsgUser.setMsgId(bsMsg.getId());
bsMsgUser.setUserName(user.getName());
bsMsgUser.setUserId(user.getId());
bsMsgUser.setUserPhone(user.getPhone());
bsMsgUser.setWhereCheck(false);
bsMsgUserMapper.insert(bsMsgUser);
}
} }
@Override @Override
@ -56,6 +79,11 @@ public class BsMsgServiceImpl implements BsMsgService {
if (MapUtils.getLong(map , "companyId") != null) { if (MapUtils.getLong(map , "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(map , "companyId")); criteria.andCompanyIdEqualTo(MapUtils.getLong(map , "companyId"));
} }
if (MapUtils.getInteger(map , "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map , "status"));
} else {
criteria.andStatusNotEqualTo(0);
}
return bsMsgMapper.selectByExample(example); return bsMsgMapper.selectByExample(example);
} }

Loading…
Cancel
Save