| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.modular.system.model.TAppUser; |
| | | import com.stylefeng.guns.modular.system.model.TSystemConfig; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemConfigService; |
| | | 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.TBranchOffice; |
| | | import com.stylefeng.guns.modular.system.service.ITBranchOfficeService; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | |
| | | @Autowired |
| | | private ITBranchOfficeService tBranchOfficeService; |
| | | @Autowired |
| | | private ITSystemConfigService tSystemConfigService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转到详情 |
| | | */ |
| | | @RequestMapping("/tBranchOfficeDetail") |
| | | public String tBranchOfficeDetail(Integer tBranchOfficeId, Model model) { |
| | | tBranchOfficeService.tBranchOfficeDetail(tBranchOfficeId,model); |
| | | TSystemConfig tSystemConfig = tSystemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 3)); |
| | | JSONObject jsonObject = JSONObject.parseObject(tSystemConfig.getContent()); |
| | | model.addAttribute("num2",jsonObject.getInteger("num2")); |
| | | model.addAttribute("num3",jsonObject.getInteger("num3")); |
| | | return PREFIX + "tBranchOfficeDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | public Object list(String branchOfficeName,String principal,String principalPhone,Integer operatingBusiness ,Integer status) { |
| | | EntityWrapper<TBranchOffice> wrapper = new EntityWrapper<>(); |
| | | // 分公司名称 |
| | | if(StringUtils.hasLength(branchOfficeName)){ |
| | | wrapper.like("branchOfficeName",branchOfficeName); |
| | | } |
| | | // 负责人 |
| | | if(StringUtils.hasLength(principal)){ |
| | | wrapper.like("principal",principal); |
| | | } |
| | | // 负责人电话 |
| | | if(StringUtils.hasLength(principalPhone)){ |
| | | wrapper.like("principalPhone",principalPhone); |
| | | } |
| | | // 经营业务 |
| | | if(Objects.nonNull(operatingBusiness)){ |
| | | wrapper.eq("operatingBusiness",operatingBusiness); |
| | | } |
| | | // 状态 |
| | | if(Objects.nonNull(status)){ |
| | | wrapper.eq("status",status); |
| | | } |
| | | // 判断代理商 分公司 |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | | if(2 == roleType){ |
| | | // 分公司 |
| | | wrapper.eq("id",objectId); |
| | | } |
| | | if(3 == roleType){ |
| | | // 代理商 |
| | | wrapper.eq("agentId",objectId); |
| | | } |
| | | return tBranchOfficeService.selectList(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * 启用分公司 |
| | | */ |
| | | @RequestMapping(value = "/start") |
| | | @ResponseBody |
| | | public Object start(Integer id) { |
| | | TBranchOffice tBranchOffice = tBranchOfficeService.selectById(id); |
| | | tBranchOffice.setStatus(1); |
| | | tBranchOfficeService.updateById(tBranchOffice); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 冻结分公司 |
| | | */ |
| | | @RequestMapping(value = "/stop") |
| | | @ResponseBody |
| | | public Object updateStatus(Integer id) { |
| | | TBranchOffice tBranchOffice = tBranchOfficeService.selectById(id); |
| | | tBranchOffice.setStatus(2); |
| | | tBranchOfficeService.updateById(tBranchOffice); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list-back") |
| | | @ResponseBody |
| | | public Object listBack(String condition) { |
| | | return tBranchOfficeService.selectList(null); |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value = "司机手机号") |
| | | private String driverPhone; |
| | | |
| | | @ApiModelProperty(value = "分公司id") |
| | | private Integer branchOfficeId; |
| | | |
| | | @ApiModelProperty(value = "代理商id") |
| | | private Integer agentId; |
| | | |
| | | public Integer getBranchOfficeId() { |
| | | return branchOfficeId; |
| | | } |
| | | |
| | | public void setBranchOfficeId(Integer branchOfficeId) { |
| | | this.branchOfficeId = branchOfficeId; |
| | | } |
| | | |
| | | public Integer getAgentId() { |
| | | return agentId; |
| | | } |
| | | |
| | | public void setAgentId(Integer agentId) { |
| | | this.agentId = agentId; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | |
| | | // 校验密码 |
| | | ShiroUser shiroUser1 = shiroFactory.shiroUser(user); |
| | | SimpleAuthenticationInfo info = shiroFactory.info(shiroUser1, user, username); |
| | | System.out.println(info.getCredentials()); |
| | | String pass = ShiroKit.md5(password, user.getSalt()); |
| | | System.out.println(pass); |
| | | if(!info.getCredentials().equals(pass)){ |
| | | f++; |
| | | loginFailures.put(username, f); |
| | |
| | | */ |
| | | List<TOrderResp> getCancelOrderList(@Param("startTime") String startTime, @Param("endTime")String endTime, @Param("code") String code, |
| | | @Param("source") Integer source, @Param("userName")String userName, @Param("userPhone")String userPhone, |
| | | @Param("state")Integer state, @Param("driverName")String driverName); |
| | | @Param("state")Integer state, @Param("driverName")String driverName,@Param("roleType")Integer roleType, |
| | | @Param("objectId")Integer objectId); |
| | | |
| | | /** |
| | | * 订单异常详情页面的取消记录列表 |
| | |
| | | */ |
| | | List<TOrderResp> getOrderList(@Param("startTime") String startTime,@Param("endTime")String endTime, @Param("code") String code, |
| | | @Param("source") Integer source,@Param("userName")String userName, @Param("userPhone")String userPhone, |
| | | @Param("state")Integer state,@Param("driverName")String driverName,@Param("isException") Integer isException); |
| | | @Param("state")Integer state,@Param("driverName")String driverName,@Param("isException") Integer isException, |
| | | @Param("roleType")Integer roleType,@Param("objectId")Integer objectId); |
| | | } |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TSystemConfig; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author stylefeng |
| | | * @since 2023-03-02 |
| | | */ |
| | | @Mapper |
| | | public interface TSystemConfigMapper extends BaseMapper<TSystemConfig> { |
| | | |
| | | } |
| | |
| | | <if test="driverName != null and driverName != ''"> |
| | | AND d.name LIKE concat('%',#{driverName},'%') |
| | | </if> |
| | | <if test="roleType != null and roleType == 2"> |
| | | AND o.branchOfficeId = #{objectId} |
| | | </if> |
| | | <if test="roleType != null and roleType == 3"> |
| | | AND o.agentId = #{objectId} |
| | | </if> |
| | | AND co.userType = 1 |
| | | </where> |
| | | ORDER BY co.createTime |
| | |
| | | </sql> |
| | | <select id="selectPageList" resultType="com.stylefeng.guns.modular.system.controller.resp.TEvaluateResp"> |
| | | select e.id, e.orderId, e.userId, e.score, e.evaluate, e.status, e.createTime, |
| | | a.nickname AS userName,a.phone AS userPhone,o.code,d.name AS driverName,d.phone AS driverPhone |
| | | a.nickname AS userName,a.phone AS userPhone,o.code,o.agentId,o.branchOfficeId,d.name AS driverName,d.phone AS driverPhone |
| | | from t_evaluate e |
| | | left join t_app_user a on e.userId = a.id |
| | | left join t_order o on e.orderId = o.id |
| | |
| | | <if test="isException != null"> |
| | | AND a.is_exception = #{isException} |
| | | </if> |
| | | <if test="roleType != null and roleType == 2"> |
| | | AND o.branchOfficeId = #{objectId} |
| | | </if> |
| | | <if test="roleType != null and roleType == 3"> |
| | | AND o.agentId = #{objectId} |
| | | </if> |
| | | </where> |
| | | ORDER BY o.createTime |
| | | </select> |
| | |
| | | * 添加时间 |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * 分公司名称 |
| | | */ |
| | | private String branchOfficeName; |
| | | /** |
| | | * 经营业务 1司机代驾 |
| | | */ |
| | | private Integer operatingBusiness; |
| | | |
| | | public String getBranchOfficeName() { |
| | | return branchOfficeName; |
| | | } |
| | | |
| | | public void setBranchOfficeName(String branchOfficeName) { |
| | | this.branchOfficeName = branchOfficeName; |
| | | } |
| | | |
| | | public Integer getOperatingBusiness() { |
| | | return operatingBusiness; |
| | | } |
| | | |
| | | public void setOperatingBusiness(Integer operatingBusiness) { |
| | | this.operatingBusiness = operatingBusiness; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TBranchOffice; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import org.springframework.ui.Model; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ITBranchOfficeService extends IService<TBranchOffice> { |
| | | |
| | | /** |
| | | * 跳转到详情 |
| | | * @param tBranchOfficeId |
| | | * @param model |
| | | */ |
| | | void tBranchOfficeDetail(Integer tBranchOfficeId, Model model); |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TAgentResp; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | // 判断是否为代理商 |
| | | if(Objects.requireNonNull(ShiroKit.getUser()).getRoleType() == 3){ |
| | | wrapper.eq("id",ShiroKit.getUser().getObjectId()); |
| | | } |
| | | return wrapper; |
| | | } |
| | | |
| | |
| | | } |
| | | // 优惠券信息 |
| | | // 过滤代理商发放的优惠券 |
| | | List<TCoupon> tCoupons = tCouponMapper.selectList(new EntityWrapper<TCoupon>().eq("agentId", tAgent.getId())); |
| | | List<TCoupon> tCoupons = tCouponMapper.selectList(new EntityWrapper<TCoupon>()); |
| | | model.addAttribute("issuedCoupon",tCoupons.size()); |
| | | // 司机信息 |
| | | // 司机数 |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.stylefeng.guns.modular.system.dao.TCouponMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TOrderMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TSystemConfigMapper; |
| | | import com.stylefeng.guns.modular.system.model.TBranchOffice; |
| | | import com.stylefeng.guns.modular.system.dao.TBranchOfficeMapper; |
| | | import com.stylefeng.guns.modular.system.model.TSystemConfig; |
| | | import com.stylefeng.guns.modular.system.service.ITBranchOfficeService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.ui.Model; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TBranchOfficeServiceImpl extends ServiceImpl<TBranchOfficeMapper, TBranchOffice> implements ITBranchOfficeService { |
| | | |
| | | @Autowired |
| | | private TBranchOfficeMapper tBranchOfficeMapper; |
| | | |
| | | @Autowired |
| | | private TCouponMapper tCouponMapper; |
| | | |
| | | @Autowired |
| | | private TOrderMapper tOrderMapper; |
| | | |
| | | @Override |
| | | public void tBranchOfficeDetail(Integer tBranchOfficeId, Model model) { |
| | | // 分公司信息 |
| | | TBranchOffice tBranchOffice = tBranchOfficeMapper.selectById(tBranchOfficeId); |
| | | model.addAttribute("principal",tBranchOffice.getPrincipal()); |
| | | model.addAttribute("createTime",tBranchOffice.getCreateTime()); |
| | | model.addAttribute("email",tBranchOffice.getEmail()); |
| | | model.addAttribute("area",tBranchOffice.getProvinceName()+tBranchOffice.getCityName()+tBranchOffice.getDistrictName()); |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TOrderResp; |
| | | import com.stylefeng.guns.modular.system.model.TCancelOrder; |
| | | import com.stylefeng.guns.modular.system.dao.TCancelOrderMapper; |
| | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | } |
| | | return tCancelOrderMapper.getCancelOrderList(startTime,endTime,code,source,userName,userPhone,state,driverName); |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | | return tCancelOrderMapper.getCancelOrderList(startTime,endTime,code,source,userName,userPhone,state,driverName,roleType,objectId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverCommissionResp; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverResp; |
| | |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | wrapper.orderBy(true,"approvalStatus"); |
| | | // 判断是否为代理商或者分公司 |
| | | if(Objects.requireNonNull(ShiroKit.getUser()).getRoleType() == 2){ |
| | | // 分公司 |
| | | wrapper.eq("branchOfficeId",ShiroKit.getUser().getObjectId()); |
| | | } |
| | | if(Objects.requireNonNull(ShiroKit.getUser()).getRoleType() == 3){ |
| | | // 代理商 |
| | | wrapper.eq("agentId",ShiroKit.getUser().getObjectId()); |
| | | } |
| | | return wrapper; |
| | | } |
| | | |
| | |
| | | wrapper.like("name",name); |
| | | } |
| | | wrapper.orderBy(true,"approvalStatus"); |
| | | // 判断是否为代理商或者分公司 |
| | | if(Objects.requireNonNull(ShiroKit.getUser()).getRoleType() == 2){ |
| | | // 分公司 |
| | | wrapper.eq("branchOfficeId",ShiroKit.getUser().getObjectId()); |
| | | } |
| | | if(Objects.requireNonNull(ShiroKit.getUser()).getRoleType() == 3){ |
| | | // 代理商 |
| | | wrapper.eq("agentId",ShiroKit.getUser().getObjectId()); |
| | | } |
| | | return wrapper; |
| | | } |
| | | |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TEvaluateResp; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | } |
| | | return tEvaluateMapper.selectPageList(startTime,endTime,userName,driverName,orderType,score); |
| | | List<TEvaluateResp> list = tEvaluateMapper.selectPageList(startTime, endTime, userName, driverName, orderType, score); |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | | if(3 == roleType){ |
| | | list = list.stream().filter(tEvaluate -> tEvaluate.getAgentId().equals(objectId)).collect(Collectors.toList()); |
| | | } |
| | | if(2 == roleType){ |
| | | list = list.stream().filter(tEvaluate -> tEvaluate.getBranchOfficeId().equals(objectId)).collect(Collectors.toList()); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TOrderResp; |
| | | import com.stylefeng.guns.modular.system.dao.TAppUserMapper; |
| | |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | } |
| | | return tOrderMapper.getOrderList(startTime,endTime,code,source,userName,userPhone,state,driverName,isException); |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | | return tOrderMapper.getOrderList(startTime,endTime,code,source,userName,userPhone,state,driverName,isException,roleType,objectId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | <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"> |
| | | <#NameCon id="branchOfficeName" name="分公司名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="principal" name="负责人名称" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="principalPhone" name="负责人电话" /> |
| | | </div> |
| | | <!--<div class="col-sm-2"> |
| | | <#NameCon id="condition" name="管理人名称" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="condition" name="管理人电话" /> |
| | | </div>--> |
| | | <div class="col-sm-2"> |
| | | <select class="input-group" id="operatingBusiness" style="width: 180px;height: 33px" name="operatingBusiness"> |
| | | <option value="">选择经营业务</option> |
| | | <option value="1">司机代驾</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <select class="input-group" id="status" style="width: 180px;height: 33px" name="status"> |
| | | <option value="">选择状态</option> |
| | | <option value="1">正常</option> |
| | | <option value="2">冻结</option> |
| | | <option value="3">已删除</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TBranchOffice.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TBranchOffice.resetSearch()" space="true"/> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | @if(shiro.hasPermission("/tBranchOffice/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TBranchOffice.openAddTBranchOffice()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tBranchOffice/update")){ |
| | | <#button name="编辑" icon="fa-edit" clickFun="TBranchOffice.openTBranchOfficeDetail()" space="true"/> |
| | | @} |
| | | <#button name="冻结" icon="fa-edit" clickFun="TBranchOffice.stop()" space="true"/> |
| | | <#button name="启动" icon="fa-edit" clickFun="TBranchOffice.start()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TBranchOfficeTableToolbar" role="group"> |
| | | <!--<div class="hidden-xs" id="TBranchOfficeTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tBranchOffice/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TBranchOffice.openAddTBranchOffice()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tBranchOffice/update")){ |
| | | <#button name="修改" icon="fa-edit" clickFun="TBranchOffice.openTBranchOfficeDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tBranchOffice/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TBranchOffice.delete()" space="true"/> |
| | | @} |
| | | </div> |
| | | </div>--> |
| | | <#table id="TBranchOfficeTable"/> |
| | | </div> |
| | | </div> |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C">分公司资料</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >负责人姓名:</label> |
| | | <label>${principal}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">添加时间:</label> |
| | | <label>${createTime}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >邮箱:</label> |
| | | <label>${principal}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">抽成规则:</label> |
| | | <label>抽成,每笔订单满</label> |
| | | <label>${num2}</label> |
| | | <label>元/单,抽取</label> |
| | | <label>${num3}</label> |
| | | <label>元</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">代理区域:</label> |
| | | <label>${principal}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C">基本信息</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >统计时间:</label> |
| | | <span>${principal}</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >累计订单量:</label> |
| | | <label>${principal}</label>单 |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">累计优惠券金额:</label> |
| | | <label>${principal}</label>元 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >有效订单:</label> |
| | | <label>${principal}</label>单 |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">累计优惠券金额:</label> |
| | | <label>${principal}</label>元 |
| | | </div> |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >已发放优惠券:</label> |
| | | <label>${principal}</label>张 |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">司机数量:</label> |
| | | <label>${principal}</label>人 |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tAgent/tAgent.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | TBranchOffice.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '代理商id', field: 'agentId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '负责人姓名', field: 'principal', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '负责人电话', field: 'principalPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '邮箱', field: 'email', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域省编号', field: 'provinceCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域省名称', field: 'provinceName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域市编号', field: 'cityCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域市名称', field: 'cityName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域区编号', field: 'districtCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域区名称', field: 'districtName', 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: '代理商id', field: 'agentId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '分公司名称', field: 'branchOfficeName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '负责人姓名', field: 'principal', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '负责人电话', field: 'principalPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '邮箱', field: 'email', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域省编号', field: 'provinceCode', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域省名称', field: 'provinceName', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域市编号', field: 'cityCode', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域市名称', field: 'cityName', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域区编号', field: 'districtCode', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '代理区域区名称', field: 'districtName', visible: false, align: 'center', valign: 'middle'}, |
| | | |
| | | {title: '订单数量', field: 'principalPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '有效订单', field: 'principalPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '已发放优惠券', field: 'principalPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '已使用优惠券', field: 'principalPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '累计优惠券金额', field: 'principalPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | |
| | | {title: '经营业务', field: 'operatingBusiness', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.operatingBusiness === 1){ |
| | | return '<span>司机代驾</span>' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | {title: '司机数', field: 'driverCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status === 1){ |
| | | return '<span>正常</span>' |
| | | }else if(row.status === 2){ |
| | | return '<span>冻结</span>' |
| | | }else if (row.status === 3){ |
| | | return '<span>已删除</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | return '<a href="#" onclick="TBranchOffice.searchTBranchOfficeDetail('+row.id+')" style="color:blue">详情</a>' +' ' + |
| | | '<a href="#" onclick="TBranchOffice.delete('+row.id+')" style="color:red">删除</a>' |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | /** |
| | | * 打开查看详情(使用中) |
| | | */ |
| | | TBranchOffice.searchTBranchOfficeDetail = function (id) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tBranchOffice/tBranchOfficeDetail?tBranchOfficeId=' + id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TBranchOffice.delete = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tBranchOffice/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TBranchOffice.table.refresh(); |
| | | TBranchOffice.delete = function (id) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tBranchOffice/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TBranchOffice.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tBranchOfficeId",id); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | /** |
| | | * 提交冻结 |
| | | */ |
| | | TBranchOffice.stop = function () { |
| | | if(this.check()){ |
| | | if(2 == this.seItem.status){ |
| | | Feng.error("该条数据已冻结!"); |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tBranchOffice/stop?id="+this.seItem.id, function (data) { |
| | | if(500 == data.code){ |
| | | Feng.error(data.message); |
| | | return; |
| | | }else { |
| | | Feng.success("冻结成功!"); |
| | | TBranchOffice.table.refresh(); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | Feng.error("冻结失败!" + data.message + "!"); |
| | | }); |
| | | ajax.set("tBranchOfficeId",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 提交启用 |
| | | */ |
| | | TBranchOffice.start = function () { |
| | | if(this.check()){ |
| | | if(1 == this.seItem.status){ |
| | | Feng.error("该条数据已启用!"); |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tBranchOffice/start?id="+this.seItem.id, function (data) { |
| | | if(500 == data.code){ |
| | | Feng.error(data.message); |
| | | return; |
| | | }else { |
| | | Feng.success("启用成功!"); |
| | | TBranchOffice.table.refresh(); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("启用失败!" + data.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | |
| | | */ |
| | | TBranchOffice.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | queryData['branchOfficeName'] = $("#branchOfficeName").val(); |
| | | queryData['principal'] = $("#principal").val(); |
| | | queryData['principalPhone'] = $("#principalPhone").val(); |
| | | queryData['operatingBusiness'] = $("#operatingBusiness").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | TBranchOffice.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | /** |
| | | * 重置 |
| | | */ |
| | | TBranchOffice.resetSearch = function (){ |
| | | $("#branchOfficeName").val(''); |
| | | $("#principal").val(''); |
| | | $("#principalPhone").val(''); |
| | | $("#operatingBusiness").val(''); |
| | | $("#status").val(''); |
| | | TBranchOffice.search(); |
| | | } |
| | | |
| | | $(function () { |
| | | var defaultColunms = TBranchOffice.initColumn(); |
| | | var table = new BSTable(TBranchOffice.id, "/tBranchOffice/list", defaultColunms); |
| | |
| | | .set('cityName') |
| | | .set('districtCode') |
| | | .set('districtName') |
| | | .set('branchOfficeName') |
| | | .set('operatingBusiness') |
| | | .set('status') |
| | | .set('createTime'); |
| | | } |