diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/CompanyController.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/CompanyController.java index d9819f6..99d940f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/CompanyController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/CompanyController.java @@ -69,6 +69,10 @@ public class CompanyController extends BaseController public TableDataInfo list(Company company) { startPage(); + // 运营者账号,只能查询所属商户数据 + if(UserConstants.USER_TYPE_02 .equals(getSysUser().getUserType())){ + company.setId(getSysUser().getGroupId()); + } List list = companyService.selectCompanyList(company); return getDataTable(list); } @@ -135,6 +139,7 @@ public class CompanyController extends BaseController user.setUpdateTime(DateUtils.getNowDate()); user.setStatus("0"); user.setCreateById(getUserId()); + user.setGroupId(company.getId()); userService.insertUser(user); } return toAjax(flag); @@ -198,6 +203,6 @@ public class CompanyController extends BaseController userService.changeStatus(user); } } - return toAjax(companyService.changeStatus(company)); + return toAjax(flag); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/CompanyStoreController.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/CompanyStoreController.java new file mode 100644 index 0000000..d6b2ab6 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/CompanyStoreController.java @@ -0,0 +1,168 @@ +package com.ruoyi.operation.controller; + +import java.util.List; + +import com.ruoyi.common.constant.CompanyConstants; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.operation.domain.Company; +import com.ruoyi.operation.service.ICompanyService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.operation.domain.CompanyStore; +import com.ruoyi.operation.service.ICompanyStoreService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 门店Controller + * + * @author ruoyi + * @date 2025-07-03 + */ +@Controller +@RequestMapping("/operation/store") +public class CompanyStoreController extends BaseController +{ + private String prefix = "operation/store"; + + @Autowired + private ICompanyStoreService companyStoreService; + @Autowired + private ICompanyService companyService; + + @RequiresPermissions("operation:store:view") + @GetMapping() + public String store(ModelMap mmap) + { + List companyList = getCompanyList(new Company()); // 获取运营商列表 + mmap.put("companyList", companyList); // 将运营商列表传递到前端 + return prefix + "/store"; + } + + /** + * 查询门店列表 + */ + @RequiresPermissions("operation:store:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(CompanyStore companyStore) + { + startPage(); + // 运营者账号,只能查询所属商户数据 + if(UserConstants.USER_TYPE_02 .equals(getSysUser().getUserType())){ + companyStore.setOperatingCompanyId(getSysUser().getGroupId()); + } + List list = companyStoreService.selectCompanyStoreList(companyStore); + return getDataTable(list); + } + + /** + * 导出门店列表 + */ + @RequiresPermissions("operation:store:export") + @Log(title = "门店", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(CompanyStore companyStore) + { + List list = companyStoreService.selectCompanyStoreList(companyStore); + ExcelUtil util = new ExcelUtil(CompanyStore.class); + return util.exportExcel(list, "门店数据"); + } + + /** + * 新增门店 + */ + @GetMapping("/add") + public String add(ModelMap mmap) + { + List companyList = getCompanyList(new Company()); // 获取运营商列表 + mmap.put("companyList", companyList); // 将运营商列表传递到前端 + return prefix + "/add"; + } + + /** + * 新增保存门店 + */ + @RequiresPermissions("operation:store:add") + @Log(title = "门店", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(CompanyStore companyStore) + { + companyStore.setCreateBy(getLoginName()); + return toAjax(companyStoreService.insertCompanyStore(companyStore)); + } + + /** + * 修改门店 + */ + @RequiresPermissions("operation:store:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + List companyList = getCompanyList(new Company()); // 获取运营商列表 + mmap.put("companyList", companyList); // 将运营商列表传递到前端 + + CompanyStore companyStore = companyStoreService.selectCompanyStoreById(id); + mmap.put("companyStore", companyStore); + + return prefix + "/edit"; + } + + /** + * 修改保存门店 + */ + @RequiresPermissions("operation:store:edit") + @Log(title = "门店", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(CompanyStore companyStore) + { + companyStore.setUpdateBy(getLoginName()); + return toAjax(companyStoreService.updateCompanyStore(companyStore)); + } + + /** + * 删除门店 + */ + @RequiresPermissions("operation:store:remove") + @Log(title = "门店", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(companyStoreService.deleteCompanyStoreByIds(ids)); + } + + + @Log(title = "门店管理", businessType = BusinessType.UPDATE) + @RequiresPermissions("operation:store:edit") + @PostMapping("/changeStatus") + @ResponseBody + public AjaxResult changeStatus(CompanyStore companyStore) + { + return toAjax(companyStoreService.changeStatus(companyStore)); + } + + private List getCompanyList(Company company) { + company.setStatus(CompanyConstants.company_status_0); + // 运营者账号,只能查询所属商户数据 + if(UserConstants.USER_TYPE_02 .equals(getSysUser().getUserType())){ + company.setId(getSysUser().getGroupId()); + } + return companyService.selectCompanyList(company); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/Company.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/Company.java index b2a579f..d98227a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/Company.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/Company.java @@ -16,11 +16,11 @@ public class Company extends BaseEntity { private static final long serialVersionUID = 1L; - /** 公司ID */ + /** 运营商ID */ private Long id; - /** 公司名称 */ - @Excel(name = "公司名称") + /** 运营商名称 */ + @Excel(name = "运营商名称") private String companyName; /** 联系人姓名 */ @@ -31,8 +31,8 @@ public class Company extends BaseEntity @Excel(name = "联系电话") private String phone; - /** 公司地址 */ - @Excel(name = "公司地址") + /** 运营商地址 */ + @Excel(name = "运营商地址") private String address; /** 账户余额 */ @@ -43,8 +43,8 @@ public class Company extends BaseEntity @Excel(name = "押金/保证金金额") private BigDecimal deposit; - /** 公司类型(用数字表示的分类) */ - @Excel(name = "公司类型", readConverterExp = "用=数字表示的分类") + /** 运营商类型(用数字表示的分类) */ + @Excel(name = "运营商类型", readConverterExp = "用=数字表示的分类") private Long type; /** 是否已删除 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/CompanyStore.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/CompanyStore.java new file mode 100644 index 0000000..1274f9a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/domain/CompanyStore.java @@ -0,0 +1,685 @@ +package com.ruoyi.operation.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.springframework.data.annotation.Transient; + +/** + * 门店对象 company_store + * + * @author ruoyi + * @date 2025-07-03 + */ +public class CompanyStore extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private Long id; + + /** 门店名称 */ + @Excel(name = "门店名称") + private String name; + + /** 联系人 */ + @Excel(name = "联系人") + private String contactPerson; + + /** 手机号码 */ + @Excel(name = "手机号码") + private String phone; + + /** 联系人 */ + @Excel(name = "联系人2") + private String contactPerson2; + + /** 手机号码 */ + @Excel(name = "手机号码2") + private String phone2; + + /** 省份 */ + private String provinceId; + + /** 省份 */ + @Excel(name = "省份") + private String provinceName; + + /** 城市 */ + private String cityId; + + /** 城市 */ + @Excel(name = "城市") + private String cityName; + + /** 区县 */ + private Long areaId; + + /** 城市 */ + @Excel(name = "城市") + private String areaName; + + /** 省市区 */ + @Excel(name = "省市区") + private String address; + + /** 详细地址 */ + @Excel(name = "详细地址") + private String detailedAddress; + + /** 门店logo */ + @Excel(name = "门店logo") + private String image; + + /** 纬度 */ + @Excel(name = "纬度") + private String latitude; + + /** 经度 */ + @Excel(name = "经度") + private String longitude; + + /** 合同签订日期 */ + @Excel(name = "合同签订日期") + private String contractDate; + + /** 每日营业开关时间 */ + @Excel(name = "每日营业开关时间") + private String dayTime; + + /** 每日营业开始时间 */ + @Excel(name = "每日营业开始时间") + private String startTime; + + /** 每日营业结束时间 */ + @Excel(name = "每日营业结束时间") + private String endTime; + + /** 是否显示 */ + @Excel(name = "是否显示") + private Integer isShow; + + /** 是否删除 */ + @Excel(name = "是否删除") + private Integer isDel; + + /** 租车订单分成比例 */ + @Excel(name = "租车订单分成比例") + private BigDecimal zucheRatio; + + /** 租电订单分成比例 */ + @Excel(name = "租电订单分成比例") + private BigDecimal zudianRatio; + + /** 以租代售分成比例 */ + @Excel(name = "以租代售分成比例") + private BigDecimal daishouRatio; + + /** 标签 1.可租车 2.可换电 3.二手车,多个用,号隔开,例如1,2,3 */ + @Excel(name = "标签 1.可租车 2.可换电 3.二手车,多个用,号隔开,例如1,2,3") + private String label; + + /** 运营公司id */ + @Excel(name = "运营公司id") + private Long operatingCompanyId; + + /** 运营性质 1.直营 0.合作 */ + @Excel(name = "运营性质 1.直营 0.合作") + private Integer operatingNature; + + /** 简介 */ + @Excel(name = "简介") + private String introduction; + + /** 对公账号 */ + @Excel(name = "对公账号") + private String bankAccount; + + /** 门店编号 */ + @Excel(name = "门店编号") + private String storeNumber; + + /** 营业执照 */ + @Excel(name = "营业执照") + private String businessLicenseImg; + + /** 审核状态 0.未审核 1.审核通过 2.审核未通过 */ + @Excel(name = "审核状态 0.未审核 1.审核通过 2.审核未通过") + private Integer auditStatus; + + /** 审核时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date auditTime; + + /** 审核人id */ + @Excel(name = "审核人id") + private Long auditorId; + + /** 所属用户id */ + @Excel(name = "所属用户id") + private Long userId; + + /** 是否允许回收退租天数 0.不允许 1.允许 */ + @Excel(name = "是否允许回收退租天数 0.不允许 1.允许") + private Integer isReturnAllowed; + + /** 企业套餐保证金 */ + @Excel(name = "企业套餐保证金") + private BigDecimal mealDepositPrice; + + /** 企业充值订单数限制 */ + @Excel(name = "企业充值订单数限制") + private Long orderNumLimit; + + /** */ + private String delFlag; + + /** */ + private String status; + + /** 门店是否允许修改 */ + private String extend1; + + /** */ + private String extend2; + + /** */ + private String extend3; + + /** */ + private String extend4; + + /** */ + private String extend5; + + @Transient + private String operatingCompanyName; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setContactPerson(String contactPerson) + { + this.contactPerson = contactPerson; + } + + public String getContactPerson() + { + return contactPerson; + } + public void setPhone(String phone) + { + this.phone = phone; + } + + public String getPhone() + { + return phone; + } + + public String getContactPerson2() { + return contactPerson2; + } + + public void setContactPerson2(String contactPerson2) { + this.contactPerson2 = contactPerson2; + } + + public String getPhone2() { + return phone2; + } + + public void setPhone2(String phone2) { + this.phone2 = phone2; + } + + public void setProvinceId(String provinceId) + { + this.provinceId = provinceId; + } + + public String getProvinceId() { + return provinceId; + } + + public String getProvinceName() { + return provinceName; + } + + public void setProvinceName(String provinceName) { + this.provinceName = provinceName; + } + + public String getCityId() { + return cityId; + } + + public void setCityId(String cityId) { + this.cityId = cityId; + } + + public String getCityName() { + return cityName; + } + + public void setCityName(String cityName) { + this.cityName = cityName; + } + + public Long getAreaId() { + return areaId; + } + + public void setAreaId(Long areaId) { + this.areaId = areaId; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public void setAddress(String address) + { + this.address = address; + } + + public String getAddress() + { + return address; + } + public void setDetailedAddress(String detailedAddress) + { + this.detailedAddress = detailedAddress; + } + + public String getDetailedAddress() + { + return detailedAddress; + } + public void setImage(String image) + { + this.image = image; + } + + public String getImage() + { + return image; + } + public void setLatitude(String latitude) + { + this.latitude = latitude; + } + + public String getLatitude() + { + return latitude; + } + public void setLongitude(String longitude) + { + this.longitude = longitude; + } + + public String getLongitude() + { + return longitude; + } + public void setContractDate(String contractDate) + { + this.contractDate = contractDate; + } + + public String getContractDate() + { + return contractDate; + } + public void setDayTime(String dayTime) + { + this.dayTime = dayTime; + } + + public String getDayTime() + { + return dayTime; + } + public void setStartTime(String startTime) + { + this.startTime = startTime; + } + + public String getStartTime() + { + return startTime; + } + public void setEndTime(String endTime) + { + this.endTime = endTime; + } + + public String getEndTime() + { + return endTime; + } + public void setIsShow(Integer isShow) + { + this.isShow = isShow; + } + + public Integer getIsShow() + { + return isShow; + } + public void setIsDel(Integer isDel) + { + this.isDel = isDel; + } + + public Integer getIsDel() + { + return isDel; + } + public void setZucheRatio(BigDecimal zucheRatio) + { + this.zucheRatio = zucheRatio; + } + + public BigDecimal getZucheRatio() + { + return zucheRatio; + } + public void setZudianRatio(BigDecimal zudianRatio) + { + this.zudianRatio = zudianRatio; + } + + public BigDecimal getZudianRatio() + { + return zudianRatio; + } + public void setDaishouRatio(BigDecimal daishouRatio) + { + this.daishouRatio = daishouRatio; + } + + public BigDecimal getDaishouRatio() + { + return daishouRatio; + } + public void setLabel(String label) + { + this.label = label; + } + + public String getLabel() + { + return label; + } + public void setOperatingCompanyId(Long operatingCompanyId) + { + this.operatingCompanyId = operatingCompanyId; + } + + public Long getOperatingCompanyId() + { + return operatingCompanyId; + } + public void setOperatingNature(Integer operatingNature) + { + this.operatingNature = operatingNature; + } + + public Integer getOperatingNature() + { + return operatingNature; + } + public void setIntroduction(String introduction) + { + this.introduction = introduction; + } + + public String getIntroduction() + { + return introduction; + } + public void setBankAccount(String bankAccount) + { + this.bankAccount = bankAccount; + } + + public String getBankAccount() + { + return bankAccount; + } + public void setStoreNumber(String storeNumber) + { + this.storeNumber = storeNumber; + } + + public String getStoreNumber() + { + return storeNumber; + } + public void setBusinessLicenseImg(String businessLicenseImg) + { + this.businessLicenseImg = businessLicenseImg; + } + + public String getBusinessLicenseImg() + { + return businessLicenseImg; + } + public void setAuditStatus(Integer auditStatus) + { + this.auditStatus = auditStatus; + } + + public Integer getAuditStatus() + { + return auditStatus; + } + public void setAuditTime(Date auditTime) + { + this.auditTime = auditTime; + } + + public Date getAuditTime() + { + return auditTime; + } + public void setAuditorId(Long auditorId) + { + this.auditorId = auditorId; + } + + public Long getAuditorId() + { + return auditorId; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setIsReturnAllowed(Integer isReturnAllowed) + { + this.isReturnAllowed = isReturnAllowed; + } + + public Integer getIsReturnAllowed() + { + return isReturnAllowed; + } + public void setMealDepositPrice(BigDecimal mealDepositPrice) + { + this.mealDepositPrice = mealDepositPrice; + } + + public BigDecimal getMealDepositPrice() + { + return mealDepositPrice; + } + public void setOrderNumLimit(Long orderNumLimit) + { + this.orderNumLimit = orderNumLimit; + } + + public Long getOrderNumLimit() + { + return orderNumLimit; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setExtend1(String extend1) + { + this.extend1 = extend1; + } + + public String getExtend1() + { + return extend1; + } + public void setExtend2(String extend2) + { + this.extend2 = extend2; + } + + public String getExtend2() + { + return extend2; + } + public void setExtend3(String extend3) + { + this.extend3 = extend3; + } + + public String getExtend3() + { + return extend3; + } + public void setExtend4(String extend4) + { + this.extend4 = extend4; + } + + public String getExtend4() + { + return extend4; + } + public void setExtend5(String extend5) + { + this.extend5 = extend5; + } + + public String getExtend5() + { + return extend5; + } + + public String getOperatingCompanyName() { + return operatingCompanyName; + } + + public void setOperatingCompanyName(String operatingCompanyName) { + this.operatingCompanyName = operatingCompanyName; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("contactPerson", getContactPerson()) + .append("phone", getPhone()) + .append("contactPerson2", getContactPerson2()) + .append("phone2", getPhone2()) + .append("provinceId", getProvinceId()) + .append("provinceName", getProvinceName()) + .append("cityId", getCityId()) + .append("cityName", getCityName()) + .append("areaId", getAreaId()) + .append("areaName", getAreaName()) + .append("address", getAddress()) + .append("detailedAddress", getDetailedAddress()) + .append("image", getImage()) + .append("latitude", getLatitude()) + .append("longitude", getLongitude()) + .append("contractDate", getContractDate()) + .append("dayTime", getDayTime()) + .append("startTime", getStartTime()) + .append("endTime", getEndTime()) + .append("isShow", getIsShow()) + .append("isDel", getIsDel()) + .append("zucheRatio", getZucheRatio()) + .append("zudianRatio", getZudianRatio()) + .append("daishouRatio", getDaishouRatio()) + .append("label", getLabel()) + .append("operatingCompanyId", getOperatingCompanyId()) + .append("operatingNature", getOperatingNature()) + .append("introduction", getIntroduction()) + .append("bankAccount", getBankAccount()) + .append("storeNumber", getStoreNumber()) + .append("businessLicenseImg", getBusinessLicenseImg()) + .append("auditStatus", getAuditStatus()) + .append("auditTime", getAuditTime()) + .append("auditorId", getAuditorId()) + .append("userId", getUserId()) + .append("isReturnAllowed", getIsReturnAllowed()) + .append("mealDepositPrice", getMealDepositPrice()) + .append("orderNumLimit", getOrderNumLimit()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("delFlag", getDelFlag()) + .append("status", getStatus()) + .append("extend1", getExtend1()) + .append("extend2", getExtend2()) + .append("extend3", getExtend3()) + .append("extend4", getExtend4()) + .append("extend5", getExtend5()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/CompanyStoreMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/CompanyStoreMapper.java new file mode 100644 index 0000000..fce8202 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/CompanyStoreMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.operation.mapper; + +import java.util.List; +import com.ruoyi.operation.domain.CompanyStore; + +/** + * 门店Mapper接口 + * + * @author ruoyi + * @date 2025-07-03 + */ +public interface CompanyStoreMapper +{ + /** + * 查询门店 + * + * @param id 门店主键 + * @return 门店 + */ + public CompanyStore selectCompanyStoreById(Long id); + + /** + * 查询门店列表 + * + * @param companyStore 门店 + * @return 门店集合 + */ + public List selectCompanyStoreList(CompanyStore companyStore); + + /** + * 新增门店 + * + * @param companyStore 门店 + * @return 结果 + */ + public int insertCompanyStore(CompanyStore companyStore); + + /** + * 修改门店 + * + * @param companyStore 门店 + * @return 结果 + */ + public int updateCompanyStore(CompanyStore companyStore); + + /** + * 删除门店 + * + * @param id 门店主键 + * @return 结果 + */ + public int deleteCompanyStoreById(Long id); + + /** + * 批量删除门店 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCompanyStoreByIds(String[] ids); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/ICompanyStoreService.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/ICompanyStoreService.java new file mode 100644 index 0000000..20a16da --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/ICompanyStoreService.java @@ -0,0 +1,64 @@ +package com.ruoyi.operation.service; + +import java.util.List; +import com.ruoyi.operation.domain.CompanyStore; + +/** + * 门店Service接口 + * + * @author ruoyi + * @date 2025-07-03 + */ +public interface ICompanyStoreService +{ + /** + * 查询门店 + * + * @param id 门店主键 + * @return 门店 + */ + public CompanyStore selectCompanyStoreById(Long id); + + /** + * 查询门店列表 + * + * @param companyStore 门店 + * @return 门店集合 + */ + public List selectCompanyStoreList(CompanyStore companyStore); + + /** + * 新增门店 + * + * @param companyStore 门店 + * @return 结果 + */ + public int insertCompanyStore(CompanyStore companyStore); + + /** + * 修改门店 + * + * @param companyStore 门店 + * @return 结果 + */ + public int updateCompanyStore(CompanyStore companyStore); + + /** + * 批量删除门店 + * + * @param ids 需要删除的门店主键集合 + * @return 结果 + */ + public int deleteCompanyStoreByIds(String ids); + + /** + * 删除门店信息 + * + * @param id 门店主键 + * @return 结果 + */ + public int deleteCompanyStoreById(Long id); + + public int changeStatus(CompanyStore companyStore); + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/CompanyStoreServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/CompanyStoreServiceImpl.java new file mode 100644 index 0000000..4632296 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/CompanyStoreServiceImpl.java @@ -0,0 +1,104 @@ +package com.ruoyi.operation.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.operation.mapper.CompanyStoreMapper; +import com.ruoyi.operation.domain.CompanyStore; +import com.ruoyi.operation.service.ICompanyStoreService; +import com.ruoyi.common.core.text.Convert; + +/** + * 门店Service业务层处理 + * + * @author ruoyi + * @date 2025-07-03 + */ +@Service +public class CompanyStoreServiceImpl implements ICompanyStoreService +{ + @Autowired + private CompanyStoreMapper companyStoreMapper; + + /** + * 查询门店 + * + * @param id 门店主键 + * @return 门店 + */ + @Override + public CompanyStore selectCompanyStoreById(Long id) + { + return companyStoreMapper.selectCompanyStoreById(id); + } + + /** + * 查询门店列表 + * + * @param companyStore 门店 + * @return 门店 + */ + @Override + public List selectCompanyStoreList(CompanyStore companyStore) + { + return companyStoreMapper.selectCompanyStoreList(companyStore); + } + + /** + * 新增门店 + * + * @param companyStore 门店 + * @return 结果 + */ + @Override + public int insertCompanyStore(CompanyStore companyStore) + { + companyStore.setCreateTime(DateUtils.getNowDate()); + companyStore.setUpdateTime(DateUtils.getNowDate()); + return companyStoreMapper.insertCompanyStore(companyStore); + } + + /** + * 修改门店 + * + * @param companyStore 门店 + * @return 结果 + */ + @Override + public int updateCompanyStore(CompanyStore companyStore) + { + companyStore.setUpdateTime(DateUtils.getNowDate()); + return companyStoreMapper.updateCompanyStore(companyStore); + } + + /** + * 批量删除门店 + * + * @param ids 需要删除的门店主键 + * @return 结果 + */ + @Override + public int deleteCompanyStoreByIds(String ids) + { + return companyStoreMapper.deleteCompanyStoreByIds(Convert.toStrArray(ids)); + } + + /** + * 删除门店信息 + * + * @param id 门店主键 + * @return 结果 + */ + @Override + public int deleteCompanyStoreById(Long id) + { + return companyStoreMapper.deleteCompanyStoreById(id); + } + + @Override + public int changeStatus(CompanyStore companyStore) { + companyStore.setUpdateTime(DateUtils.getNowDate()); + return companyStoreMapper.updateCompanyStore(companyStore); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/operation/CompanyMapper.xml b/ruoyi-admin/src/main/resources/mapper/operation/CompanyMapper.xml index 9d13932..f6d5a47 100644 --- a/ruoyi-admin/src/main/resources/mapper/operation/CompanyMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/operation/CompanyMapper.xml @@ -60,7 +60,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select cs.id, cs.name, cs.contact_person, cs.phone, cs.province_id, cs.province_name, cs.city_id, cs.city_name, cs.area_id, cs.area_name, cs.address, cs.detailed_address, cs.image, cs.latitude, cs.longitude, cs.contract_date, cs.day_time, cs.start_time, cs.end_time, cs.is_show, cs.is_del, cs.zuche_ratio, cs.zudian_ratio, cs.daishou_ratio, cs.label, cs.operating_company_id, cs.operating_nature, cs.introduction, cs.bank_account, cs.store_number, cs.business_license_img, cs.audit_status, cs.audit_time, cs.auditor_id, cs.user_id, cs.is_return_allowed, cs.meal_deposit_price, cs.order_num_limit, cs.create_by, cs.create_time, cs.update_by, cs.update_time, cs.del_flag, cs.status, cs.extend1, cs.extend2, cs.extend3, cs.extend4, cs.extend5 + ,c.company_name as operating_company_name + from company_store cs + left join company c on c.id = cs.operating_company_id + + and cs.name like concat('%', #{name}, '%') + and cs.contact_person = #{contactPerson} + and cs.phone = #{phone} + and cs.province_id = #{provinceId} + and cs.province_name like concat('%', #{provinceName}, '%') + and cs.city_id = #{cityId} + and cs.city_name like concat('%', #{cityName}, '%') + and cs.area_id = #{areaId} + and cs.area_name like concat('%', #{areaName}, '%') + and cs.address = #{address} + and cs.detailed_address = #{detailedAddress} + and cs.image = #{image} + and cs.latitude = #{latitude} + and cs.longitude = #{longitude} + and cs.contract_date = #{contractDate} + and cs.day_time = #{dayTime} + and cs.start_time = #{startTime} + and cs.end_time = #{endTime} + and cs.is_show = #{isShow} + and cs.is_del = #{isDel} + and cs.zuche_ratio = #{zucheRatio} + and cs.zudian_ratio = #{zudianRatio} + and cs.daishou_ratio = #{daishouRatio} + and cs.label = #{label} + and cs.operating_company_id = #{operatingCompanyId} + and cs.operating_nature = #{operatingNature} + and cs.introduction = #{introduction} + and cs.bank_account = #{bankAccount} + and cs.store_number = #{storeNumber} + and cs.business_license_img = #{businessLicenseImg} + and cs.audit_status = #{auditStatus} + and cs.audit_time = #{auditTime} + and cs.auditor_id = #{auditorId} + and cs.user_id = #{userId} + and cs.is_return_allowed = #{isReturnAllowed} + and cs.meal_deposit_price = #{mealDepositPrice} + and cs.status = #{status} + and cs.extend1 = #{extend1} + and cs.extend2 = #{extend2} + and cs.extend3 = #{extend3} + and cs.extend4 = #{extend4} + and cs.extend5 = #{extend5} + + order by cs.create_time desc + + + + + insert into company_store + + name, + contact_person, + phone, + contact_person2, + phone2, + province_id, + province_name, + city_id, + city_name, + area_id, + area_name, + address, + detailed_address, + image, + latitude, + longitude, + contract_date, + day_time, + start_time, + end_time, + is_show, + is_del, + zuche_ratio, + zudian_ratio, + daishou_ratio, + label, + operating_company_id, + operating_nature, + introduction, + bank_account, + store_number, + business_license_img, + audit_status, + audit_time, + auditor_id, + user_id, + is_return_allowed, + meal_deposit_price, + order_num_limit, + create_by, + create_time, + update_by, + update_time, + del_flag, + status, + extend1, + extend2, + extend3, + extend4, + extend5, + + + #{name}, + #{contactPerson}, + #{phone}, + #{contactPerson2}, + #{phone2}, + #{provinceId}, + #{provinceName}, + #{cityId}, + #{cityName}, + #{areaId}, + #{areaName}, + #{address}, + #{detailedAddress}, + #{image}, + #{latitude}, + #{longitude}, + #{contractDate}, + #{dayTime}, + #{startTime}, + #{endTime}, + #{isShow}, + #{isDel}, + #{zucheRatio}, + #{zudianRatio}, + #{daishouRatio}, + #{label}, + #{operatingCompanyId}, + #{operatingNature}, + #{introduction}, + #{bankAccount}, + #{storeNumber}, + #{businessLicenseImg}, + #{auditStatus}, + #{auditTime}, + #{auditorId}, + #{userId}, + #{isReturnAllowed}, + #{mealDepositPrice}, + #{orderNumLimit}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{delFlag}, + #{status}, + #{extend1}, + #{extend2}, + #{extend3}, + #{extend4}, + #{extend5}, + + + + + update company_store + + name = #{name}, + contact_person = #{contactPerson}, + phone = #{phone}, + contact_person2 = #{contactPerson2}, + phone2 = #{phone2}, + province_id = #{provinceId}, + province_name = #{provinceName}, + city_id = #{cityId}, + city_name = #{cityName}, + area_id = #{areaId}, + area_name = #{areaName}, + address = #{address}, + detailed_address = #{detailedAddress}, + image = #{image}, + latitude = #{latitude}, + longitude = #{longitude}, + contract_date = #{contractDate}, + day_time = #{dayTime}, + start_time = #{startTime}, + end_time = #{endTime}, + is_show = #{isShow}, + is_del = #{isDel}, + zuche_ratio = #{zucheRatio}, + zudian_ratio = #{zudianRatio}, + daishou_ratio = #{daishouRatio}, + label = #{label}, + operating_company_id = #{operatingCompanyId}, + operating_nature = #{operatingNature}, + introduction = #{introduction}, + bank_account = #{bankAccount}, + store_number = #{storeNumber}, + business_license_img = #{businessLicenseImg}, + audit_status = #{auditStatus}, + audit_time = #{auditTime}, + auditor_id = #{auditorId}, + user_id = #{userId}, + is_return_allowed = #{isReturnAllowed}, + meal_deposit_price = #{mealDepositPrice}, + order_num_limit = #{orderNumLimit}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + del_flag = #{delFlag}, + status = #{status}, + extend1 = #{extend1}, + extend2 = #{extend2}, + extend3 = #{extend3}, + extend4 = #{extend4}, + extend5 = #{extend5}, + + where id = #{id} + + + + delete from company_store where id = #{id} + + + + delete from company_store where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/operation/company/company.html b/ruoyi-admin/src/main/resources/templates/operation/company/company.html index d26de9c..64513e4 100644 --- a/ruoyi-admin/src/main/resources/templates/operation/company/company.html +++ b/ruoyi-admin/src/main/resources/templates/operation/company/company.html @@ -144,14 +144,14 @@ $.table.init(options); }); - /* 用户管理-停用 */ + /* 停用 */ function disable(id,phone) { $.modal.confirm("确认是否停用此运营商?停用后此运营商的车辆与门店不会显示在小程序中", function() { $.operate.post(prefix + "/changeStatus", { "id": id, "phone": phone , "status": 1 }); }) } - /* 用户管理启用 */ + /* 启用 */ function enable(id,phone) { $.modal.confirm("确认是否启用此运营商?启用运营商后停用前的数据将恢复正常,运营商可登录管理后台。", function() { $.operate.post(prefix + "/changeStatus", { "id": id, "phone": phone , "status": 0 }); diff --git a/ruoyi-admin/src/main/resources/templates/operation/store/add.html b/ruoyi-admin/src/main/resources/templates/operation/store/add.html new file mode 100644 index 0000000..639b094 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/operation/store/add.html @@ -0,0 +1,314 @@ + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+ +
+
+ + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/operation/store/edit.html b/ruoyi-admin/src/main/resources/templates/operation/store/edit.html new file mode 100644 index 0000000..8667b50 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/operation/store/edit.html @@ -0,0 +1,337 @@ + + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+ +
+
+ + + + + diff --git a/ruoyi-admin/src/main/resources/templates/operation/store/store.html b/ruoyi-admin/src/main/resources/templates/operation/store/store.html new file mode 100644 index 0000000..49830fd --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/operation/store/store.html @@ -0,0 +1,226 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CompanyConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CompanyConstants.java new file mode 100644 index 0000000..69569b2 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CompanyConstants.java @@ -0,0 +1,11 @@ +package com.ruoyi.common.constant; + +public class CompanyConstants { + + /** + * 运营商状态 + * 0正常 1停用 + */ + public static final String company_status_0 = "0"; + public static final String company_status_1 = "1"; +}