diff --git a/web-api/src/main/java/com/jeesite/modules/biz/dao/MyAreaSourceDao.java b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyAreaSourceDao.java new file mode 100644 index 0000000..afd6013 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyAreaSourceDao.java @@ -0,0 +1,15 @@ +package com.jeesite.modules.biz.dao; + +import com.jeesite.common.dao.CrudDao; +import com.jeesite.common.mybatis.annotation.MyBatisDao; +import com.jeesite.modules.biz.entity.MyAreaSource; + +/** + * 区域信息 DAO 接口 + * @author gaoxq + * @version 2026-03-21 + */ +@MyBatisDao(dataSourceName="work") +public interface MyAreaSourceDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/dao/MyCitiesDao.java b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyCitiesDao.java new file mode 100644 index 0000000..0b18889 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyCitiesDao.java @@ -0,0 +1,15 @@ +package com.jeesite.modules.biz.dao; + +import com.jeesite.common.dao.CrudDao; +import com.jeesite.common.mybatis.annotation.MyBatisDao; +import com.jeesite.modules.biz.entity.MyCities; + +/** + * 城市信息 DAO 接口 + * @author gaoxq + * @version 2026-03-21 + */ +@MyBatisDao(dataSourceName="work") +public interface MyCitiesDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/dao/MyProvinceDao.java b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyProvinceDao.java new file mode 100644 index 0000000..b232754 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyProvinceDao.java @@ -0,0 +1,15 @@ +package com.jeesite.modules.biz.dao; + +import com.jeesite.common.dao.CrudDao; +import com.jeesite.common.mybatis.annotation.MyBatisDao; +import com.jeesite.modules.biz.entity.MyProvince; + +/** + * 省份信息 DAO 接口 + * @author gaoxq + * @version 2026-03-21 + */ +@MyBatisDao(dataSourceName="work") +public interface MyProvinceDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/entity/MyAreaSource.java b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyAreaSource.java new file mode 100644 index 0000000..c71f2d8 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyAreaSource.java @@ -0,0 +1,74 @@ +package com.jeesite.modules.biz.entity; + +import java.io.Serializable; +import java.util.Date; + + +import com.jeesite.common.entity.DataEntity; +import com.jeesite.common.mybatis.annotation.Column; +import com.jeesite.common.mybatis.annotation.Table; +import com.jeesite.common.mybatis.mapper.query.QueryType; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 区域信息 Entity + * + * @author gaoxq + * @version 2026-03-21 + */ +@EqualsAndHashCode(callSuper = true) +@Table(name = "my_area_source", alias = "a", label = "区域信息", columns = { + @Column(name = "create_time", attrName = "createTime", label = "记录时间", isUpdate = false, isUpdateForce = true), + @Column(name = "area_id", attrName = "areaId", label = "唯一编号", isPK = true), + @Column(name = "area_code", attrName = "areaCode", label = "区域编号"), + @Column(name = "area_name", attrName = "areaName", label = "区域名称", queryType = QueryType.LIKE), + @Column(name = "p_area_code", attrName = "pareaCode", label = "上级编码"), + @Column(name = "area_level", attrName = "areaLevel", label = "区域级别"), + @Column(name = "tree_name", attrName = "treeName", label = "树形名称", isQuery = false), + @Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true), + @Column(name = "ustatus", attrName = "ustatus", label = "状态"), +}, orderBy = "a.create_time DESC" +) +@Data +public class MyAreaSource extends DataEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + private Date createTime; // 记录时间 + private String areaId; // 唯一编号 + private String areaCode; // 区域编号 + private String areaName; // 区域名称 + private String pareaCode; // 上级编码 + private Integer areaLevel; // 区域级别 + private String treeName; // 树形名称 + private Date updateTime; // 更新时间 + private String ustatus; // 状态 + + public MyAreaSource() { + this(null); + } + + public MyAreaSource(String id) { + super(id); + } + + public Date getCreateTime_gte() { + return sqlMap.getWhere().getValue("create_time", QueryType.GTE); + } + + public void setCreateTime_gte(Date createTime) { + sqlMap.getWhere().and("create_time", QueryType.GTE, createTime); + } + + public Date getCreateTime_lte() { + return sqlMap.getWhere().getValue("create_time", QueryType.LTE); + } + + public void setCreateTime_lte(Date createTime) { + sqlMap.getWhere().and("create_time", QueryType.LTE, createTime); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/entity/MyCities.java b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyCities.java new file mode 100644 index 0000000..fb11748 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyCities.java @@ -0,0 +1,99 @@ +package com.jeesite.modules.biz.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.jeesite.common.mybatis.annotation.JoinTable; +import com.jeesite.common.mybatis.annotation.JoinTable.Type; + +import com.jeesite.common.entity.DataEntity; +import com.jeesite.common.mybatis.annotation.Column; +import com.jeesite.common.mybatis.annotation.Table; +import com.jeesite.common.mybatis.mapper.query.QueryType; +import com.jeesite.common.utils.excel.annotation.ExcelField; +import com.jeesite.common.utils.excel.annotation.ExcelField.Align; +import com.jeesite.common.utils.excel.annotation.ExcelFields; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 城市信息 Entity + * + * @author gaoxq + * @version 2026-03-21 + */ +@EqualsAndHashCode(callSuper = true) +@Table(name = "my_cities", alias = "a", label = "城市信息", columns = { + @Column(name = "city_id", attrName = "cityId", label = "唯一主键", isPK = true), + @Column(name = "create_time", attrName = "createTime", label = "记录时间", isUpdate = false, isUpdateForce = true), + @Column(name = "province_code", attrName = "provinceCode", label = "省份编码"), + @Column(name = "city_code", attrName = "cityCode", label = "市区编码", isQuery = false), + @Column(name = "city_name", attrName = "cityName", label = "市区名称", queryType = QueryType.LIKE), + @Column(name = "area_code", attrName = "areaCode", label = "市区区号"), + @Column(name = "area_type", attrName = "areaType", label = "市区级别"), + @Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true), + @Column(name = "ustatus", attrName = "ustatus", label = "状态"), +}, joinTable = { + @JoinTable(type = Type.LEFT_JOIN, entity = MyProvince.class, alias = "b", + on = "a.province_code = b.province_code", attrName = "this", + columns = { + @Column(name = "province_name", attrName = "provinceName", label = "省份名称"), + }), +}, orderBy = "a.create_time DESC" +) +@Data +public class MyCities extends DataEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + private String cityId; // 唯一主键 + private Date createTime; // 记录时间 + private String provinceCode; // 省份编码 + private String cityCode; // 市区编码 + private String cityName; // 市区名称 + private String areaCode; // 市区区号 + private String areaType; // 市区级别 + private Date updateTime; // 更新时间 + private String ustatus; // 状态 + + private String provinceName; + + @ExcelFields({ + @ExcelField(title = "唯一主键", attrName = "cityId", align = Align.CENTER, sort = 10), + @ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 20, dataFormat = "yyyy-MM-dd hh:mm"), + @ExcelField(title = "省份名称", attrName = "provinceName", align = Align.CENTER, sort = 30), + @ExcelField(title = "省份编码", attrName = "provinceCode", align = Align.CENTER, sort = 30), + @ExcelField(title = "市区编码", attrName = "cityCode", align = Align.CENTER, sort = 40), + @ExcelField(title = "市区名称", attrName = "cityName", align = Align.CENTER, sort = 50), + @ExcelField(title = "市区区号", attrName = "areaCode", align = Align.CENTER, sort = 60), + @ExcelField(title = "市区级别", attrName = "areaType", align = Align.CENTER, sort = 70), + @ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 80, dataFormat = "yyyy-MM-dd hh:mm"), + @ExcelField(title = "状态", attrName = "ustatus", dictType = "biz_status", align = Align.CENTER, sort = 90), + }) + public MyCities() { + this(null); + } + + public MyCities(String id) { + super(id); + } + + public Date getCreateTime_gte() { + return sqlMap.getWhere().getValue("create_time", QueryType.GTE); + } + + public void setCreateTime_gte(Date createTime) { + sqlMap.getWhere().and("create_time", QueryType.GTE, createTime); + } + + public Date getCreateTime_lte() { + return sqlMap.getWhere().getValue("create_time", QueryType.LTE); + } + + public void setCreateTime_lte(Date createTime) { + sqlMap.getWhere().and("create_time", QueryType.LTE, createTime); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/entity/MyProvince.java b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyProvince.java new file mode 100644 index 0000000..300e2fb --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyProvince.java @@ -0,0 +1,71 @@ +package com.jeesite.modules.biz.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.jeesite.common.mybatis.annotation.JoinTable; +import com.jeesite.common.mybatis.annotation.JoinTable.Type; +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; + +import com.jeesite.common.entity.DataEntity; +import com.jeesite.common.mybatis.annotation.Column; +import com.jeesite.common.mybatis.annotation.Table; +import com.jeesite.common.mybatis.mapper.query.QueryType; +import com.jeesite.common.utils.excel.annotation.ExcelField; +import com.jeesite.common.utils.excel.annotation.ExcelField.Align; +import com.jeesite.common.utils.excel.annotation.ExcelFields; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 省份信息 Entity + * + * @author gaoxq + * @version 2026-03-21 + */ +@EqualsAndHashCode(callSuper = true) +@Table(name = "my_province", alias = "a", label = "省份信息", columns = { + @Column(name = "province_id", attrName = "provinceId", label = "唯一主键", isPK = true), + @Column(name = "create_time", attrName = "createTime", label = "记录时间", isUpdate = false, isQuery = false, isUpdateForce = true), + @Column(name = "province_name", attrName = "provinceName", label = "省份名称", queryType = QueryType.LIKE), + @Column(name = "province_code", attrName = "provinceCode", label = "省份编码"), + @Column(name = "sorting", attrName = "sorting", label = "省份序号", isQuery = false), + @Column(name = "ustatus", attrName = "ustatus", label = "状态"), + @Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true), +}, orderBy = "a.create_time DESC" +) +@Data +public class MyProvince extends DataEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + private String provinceId; // 唯一主键 + private Date createTime; // 记录时间 + private String provinceName; // 省份名称 + private String provinceCode; // 省份编码 + private Integer sorting; // 省份序号 + private String ustatus; // 状态 + private Date updateTime; // 更新时间 + + @ExcelFields({ + @ExcelField(title = "唯一主键", attrName = "provinceId", align = Align.CENTER, sort = 10), + @ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 20, dataFormat = "yyyy-MM-dd hh:mm"), + @ExcelField(title = "省份名称", attrName = "provinceName", align = Align.CENTER, sort = 30), + @ExcelField(title = "省份编码", attrName = "provinceCode", align = Align.CENTER, sort = 40), + @ExcelField(title = "省份序号", attrName = "sorting", align = Align.CENTER, sort = 50), + @ExcelField(title = "状态", attrName = "ustatus", dictType = "biz_status", align = Align.CENTER, sort = 60), + @ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 70, dataFormat = "yyyy-MM-dd hh:mm"), + }) + public MyProvince() { + this(null); + } + + public MyProvince(String id) { + super(id); + } +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/entity/MyScreenInfo.java b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyScreenInfo.java index 20659c6..813324b 100644 --- a/web-api/src/main/java/com/jeesite/modules/biz/entity/MyScreenInfo.java +++ b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyScreenInfo.java @@ -35,7 +35,7 @@ import java.io.Serial; @Column(name="remark", attrName="remark", label="说明描述", isQuery=false), @Column(name="ustatus", attrName="ustatus", label="状态"), @Column(name="update_time", attrName="updateTime", label="更新时间", isInsert=false, isQuery=false, isUpdateForce=true), - }, orderBy="a.screen_id DESC" + }, orderBy="a.create_time DESC" ) @Data public class MyScreenInfo extends DataEntity implements Serializable { diff --git a/web-api/src/main/java/com/jeesite/modules/biz/service/MyAreaSourceService.java b/web-api/src/main/java/com/jeesite/modules/biz/service/MyAreaSourceService.java new file mode 100644 index 0000000..a2cbaf8 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/service/MyAreaSourceService.java @@ -0,0 +1,79 @@ +package com.jeesite.modules.biz.service; + +import java.util.List; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.jeesite.common.entity.Page; +import com.jeesite.common.service.CrudService; +import com.jeesite.modules.biz.entity.MyAreaSource; +import com.jeesite.modules.biz.dao.MyAreaSourceDao; + +/** + * 区域信息 Service + * @author gaoxq + * @version 2026-03-21 + */ +@Service +public class MyAreaSourceService extends CrudService { + + /** + * 获取单条数据 + * @param myAreaSource 主键 + */ + @Override + public MyAreaSource get(MyAreaSource myAreaSource) { + return super.get(myAreaSource); + } + + /** + * 查询分页数据 + * @param myAreaSource 查询条件 + * @param myAreaSource page 分页对象 + */ + @Override + public Page findPage(MyAreaSource myAreaSource) { + return super.findPage(myAreaSource); + } + + /** + * 查询列表数据 + * @param myAreaSource 查询条件 + */ + @Override + public List findList(MyAreaSource myAreaSource) { + return super.findList(myAreaSource); + } + + /** + * 保存数据(插入或更新) + * @param myAreaSource 数据对象 + */ + @Override + @Transactional + public void save(MyAreaSource myAreaSource) { + super.save(myAreaSource); + } + + /** + * 更新状态 + * @param myAreaSource 数据对象 + */ + @Override + @Transactional + public void updateStatus(MyAreaSource myAreaSource) { + super.updateStatus(myAreaSource); + } + + /** + * 删除数据 + * @param myAreaSource 数据对象 + */ + @Override + @Transactional + public void delete(MyAreaSource myAreaSource) { + myAreaSource.sqlMap().markIdDelete(); // 逻辑删除时标记ID值 + super.delete(myAreaSource); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/service/MyCitiesService.java b/web-api/src/main/java/com/jeesite/modules/biz/service/MyCitiesService.java new file mode 100644 index 0000000..60172e4 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/service/MyCitiesService.java @@ -0,0 +1,134 @@ +package com.jeesite.modules.biz.service; + +import java.util.List; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.jeesite.common.entity.Page; +import com.jeesite.common.service.CrudService; +import com.jeesite.modules.biz.entity.MyCities; +import com.jeesite.modules.biz.dao.MyCitiesDao; +import com.jeesite.common.service.ServiceException; +import com.jeesite.common.config.Global; +import com.jeesite.common.validator.ValidatorUtils; +import com.jeesite.common.utils.excel.ExcelImport; +import org.springframework.web.multipart.MultipartFile; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; + +/** + * 城市信息 Service + * @author gaoxq + * @version 2026-03-21 + */ +@Service +public class MyCitiesService extends CrudService { + + /** + * 获取单条数据 + * @param myCities 主键 + */ + @Override + public MyCities get(MyCities myCities) { + return super.get(myCities); + } + + /** + * 查询分页数据 + * @param myCities 查询条件 + * @param myCities page 分页对象 + */ + @Override + public Page findPage(MyCities myCities) { + return super.findPage(myCities); + } + + /** + * 查询列表数据 + * @param myCities 查询条件 + */ + @Override + public List findList(MyCities myCities) { + return super.findList(myCities); + } + + /** + * 保存数据(插入或更新) + * @param myCities 数据对象 + */ + @Override + @Transactional + public void save(MyCities myCities) { + super.save(myCities); + } + + /** + * 导入数据 + * @param file 导入的数据文件 + */ + @Transactional + public String importData(MultipartFile file) { + if (file == null){ + throw new ServiceException(text("请选择导入的数据文件!")); + } + int successNum = 0; int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + try(ExcelImport ei = new ExcelImport(file, 2, 0)){ + List list = ei.getDataList(MyCities.class); + for (MyCities myCities : list) { + try{ + ValidatorUtils.validateWithException(myCities); + this.save(myCities); + successNum++; + successMsg.append("
" + successNum + "、编号 " + myCities.getId() + " 导入成功"); + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、编号 " + myCities.getId() + " 导入失败:"; + if (e instanceof ConstraintViolationException){ + ConstraintViolationException cve = (ConstraintViolationException)e; + for (ConstraintViolation violation : cve.getConstraintViolations()) { + msg += Global.getText(violation.getMessage()) + " ("+violation.getPropertyPath()+")"; + } + }else{ + msg += e.getMessage(); + } + failureMsg.append(msg); + logger.error(msg, e); + } + } + } catch (Exception e) { + logger.error(e.getMessage(), e); + failureMsg.append(e.getMessage()); + return failureMsg.toString(); + } + if (failureNum > 0) { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + }else{ + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } + + /** + * 更新状态 + * @param myCities 数据对象 + */ + @Override + @Transactional + public void updateStatus(MyCities myCities) { + super.updateStatus(myCities); + } + + /** + * 删除数据 + * @param myCities 数据对象 + */ + @Override + @Transactional + public void delete(MyCities myCities) { + super.delete(myCities); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/service/MyProvinceService.java b/web-api/src/main/java/com/jeesite/modules/biz/service/MyProvinceService.java new file mode 100644 index 0000000..83b9c21 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/service/MyProvinceService.java @@ -0,0 +1,134 @@ +package com.jeesite.modules.biz.service; + +import java.util.List; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.jeesite.common.entity.Page; +import com.jeesite.common.service.CrudService; +import com.jeesite.modules.biz.entity.MyProvince; +import com.jeesite.modules.biz.dao.MyProvinceDao; +import com.jeesite.common.service.ServiceException; +import com.jeesite.common.config.Global; +import com.jeesite.common.validator.ValidatorUtils; +import com.jeesite.common.utils.excel.ExcelImport; +import org.springframework.web.multipart.MultipartFile; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; + +/** + * 省份信息 Service + * @author gaoxq + * @version 2026-03-21 + */ +@Service +public class MyProvinceService extends CrudService { + + /** + * 获取单条数据 + * @param myProvince 主键 + */ + @Override + public MyProvince get(MyProvince myProvince) { + return super.get(myProvince); + } + + /** + * 查询分页数据 + * @param myProvince 查询条件 + * @param myProvince page 分页对象 + */ + @Override + public Page findPage(MyProvince myProvince) { + return super.findPage(myProvince); + } + + /** + * 查询列表数据 + * @param myProvince 查询条件 + */ + @Override + public List findList(MyProvince myProvince) { + return super.findList(myProvince); + } + + /** + * 保存数据(插入或更新) + * @param myProvince 数据对象 + */ + @Override + @Transactional + public void save(MyProvince myProvince) { + super.save(myProvince); + } + + /** + * 导入数据 + * @param file 导入的数据文件 + */ + @Transactional + public String importData(MultipartFile file) { + if (file == null){ + throw new ServiceException(text("请选择导入的数据文件!")); + } + int successNum = 0; int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + try(ExcelImport ei = new ExcelImport(file, 2, 0)){ + List list = ei.getDataList(MyProvince.class); + for (MyProvince myProvince : list) { + try{ + ValidatorUtils.validateWithException(myProvince); + this.save(myProvince); + successNum++; + successMsg.append("
" + successNum + "、编号 " + myProvince.getId() + " 导入成功"); + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、编号 " + myProvince.getId() + " 导入失败:"; + if (e instanceof ConstraintViolationException){ + ConstraintViolationException cve = (ConstraintViolationException)e; + for (ConstraintViolation violation : cve.getConstraintViolations()) { + msg += Global.getText(violation.getMessage()) + " ("+violation.getPropertyPath()+")"; + } + }else{ + msg += e.getMessage(); + } + failureMsg.append(msg); + logger.error(msg, e); + } + } + } catch (Exception e) { + logger.error(e.getMessage(), e); + failureMsg.append(e.getMessage()); + return failureMsg.toString(); + } + if (failureNum > 0) { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + }else{ + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } + + /** + * 更新状态 + * @param myProvince 数据对象 + */ + @Override + @Transactional + public void updateStatus(MyProvince myProvince) { + super.updateStatus(myProvince); + } + + /** + * 删除数据 + * @param myProvince 数据对象 + */ + @Override + @Transactional + public void delete(MyProvince myProvince) { + super.delete(myProvince); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/web/MyAreaSourceController.java b/web-api/src/main/java/com/jeesite/modules/biz/web/MyAreaSourceController.java new file mode 100644 index 0000000..f801146 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/web/MyAreaSourceController.java @@ -0,0 +1,137 @@ +package com.jeesite.modules.biz.web; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.jeesite.common.config.Global; +import com.jeesite.common.entity.Page; +import com.jeesite.common.web.BaseController; +import com.jeesite.modules.biz.entity.MyAreaSource; +import com.jeesite.modules.biz.service.MyAreaSourceService; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 区域信息 Controller + * + * @author gaoxq + * @version 2026-03-21 + */ +@Controller +@RequestMapping(value = "${adminPath}/biz/myAreaSource") +public class MyAreaSourceController extends BaseController { + + private final MyAreaSourceService myAreaSourceService; + + public MyAreaSourceController(MyAreaSourceService myAreaSourceService) { + this.myAreaSourceService = myAreaSourceService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public MyAreaSource get(String areaId, boolean isNewRecord) { + return myAreaSourceService.get(areaId, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("biz:myAreaSource:view") + @RequestMapping(value = {"list", ""}) + public String list(MyAreaSource myAreaSource, Model model) { + model.addAttribute("myAreaSource", myAreaSource); + return "modules/biz/myAreaSourceList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("biz:myAreaSource:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(MyAreaSource myAreaSource, HttpServletRequest request, HttpServletResponse response) { + myAreaSource.setPage(new Page<>(request, response)); + Page page = myAreaSourceService.findPage(myAreaSource); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("biz:myAreaSource:view") + @RequestMapping(value = "form") + public String form(MyAreaSource myAreaSource, Model model) { + model.addAttribute("myAreaSource", myAreaSource); + return "modules/biz/myAreaSourceForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("biz:myAreaSource:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated MyAreaSource myAreaSource) { + myAreaSourceService.save(myAreaSource); + return renderResult(Global.TRUE, text("保存区域成功!")); + } + + /** + * 删除数据 + */ + @RequiresPermissions("biz:myAreaSource:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(MyAreaSource myAreaSource) { + myAreaSourceService.delete(myAreaSource); + return renderResult(Global.TRUE, text("删除区域成功!")); + } + + /** + * 树形结构 + */ + @RequestMapping(value = "treeData") + @ResponseBody + public List> treeAreasData(MyAreaSource myAreaSource) { + List> treeData = new ArrayList<>(); + List areaSourceList = myAreaSourceService.findList(myAreaSource); + Map> nodeMap = new HashMap<>(); + for (MyAreaSource area : areaSourceList) { + Map node = new HashMap<>(); + node.put("id", area.getAreaCode()); + node.put("name", area.getAreaName()); + node.put("disabled", false); + node.put("children", new ArrayList>()); + nodeMap.put(area.getAreaCode(), node); + } + for (MyAreaSource area : areaSourceList) { + Map currentNode = nodeMap.get(area.getAreaCode()); + String parentCode = area.getPareaCode(); // 当前节点的父编码 + if (nodeMap.containsKey(parentCode)) { + Map parentNode = nodeMap.get(parentCode); + List> children = (List>) parentNode.get("children"); + children.add(currentNode); + } else { + if (parentCode.equals("0")) { + treeData.add(currentNode); + } + } + } + return treeData; + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/web/MyCitiesController.java b/web-api/src/main/java/com/jeesite/modules/biz/web/MyCitiesController.java new file mode 100644 index 0000000..2230275 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/web/MyCitiesController.java @@ -0,0 +1,146 @@ +package com.jeesite.modules.biz.web; + +import java.util.List; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.jeesite.common.config.Global; +import com.jeesite.common.collect.ListUtils; +import com.jeesite.common.entity.Page; +import com.jeesite.common.lang.DateUtils; +import com.jeesite.common.utils.excel.ExcelExport; +import com.jeesite.common.utils.excel.annotation.ExcelField.Type; +import org.springframework.web.multipart.MultipartFile; +import com.jeesite.common.web.BaseController; +import com.jeesite.modules.biz.entity.MyCities; +import com.jeesite.modules.biz.service.MyCitiesService; + +/** + * 城市信息 Controller + * @author gaoxq + * @version 2026-03-21 + */ +@Controller +@RequestMapping(value = "${adminPath}/biz/myCities") +public class MyCitiesController extends BaseController { + + private final MyCitiesService myCitiesService; + + public MyCitiesController(MyCitiesService myCitiesService) { + this.myCitiesService = myCitiesService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public MyCities get(String cityId, boolean isNewRecord) { + return myCitiesService.get(cityId, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("biz:myCities:view") + @RequestMapping(value = {"list", ""}) + public String list(MyCities myCities, Model model) { + model.addAttribute("myCities", myCities); + return "modules/biz/myCitiesList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("biz:myCities:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(MyCities myCities, HttpServletRequest request, HttpServletResponse response) { + myCities.setPage(new Page<>(request, response)); + Page page = myCitiesService.findPage(myCities); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("biz:myCities:view") + @RequestMapping(value = "form") + public String form(MyCities myCities, Model model) { + model.addAttribute("myCities", myCities); + return "modules/biz/myCitiesForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("biz:myCities:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated MyCities myCities) { + myCitiesService.save(myCities); + return renderResult(Global.TRUE, text("保存城市成功!")); + } + + /** + * 导出数据 + */ + @RequiresPermissions("biz:myCities:view") + @RequestMapping(value = "exportData") + public void exportData(MyCities myCities, HttpServletResponse response) { + List list = myCitiesService.findList(myCities); + String fileName = "城市" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx"; + try(ExcelExport ee = new ExcelExport("城市", MyCities.class)){ + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 下载模板 + */ + @RequiresPermissions("biz:myCities:view") + @RequestMapping(value = "importTemplate") + public void importTemplate(HttpServletResponse response) { + MyCities myCities = new MyCities(); + List list = ListUtils.newArrayList(myCities); + String fileName = "城市模板.xlsx"; + try(ExcelExport ee = new ExcelExport("城市", MyCities.class, Type.IMPORT)){ + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 导入数据 + */ + @ResponseBody + @RequiresPermissions("biz:myCities:edit") + @PostMapping(value = "importData") + public String importData(MultipartFile file) { + try { + String message = myCitiesService.importData(file); + return renderResult(Global.TRUE, "posfull:"+message); + } catch (Exception ex) { + return renderResult(Global.FALSE, "posfull:"+ex.getMessage()); + } + } + + /** + * 删除数据 + */ + @RequiresPermissions("biz:myCities:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(MyCities myCities) { + myCitiesService.delete(myCities); + return renderResult(Global.TRUE, text("删除城市成功!")); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/web/MyProvinceController.java b/web-api/src/main/java/com/jeesite/modules/biz/web/MyProvinceController.java new file mode 100644 index 0000000..dd795b0 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/web/MyProvinceController.java @@ -0,0 +1,156 @@ +package com.jeesite.modules.biz.web; + +import java.util.List; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.jeesite.common.config.Global; +import com.jeesite.common.collect.ListUtils; +import com.jeesite.common.entity.Page; +import com.jeesite.common.lang.DateUtils; +import com.jeesite.common.utils.excel.ExcelExport; +import com.jeesite.common.utils.excel.annotation.ExcelField.Type; +import org.springframework.web.multipart.MultipartFile; +import com.jeesite.common.web.BaseController; +import com.jeesite.modules.biz.entity.MyProvince; +import com.jeesite.modules.biz.service.MyProvinceService; + +/** + * 省份信息 Controller + * + * @author gaoxq + * @version 2026-03-21 + */ +@Controller +@RequestMapping(value = "${adminPath}/biz/myProvince") +public class MyProvinceController extends BaseController { + + private final MyProvinceService myProvinceService; + + public MyProvinceController(MyProvinceService myProvinceService) { + this.myProvinceService = myProvinceService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public MyProvince get(String provinceId, boolean isNewRecord) { + return myProvinceService.get(provinceId, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("biz:myProvince:view") + @RequestMapping(value = {"list", ""}) + public String list(MyProvince myProvince, Model model) { + model.addAttribute("myProvince", myProvince); + return "modules/biz/myProvinceList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("biz:myProvince:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(MyProvince myProvince, HttpServletRequest request, HttpServletResponse response) { + myProvince.setPage(new Page<>(request, response)); + Page page = myProvinceService.findPage(myProvince); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("biz:myProvince:view") + @RequestMapping(value = "form") + public String form(MyProvince myProvince, Model model) { + model.addAttribute("myProvince", myProvince); + return "modules/biz/myProvinceForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("biz:myProvince:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated MyProvince myProvince) { + myProvinceService.save(myProvince); + return renderResult(Global.TRUE, text("保存省份成功!")); + } + + /** + * 导出数据 + */ + @RequiresPermissions("biz:myProvince:view") + @RequestMapping(value = "exportData") + public void exportData(MyProvince myProvince, HttpServletResponse response) { + List list = myProvinceService.findList(myProvince); + String fileName = "省份" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx"; + try (ExcelExport ee = new ExcelExport("省份", MyProvince.class)) { + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 下载模板 + */ + @RequiresPermissions("biz:myProvince:view") + @RequestMapping(value = "importTemplate") + public void importTemplate(HttpServletResponse response) { + MyProvince myProvince = new MyProvince(); + List list = ListUtils.newArrayList(myProvince); + String fileName = "省份模板.xlsx"; + try (ExcelExport ee = new ExcelExport("省份", MyProvince.class, Type.IMPORT)) { + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 导入数据 + */ + @ResponseBody + @RequiresPermissions("biz:myProvince:edit") + @PostMapping(value = "importData") + public String importData(MultipartFile file) { + try { + String message = myProvinceService.importData(file); + return renderResult(Global.TRUE, "posfull:" + message); + } catch (Exception ex) { + return renderResult(Global.FALSE, "posfull:" + ex.getMessage()); + } + } + + /** + * 删除数据 + */ + @RequiresPermissions("biz:myProvince:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(MyProvince myProvince) { + myProvinceService.delete(myProvince); + return renderResult(Global.TRUE, text("删除省份成功!")); + } + + /** + * 列表数据 + */ + @RequestMapping(value = "listAll") + @ResponseBody + public List listAll(MyProvince myProvince) { + return myProvinceService.findList(myProvince); + } +} \ No newline at end of file diff --git a/web-api/src/main/resources/mappings/modules/biz/MyAreaSourceDao.xml b/web-api/src/main/resources/mappings/modules/biz/MyAreaSourceDao.xml new file mode 100644 index 0000000..5218222 --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/biz/MyAreaSourceDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-api/src/main/resources/mappings/modules/biz/MyCitiesDao.xml b/web-api/src/main/resources/mappings/modules/biz/MyCitiesDao.xml new file mode 100644 index 0000000..8406f69 --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/biz/MyCitiesDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-api/src/main/resources/mappings/modules/biz/MyProvinceDao.xml b/web-api/src/main/resources/mappings/modules/biz/MyProvinceDao.xml new file mode 100644 index 0000000..12b2414 --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/biz/MyProvinceDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-vue/packages/biz/api/biz/myAreaSource.ts b/web-vue/packages/biz/api/biz/myAreaSource.ts new file mode 100644 index 0000000..7d5aa16 --- /dev/null +++ b/web-vue/packages/biz/api/biz/myAreaSource.ts @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2013-Now http://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. + * @author gaoxq + */ +import { defHttp } from '@jeesite/core/utils/http/axios'; +import { useGlobSetting } from '@jeesite/core/hooks/setting'; +import { BasicModel, Page, TreeDataModel } from '@jeesite/core/api/model/baseModel'; + +const { adminPath } = useGlobSetting(); + +export interface MyAreaSource extends BasicModel { + createTime: string; // 记录时间 + areaId: string; // 区域标识 + areaCode?: string; // 区域编号 + areaName?: string; // 区域名称 + pareaCode?: string; // 上级编号 + areaLevel: number; // 区域级别 + treeName?: string; // 区域地址 + updateTime?: string; // 更新时间 + areaStatus?: string; // 区域状态 +} + +export const MyAreaSourceList = (params?: MyAreaSource | any) => + defHttp.get({ url: adminPath + '/biz/myAreaSource/list', params }); + +export const MyAreaSourceListData = (params?: MyAreaSource | any) => + defHttp.post>({ url: adminPath + '/biz/myAreaSource/listData', params }); + +export const MyAreaSourceForm = (params?: MyAreaSource | any) => + defHttp.get({ url: adminPath + '/biz/myAreaSource/form', params }); + +export const MyAreaSourceSave = (params?: any, data?: MyAreaSource | any) => + defHttp.postJson({ url: adminPath + '/biz/myAreaSource/save', params, data }); + +export const MyAreaSourceDelete = (params?: MyAreaSource | any) => + defHttp.get({ url: adminPath + '/biz/myAreaSource/delete', params }); + +export const MyAreaSourceTreeData = (params?: any) => + defHttp.get({ url: adminPath + '/biz/myAreaSource/treeData', params }); \ No newline at end of file diff --git a/web-vue/packages/biz/api/biz/myCities.ts b/web-vue/packages/biz/api/biz/myCities.ts new file mode 100644 index 0000000..fce1d07 --- /dev/null +++ b/web-vue/packages/biz/api/biz/myCities.ts @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2013-Now https://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. + * @author gaoxq + */ +import { defHttp } from '@jeesite/core/utils/http/axios'; +import { useGlobSetting } from '@jeesite/core/hooks/setting'; +import { BasicModel, Page } from '@jeesite/core/api/model/baseModel'; +import { UploadApiResult } from '@jeesite/core/api/sys/upload'; +import { UploadFileParams } from '@jeesite/types/axios'; +import { AxiosProgressEvent } from 'axios'; + +const { ctxPath, adminPath } = useGlobSetting(); + +export interface MyCities extends BasicModel { + cityId?: string; // 唯一主键 + createTime?: string; // 记录时间 + provinceCode: string; // 省份编码 + cityCode: string; // 市区编码 + cityName: string; // 市区名称 + areaCode: string; // 市区区号 + areaType: string; // 市区级别 + updateTime?: string; // 更新时间 + ustatus: string; // 状态 +} + +export const myCitiesList = (params?: MyCities | any) => + defHttp.get({ url: adminPath + '/biz/myCities/list', params }); + +export const myCitiesListData = (params?: MyCities | any) => + defHttp.post>({ url: adminPath + '/biz/myCities/listData', params }); + +export const myCitiesForm = (params?: MyCities | any) => + defHttp.get({ url: adminPath + '/biz/myCities/form', params }); + +export const myCitiesSave = (params?: any, data?: MyCities | any) => + defHttp.postJson({ url: adminPath + '/biz/myCities/save', params, data }); + +export const myCitiesImportData = ( + params: UploadFileParams, + onUploadProgress: (progressEvent: AxiosProgressEvent) => void, +) => + defHttp.uploadFile( + { + url: ctxPath + adminPath + '/biz/myCities/importData', + onUploadProgress, + }, + params, + ); + +export const myCitiesDelete = (params?: MyCities | any) => + defHttp.get({ url: adminPath + '/biz/myCities/delete', params }); diff --git a/web-vue/packages/biz/api/biz/myProvince.ts b/web-vue/packages/biz/api/biz/myProvince.ts new file mode 100644 index 0000000..765ecb1 --- /dev/null +++ b/web-vue/packages/biz/api/biz/myProvince.ts @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2013-Now https://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. + * @author gaoxq + */ +import { defHttp } from '@jeesite/core/utils/http/axios'; +import { useGlobSetting } from '@jeesite/core/hooks/setting'; +import { BasicModel, Page } from '@jeesite/core/api/model/baseModel'; +import { UploadApiResult } from '@jeesite/core/api/sys/upload'; +import { UploadFileParams } from '@jeesite/types/axios'; +import { AxiosProgressEvent } from 'axios'; + +const { ctxPath, adminPath } = useGlobSetting(); + +export interface MyProvince extends BasicModel { + provinceId?: string; // 唯一主键 + createTime?: string; // 记录时间 + provinceName: string; // 省份名称 + provinceCode: string; // 省份编码 + sorting: number; // 省份序号 + ustatus: string; // 状态 + updateTime?: string; // 更新时间 +} + +export const myProvinceList = (params?: MyProvince | any) => + defHttp.get({ url: adminPath + '/biz/myProvince/list', params }); + +export const myProvinceListAll = (params?: MyProvince | any) => + defHttp.get({ url: adminPath + '/biz/myProvince/listAll', params }); + +export const myProvinceListData = (params?: MyProvince | any) => + defHttp.post>({ url: adminPath + '/biz/myProvince/listData', params }); + +export const myProvinceForm = (params?: MyProvince | any) => + defHttp.get({ url: adminPath + '/biz/myProvince/form', params }); + +export const myProvinceSave = (params?: any, data?: MyProvince | any) => + defHttp.postJson({ url: adminPath + '/biz/myProvince/save', params, data }); + +export const myProvinceImportData = ( + params: UploadFileParams, + onUploadProgress: (progressEvent: AxiosProgressEvent) => void, +) => + defHttp.uploadFile( + { + url: ctxPath + adminPath + '/biz/myProvince/importData', + onUploadProgress, + }, + params, + ); + +export const myProvinceDelete = (params?: MyProvince | any) => + defHttp.get({ url: adminPath + '/biz/myProvince/delete', params }); diff --git a/web-vue/packages/biz/views/biz/myCities/form.vue b/web-vue/packages/biz/views/biz/myCities/form.vue new file mode 100644 index 0000000..02016d0 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myCities/form.vue @@ -0,0 +1,151 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myCities/list.vue b/web-vue/packages/biz/views/biz/myCities/list.vue new file mode 100644 index 0000000..9dab089 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myCities/list.vue @@ -0,0 +1,261 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myCities/select.ts b/web-vue/packages/biz/views/biz/myCities/select.ts new file mode 100644 index 0000000..4ead681 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myCities/select.ts @@ -0,0 +1,151 @@ +import { useI18n } from '@jeesite/core/hooks/web/useI18n'; +import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table'; +import { MyCities, myCitiesListData } from '@jeesite/biz/api/biz/myCities'; + +const { t } = useI18n('biz.myCities'); + +const modalProps = { + title: t('城市选择'), +}; + +const searchForm: FormProps = { + baseColProps: { md: 8, lg: 6 }, + labelWidth: 90, + schemas: [ + { + label: t('记录时间起'), + field: 'createTime_gte', + component: 'DatePicker', + componentProps: { + format: 'YYYY-MM-DD HH:mm', + showTime: { format: 'HH:mm' }, + }, + }, + { + label: t('记录时间止'), + field: 'createTime_lte', + component: 'DatePicker', + componentProps: { + format: 'YYYY-MM-DD HH:mm', + showTime: { format: 'HH:mm' }, + }, + }, + { + label: t('省份编码'), + field: 'provinceCode', + component: 'Input', + }, + { + label: t('市区名称'), + field: 'cityName', + component: 'Input', + }, + { + label: t('市区区号'), + field: 'areaCode', + component: 'Input', + }, + { + label: t('市区级别'), + field: 'areaType', + component: 'Input', + }, + { + label: t('状态'), + field: 'ustatus', + component: 'Select', + componentProps: { + dictType: 'biz_status', + allowClear: true, + }, + }, + ], +}; + +const tableColumns: BasicColumn[] = [ + { + title: t('记录时间'), + dataIndex: 'createTime', + key: 'a.create_time', + sorter: true, + width: 230, + align: 'left', + slot: 'firstColumn', + }, + { + title: t('省份编码'), + dataIndex: 'provinceCode', + key: 'a.province_code', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('市区编码'), + dataIndex: 'cityCode', + key: 'a.city_code', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('市区名称'), + dataIndex: 'cityName', + key: 'a.city_name', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('市区区号'), + dataIndex: 'areaCode', + key: 'a.area_code', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('市区级别'), + dataIndex: 'areaType', + key: 'a.area_type', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('更新时间'), + dataIndex: 'updateTime', + key: 'a.update_time', + sorter: true, + width: 130, + align: 'center', + }, + { + title: t('状态'), + dataIndex: 'ustatus', + key: 'a.ustatus', + sorter: true, + width: 130, + align: 'center', + dictType: 'biz_status', + }, +]; + +const tableProps: BasicTableProps = { + api: myCitiesListData, + beforeFetch: (params) => { + params['isAll'] = true; + return params; + }, + columns: tableColumns, + formConfig: searchForm, + rowKey: 'cityId', +}; + +export default { + modalProps, + tableProps, + itemCode: 'cityId', + itemName: 'cityId', + isShowCode: false, +}; diff --git a/web-vue/packages/biz/views/biz/myProvince/form.vue b/web-vue/packages/biz/views/biz/myProvince/form.vue new file mode 100644 index 0000000..a069b8c --- /dev/null +++ b/web-vue/packages/biz/views/biz/myProvince/form.vue @@ -0,0 +1,132 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myProvince/list.vue b/web-vue/packages/biz/views/biz/myProvince/list.vue new file mode 100644 index 0000000..db79345 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myProvince/list.vue @@ -0,0 +1,205 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myScreenInfo/select.ts b/web-vue/packages/biz/views/biz/myScreenInfo/select.ts index e71ecbe..5309173 100644 --- a/web-vue/packages/biz/views/biz/myScreenInfo/select.ts +++ b/web-vue/packages/biz/views/biz/myScreenInfo/select.ts @@ -1,6 +1,6 @@ import { useI18n } from '@jeesite/core/hooks/web/useI18n'; import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table'; -import { myScreenInfoListData } from '@jeesite/biz/api/biz/myScreenInfo'; +import { MyScreenInfo, myScreenInfoListData } from '@jeesite/biz/api/biz/myScreenInfo'; const { t } = useI18n('biz.myScreenInfo'); diff --git a/web-vue/packages/biz/views/biz/myWebsiteStorage/list.vue b/web-vue/packages/biz/views/biz/myWebsiteStorage/list.vue index 4aa05dd..ef6df53 100644 --- a/web-vue/packages/biz/views/biz/myWebsiteStorage/list.vue +++ b/web-vue/packages/biz/views/biz/myWebsiteStorage/list.vue @@ -86,7 +86,7 @@ const tableColumns: BasicColumn[] = [ { - title: t('记录日期'), + title: t('记录时间'), dataIndex: 'createTime', key: 'a.create_time', sorter: true, diff --git a/web-vue/packages/core/components/ListSelect/src/selectType/bizProvinceSelect.ts b/web-vue/packages/core/components/ListSelect/src/selectType/bizProvinceSelect.ts new file mode 100644 index 0000000..deeb284 --- /dev/null +++ b/web-vue/packages/core/components/ListSelect/src/selectType/bizProvinceSelect.ts @@ -0,0 +1,106 @@ +import { useI18n } from '@jeesite/core/hooks/web/useI18n'; +import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table'; +import { MyProvince, myProvinceListData } from '@jeesite/biz/api/biz/myProvince'; + +const { t } = useI18n('biz.myProvince'); + +const modalProps = { + title: t('省份选择'), +}; + +const searchForm: FormProps = { + baseColProps: { md: 8, lg: 6 }, + labelWidth: 90, + schemas: [ + { + label: t('省份名称'), + field: 'provinceName', + component: 'Input', + }, + { + label: t('省份编码'), + field: 'provinceCode', + component: 'Input', + }, + { + label: t('状态'), + field: 'ustatus', + component: 'Select', + componentProps: { + dictType: 'biz_status', + allowClear: true, + }, + }, + ], +}; + +const tableColumns: BasicColumn[] = [ + { + title: t('记录时间'), + dataIndex: 'createTime', + key: 'a.create_time', + sorter: true, + width: 150, + align: 'left', + }, + { + title: t('省份名称'), + dataIndex: 'provinceName', + key: 'a.province_name', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('省份编码'), + dataIndex: 'provinceCode', + key: 'a.province_code', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('省份序号'), + dataIndex: 'sorting', + key: 'a.sorting', + sorter: true, + width: 130, + align: 'center', + }, + { + title: t('状态'), + dataIndex: 'ustatus', + key: 'a.ustatus', + sorter: true, + width: 130, + align: 'center', + dictType: 'biz_status', + }, + { + title: t('更新时间'), + dataIndex: 'updateTime', + key: 'a.update_time', + sorter: true, + width: 150, + align: 'center', + }, +]; + +const tableProps: BasicTableProps = { + api: myProvinceListData, + beforeFetch: (params) => { + params['isAll'] = true; + return params; + }, + columns: tableColumns, + formConfig: searchForm, + rowKey: 'provinceCode', +}; + +export default { + modalProps, + tableProps, + itemCode: 'provinceCode', + itemName: 'provinceName', + isShowCode: true, +};