| | |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TBranchOfficeResp; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverResp; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemConfigService; |
| | |
| | | @ResponseBody |
| | | public Object start(Integer id) { |
| | | TBranchOffice tBranchOffice = tBranchOfficeService.selectById(id); |
| | | tBranchOffice.setStatus(1); |
| | | tBranchOffice.setStatus(StatusEnum.NORMAL.getCode()); |
| | | tBranchOfficeService.updateById(tBranchOffice); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | @ResponseBody |
| | | public Object updateStatus(Integer id) { |
| | | TBranchOffice tBranchOffice = tBranchOfficeService.selectById(id); |
| | | tBranchOffice.setStatus(2); |
| | | tBranchOffice.setStatus(StatusEnum.FREEZE.getCode()); |
| | | tBranchOfficeService.updateById(tBranchOffice); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | if(Objects.nonNull(o)){ |
| | | return o; |
| | | } |
| | | tBranchOffice.setStatus(1); |
| | | tBranchOffice.setStatus(StatusEnum.NORMAL.getCode()); |
| | | |
| | | tBranchOfficeService.insert(tBranchOffice); |
| | | return SUCCESS_TIP; |
| | |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tBranchOfficeId) { |
| | | tBranchOfficeService.deleteById(tBranchOfficeId); |
| | | TBranchOffice tBranchOffice = tBranchOfficeService.selectById(tBranchOfficeId); |
| | | tBranchOffice.setStatus(StatusEnum.DELETE.getCode()); |
| | | tBranchOfficeService.updateById(tBranchOffice); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletin; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TBroadcast; |
| | | import com.stylefeng.guns.modular.system.service.ITBroadcastService; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | public Object list(String createTime,String content) { |
| | | |
| | | EntityWrapper<TBroadcast> wrapper = new EntityWrapper<>(); |
| | | |
| | | if(StringUtils.hasLength(content)){ |
| | | wrapper.like("content",content); |
| | | } |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | | return tBroadcastService.selectList(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list-back") |
| | | @ResponseBody |
| | | public Object listBack(String condition) { |
| | | return tBroadcastService.selectList(null); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tBroadcastId) { |
| | | tBroadcastService.deleteById(tBroadcastId); |
| | | TBroadcast tBroadcast = tBroadcastService.selectById(tBroadcastId); |
| | | tBroadcast.setStatus(StatusEnum.DELETE.getCode()); |
| | | tBroadcastService.updateById(tBroadcast); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.controller.req.CouponSendReq; |
| | | import com.stylefeng.guns.modular.system.enums.CouponStatusEnum; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.TAgent; |
| | | import com.stylefeng.guns.modular.system.model.TUserToCoupon; |
| | | import com.stylefeng.guns.modular.system.service.ITUserToCouponService; |
| | |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | wrapper.between("create_time",startTime,endTime); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | | wrapper.orderBy(true,"create_time",false); |
| | | return tCouponService.selectList(wrapper); |
| | | } |
| | |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tCouponId) { |
| | | /*TCoupon tCoupon = tCouponService.selectById(tCouponId); |
| | | tCoupon.setCouponStatus(StatusEnum.DELETE.getCode()); |
| | | tCouponService.updateById(tCoupon);*/ |
| | | tCouponService.deleteById(tCouponId); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | if(StringUtils.hasLength(editionNo)){ |
| | | wrapper.like("editionNo",editionNo); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | | return tEditionService.selectList(wrapper); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tEditionId) { |
| | | tEditionService.deleteById(tEditionId); |
| | | TEdition tEdition = tEditionService.selectById(tEditionId); |
| | | tEdition.setStatus(StatusEnum.DELETE.getCode()); |
| | | tEditionService.updateById(tEdition); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.controller.util.LabelReplaceUtil; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletinUser; |
| | |
| | | |
| | | @Autowired |
| | | private ITSystemBulletinService tSystemBulletinService; |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | @Autowired |
| | | private ITSystemBulletinUserService tSystemBulletinUserService; |
| | | |
| | |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | wrapper.ne("status",3); |
| | | return tSystemBulletinService.selectList(wrapper); |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object add(TSystemBulletin tSystemBulletin) { |
| | | tSystemBulletin.setContent(LabelReplaceUtil.replace(tSystemBulletin.getContent())); |
| | | tSystemBulletin.setState(1); |
| | | tSystemBulletin.setCreateTime(new Date()); |
| | | tSystemBulletin.setStatus(1); |
| | |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object addSend(TSystemBulletin tSystemBulletin) { |
| | | tSystemBulletin.setContent(LabelReplaceUtil.replace(tSystemBulletin.getContent())); |
| | | tSystemBulletin.setState(2); |
| | | tSystemBulletin.setCreateTime(new Date()); |
| | | tSystemBulletin.setStatus(1); |
| | |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object editSend(TSystemBulletin tSystemBulletin) { |
| | | tSystemBulletin.setContent(LabelReplaceUtil.replace(tSystemBulletin.getContent())); |
| | | tSystemBulletin.setState(2); |
| | | tSystemBulletinService.updateById(tSystemBulletin); |
| | | tSystemBulletinService.sendBulletin(tSystemBulletin); |
| | |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tSystemBulletinId) { |
| | | tSystemBulletinService.deleteById(tSystemBulletinId); |
| | | |
| | | TSystemBulletin tSystemBulletin = tSystemBulletinService.selectById(tSystemBulletinId); |
| | | tSystemBulletin.setStatus(StatusEnum.DELETE.getCode()); |
| | | tSystemBulletinService.updateById(tSystemBulletin); |
| | | |
| | | // 公告用户关联关系状态修改 |
| | | tSystemBulletinUserService.deleteBulletinUser(tSystemBulletinId); |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TSystemBulletin tSystemBulletin) { |
| | | tSystemBulletin.setContent(LabelReplaceUtil.replace(tSystemBulletin.getContent())); |
| | | tSystemBulletinService.updateById(tSystemBulletin); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.TAgent; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.StringUtils; |
| | |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | | return tYouTuiService.selectList(wrapper); |
| | | } |
| | | |
| | |
| | | if(1 == tYouTui.getStatus()){ |
| | | return new SuccessTip(500,"启用下的优推不可删除!"); |
| | | } |
| | | |
| | | tYouTuiService.deleteById(tYouTuiId); |
| | | tYouTui.setStatus(StatusEnum.DELETE.getCode()); |
| | | tYouTuiService.updateById(tYouTui); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.util; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class LabelReplaceUtil implements Serializable { |
| | | |
| | | /** |
| | | * 对内容进行替换 |
| | | * @param content |
| | | * @return |
| | | */ |
| | | public static String replace(String content){ |
| | | return content.replace("& lt;", "<").replace("& gt;",">"); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TBroadcast; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | @Mapper |
| | | public interface TBroadcastMapper extends BaseMapper<TBroadcast> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletinUser; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author stylefeng |
| | | * @since 2023-03-16 |
| | | */ |
| | | @Mapper |
| | | public interface TSystemBulletinUserMapper extends BaseMapper<TSystemBulletinUser> { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.enums; |
| | | |
| | | |
| | | |
| | | /** |
| | | * @Description 优惠券状态枚举 |
| | | * @Author xiaochen |
| | | * @Date 2023/02/15 9:42 |
| | | */ |
| | | public enum StatusEnum { |
| | | |
| | | NORMAL(1, "正常"), |
| | | FREEZE(2, "冻结"), |
| | | DELETE(3, "删除"); |
| | | |
| | | private String desc; |
| | | |
| | | |
| | | private int code; |
| | | |
| | | |
| | | StatusEnum(int code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static StatusEnum fromCode(Integer code) { |
| | | StatusEnum[] resultTypes = StatusEnum.values(); |
| | | for (StatusEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableLogic; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | @TableField("remaining_quantity") |
| | | private Integer remainingQuantity; |
| | | |
| | | @ApiModelProperty(value = "删除 true未删除 false已删除") |
| | | @TableField("status") |
| | | @TableLogic |
| | | private Boolean status; |
| | | |
| | | public Boolean getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Boolean status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Integer getRemainingQuantity() { |
| | | return remainingQuantity; |
| | | } |
| | |
| | | * 端口 1用户端 2司机端 |
| | | */ |
| | | private Integer editionPort; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer status; |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Integer getEditionPort() { |
| | | return editionPort; |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableLogic; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableLogic; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | |
| | | */ |
| | | public interface ITBroadcastService extends IService<TBroadcast> { |
| | | |
| | | /** |
| | | * 判断是否存在该排序 |
| | | * |
| | | * @return |
| | | */ |
| | | Boolean isExit(String id, Integer sort); |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface ITSystemBulletinUserService extends IService<TSystemBulletinUser> { |
| | | |
| | | |
| | | /** |
| | | * 修改公告用户关联状态 |
| | | * @param tSystemBulletinId |
| | | */ |
| | | void deleteBulletinUser(Integer tSystemBulletinId); |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.enums.OrderStateEnum; |
| | | import com.stylefeng.guns.modular.system.enums.PayStatusEnum; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITAgentService; |
| | |
| | | if(Objects.requireNonNull(ShiroKit.getUser()).getRoleType() == 3){ |
| | | wrapper.eq("id",ShiroKit.getUser().getObjectId()); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | | return wrapper; |
| | | } |
| | | |
| | |
| | | import com.stylefeng.guns.modular.system.dao.TUserToCouponMapper; |
| | | import com.stylefeng.guns.modular.system.enums.CouponStatusEnum; |
| | | import com.stylefeng.guns.modular.system.enums.OrderStateEnum; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.TAppUser; |
| | | import com.stylefeng.guns.modular.system.dao.TAppUserMapper; |
| | | import com.stylefeng.guns.modular.system.model.TCoupon; |
| | |
| | | if(Objects.nonNull(status)){ |
| | | wrapper.eq("status",status); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | | return wrapper; |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TBranchOfficeResp; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITBranchOfficeService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | |
| | | if(Objects.nonNull(status)){ |
| | | wrapper.eq("status",status); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | | // 判断代理商 分公司 |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.system.model.TBroadcast; |
| | | import com.stylefeng.guns.modular.system.dao.TBroadcastMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITBroadcastService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TBroadcastServiceImpl extends ServiceImpl<TBroadcastMapper, TBroadcast> implements ITBroadcastService { |
| | | |
| | | @Autowired |
| | | private TBroadcastMapper tBroadcastMapper; |
| | | |
| | | @Override |
| | | public Boolean isExit(String id, Integer sort) { |
| | | Integer count = tBroadcastMapper.selectCount(new EntityWrapper<TBroadcast>() |
| | | .eq("sort", sort)); |
| | | if (StringUtils.hasLength(id)) { |
| | | // 修改 |
| | | TBroadcast tBroadcast = tBroadcastMapper.selectById(id); |
| | | return Objects.nonNull(tBroadcast) && !tBroadcast.getSort().equals(sort) && count > 0; |
| | | } else { |
| | | // 新增 |
| | | return count > 0; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.controller.util.UUIDUtil; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.enums.OrderStateEnum; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | |
| | | // 通过省市查询代理商 |
| | | List<TAgent> tAgent = tAgentMapper.selectList(new EntityWrapper<TAgent>().eq("provinceCode", province.getCode()) |
| | | .eq("cityCode", city.getCode()) |
| | | .eq("status", 1) |
| | | .eq("status", StatusEnum.NORMAL.getCode()) |
| | | .last("LIMIT 1")); |
| | | if(!CollectionUtils.isEmpty(tAgent)){ |
| | | tDriver.setAgentId(tAgent.get(0).getId()); |
| | |
| | | // 通过省市区查询分公司 |
| | | List<TBranchOffice> tBranchOffice = tBranchOfficeMapper.selectList(new EntityWrapper<TBranchOffice>().eq("provinceCode", province.getCode()) |
| | | .eq("cityCode", city.getCode()) |
| | | .eq("status", 1) |
| | | .eq("status", StatusEnum.NORMAL.getCode()) |
| | | .eq("districtCode", area.getCode()) |
| | | .last("LIMIT 1")); |
| | | if(!CollectionUtils.isEmpty(tBranchOffice)){ |
| | |
| | | // 判断发送状态 |
| | | if(2 == tSystemBulletin.getState()){ |
| | | // 查找所有司机 |
| | | List<TDriver> list = tDriverMapper.selectList(new EntityWrapper<TDriver>()); |
| | | List<TDriver> list = tDriverMapper.selectList(new EntityWrapper<TDriver>().eq("id",1)); |
| | | List<TSystemBulletinUser> tSystemBulletinUsers = new ArrayList<>(list.size()); |
| | | for (TDriver tDriver : list) { |
| | | TSystemBulletinUser tSystemBulletinUser = new TSystemBulletinUser(); |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletinUser; |
| | | import com.stylefeng.guns.modular.system.dao.TSystemBulletinUserMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemBulletinUserService; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.TSystemBulletinUserMapper; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletinUser; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemBulletinUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TSystemBulletinUserServiceImpl extends ServiceImpl<TSystemBulletinUserMapper, TSystemBulletinUser> implements ITSystemBulletinUserService { |
| | | |
| | | @Autowired |
| | | private TSystemBulletinUserMapper tSystemBulletinUserMapper; |
| | | |
| | | @Override |
| | | public void deleteBulletinUser(Integer bulletinId) { |
| | | List<TSystemBulletinUser> tSystemBulletinUsers = tSystemBulletinUserMapper.selectList(new EntityWrapper<TSystemBulletinUser>().eq("systemBulletinId", bulletinId)); |
| | | tSystemBulletinUsers.forEach(bulletin->bulletin.setStatus(StatusEnum.DELETE.getCode())); |
| | | this.updateBatchById(tSystemBulletinUsers); |
| | | } |
| | | } |
| | |
| | | <option value="">状态</option> |
| | | <option value="1">正常</option> |
| | | <option value="2">冻结</option> |
| | | <option value="3">已删除</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | |
| | | <option value="">状态</option> |
| | | <option value="1">正常</option> |
| | | <option value="2">冻结</option> |
| | | <option value="3">已删除</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | |
| | | <option value="">选择状态</option> |
| | | <option value="1">正常</option> |
| | | <option value="2">冻结</option> |
| | | <option value="3">已删除</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="condition" name="名称" /> |
| | | <div class="col-sm-2"> |
| | | <#TimeCon id="createTime" name="添加时间" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="content" name="消息内容" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TBroadcast.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TBroadcast.resetSearch()"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TBroadcastTableToolbar" role="group"> |
| | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tBroadcast/tBroadcast.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="createTime" name="添加时间" /> |
| | | <#TimeCon id="createTime" name="添加时间" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="content" name="消息内容" /> |
| | |
| | | <div class="ibox-content" id="systemBulletinInfoForm"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input hidden id="areaId" value="areaId"> |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | |
| | | <div class="ibox-content" id="systemBulletinInfoForm"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <textarea type="text/plain" id="content" name="content" value="${item.content}" style="width:100%;height:350px;"></textarea> |
| | | <input hidden id="contentHtml" value="${item.content}"> |
| | | <textarea type="text/plain" id="content" name="content" style="width:100%;height:350px;">${item.content}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="TSystemBulletinInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="发送" id="send" icon="fa-check" clickFun="TSystemBulletinInfoDlg.send()"/> |
| | | <#button btnCss="danger" name="发送" id="send" icon="fa-check" clickFun="TSystemBulletinInfoDlg.editSend()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | TBroadcast.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '消息内容', field: 'content', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态(1=正常,2=冻结,3=删除)', field: 'status', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'} |
| | | {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '消息内容', field: 'content', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '是否显示', field: 'isShow', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.isShow){ |
| | | return '<span>是</span>' |
| | | }else { |
| | | return '<span>否</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态(1=正常,2=冻结,3=删除)', field: 'status', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if (row.isShow){ |
| | | return '<a href="#" onclick="TBroadcast.updateStatus('+row.id+')" style="color:red">下架</a>' |
| | | }else{ |
| | | return '<a href="#" onclick="TBroadcast.updateStatus('+row.id+')" style="color:blue">上架</a>' +' ' + |
| | | '<a href="#" onclick="TBroadcast.delete('+row.id+')" style="color:red">删除</a>' |
| | | } |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TBroadcast.delete = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tBroadcast/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TBroadcast.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tBroadcastId",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | TBroadcast.delete = function (id) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tBroadcast/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TBroadcast.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tBroadcastId",id); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | /** |
| | |
| | | */ |
| | | TBroadcast.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | queryData['createTime'] = $("#createTime").val(); |
| | | queryData['content'] = $("#content").val(); |
| | | TBroadcast.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | /** |
| | | * 重置 |
| | | */ |
| | | TBroadcast.resetSearch = function (){ |
| | | $("#createTime").val(''); |
| | | $("#content").val(''); |
| | | TBroadcast.search(); |
| | | } |
| | | |
| | | $(function () { |
| | | var defaultColunms = TBroadcast.initColumn(); |
| | | var table = new BSTable(TBroadcast.id, "/tBroadcast/list", defaultColunms); |
| | |
| | | * 收集数据 |
| | | */ |
| | | TSystemBulletinInfoDlg.collectData = function() { |
| | | if(UE.getEditor('content').hasContents()){ |
| | | $('#content').val(UE.getEditor('content').getContent()); |
| | | } |
| | | this |
| | | .set('id') |
| | | .set('introduce') |
| | |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | * 提交修改发送 |
| | | */ |
| | | TSystemBulletinInfoDlg.editSend = function() { |
| | | |
| | |
| | | } |
| | | |
| | | $(function() { |
| | | UE.getEditor('content'); |
| | | TSystemBulletinInfoDlg.editor = UE.getEditor('content'); |
| | | Feng.initValidator("systemBulletinInfoForm", TSystemBulletinInfoDlg.validateFields); |
| | | }); |