diff --git a/web-api/src/main/java/com/jeesite/modules/biz/dao/MyCompanyDao.java b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyCompanyDao.java new file mode 100644 index 0000000..0752ea6 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyCompanyDao.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.MyCompany; + +/** + * 公司信息 DAO 接口 + * @author gaoxq + * @version 2026-03-20 + */ +@MyBatisDao(dataSourceName="work") +public interface MyCompanyDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/dao/MyNotesDao.java b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyNotesDao.java new file mode 100644 index 0000000..e0c8815 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyNotesDao.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.MyNotes; + +/** + * 便签信息 DAO 接口 + * @author gaoxq + * @version 2026-03-20 + */ +@MyBatisDao(dataSourceName="work") +public interface MyNotesDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/dao/MyPersonDao.java b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyPersonDao.java new file mode 100644 index 0000000..53af702 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/dao/MyPersonDao.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.MyPerson; + +/** + * 人员信息 DAO 接口 + * @author gaoxq + * @version 2026-03-20 + */ +@MyBatisDao(dataSourceName="work") +public interface MyPersonDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/entity/MyCompany.java b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyCompany.java new file mode 100644 index 0000000..117ce9f --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyCompany.java @@ -0,0 +1,108 @@ +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 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-20 + */ +@EqualsAndHashCode(callSuper = true) +@Table(name = "my_company", alias = "a", label = "公司信息", columns = { + @Column(name = "create_time", attrName = "createTime", label = "记录时间", isUpdate = false, isUpdateForce = true), + @Column(name = "company_id", attrName = "companyId", label = "唯一主键", isPK = true), + @Column(name = "company_name", attrName = "companyName", label = "公司全称", queryType = QueryType.LIKE), + @Column(name = "short_name", attrName = "shortName", label = "公司简称", isQuery = false), + @Column(name = "credit_code", attrName = "creditCode", label = "统一社会信用代码"), + @Column(name = "legal_person", attrName = "legalPerson", label = "法人姓名", isQuery = false), + @Column(name = "registered_capital", attrName = "registeredCapital", label = "注册资本", isQuery = false), + @Column(name = "establish_date", attrName = "establishDate", label = "成立日期", isQuery = false), + @Column(name = "province", attrName = "province", label = "所在省份"), + @Column(name = "city", attrName = "city", label = "所在城市", isQuery = false), + @Column(name = "address", attrName = "address", label = "注册地址", isQuery = false), + @Column(name = "business_scope", attrName = "businessScope", label = "经营范围", isQuery = false), + @Column(name = "contact_phone", attrName = "contactPhone", label = "公司电话"), + @Column(name = "contact_email", attrName = "contactEmail", label = "公司邮箱", isQuery = false), + @Column(name = "ustatus", attrName = "ustatus", label = "数据状态"), + @Column(name = "update_time", attrName = "updateTime", label = "更新时间", isInsert = false, isQuery = false, isUpdateForce = true), +}, orderBy = "a.create_time DESC" +) +@Data +public class MyCompany extends DataEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + private Date createTime; // 记录时间 + private String companyId; // 唯一主键 + private String companyName; // 公司全称 + private String shortName; // 公司简称 + private String creditCode; // 统一社会信用代码 + private String legalPerson; // 法人姓名 + private String registeredCapital; // 注册资本 + private Date establishDate; // 成立日期 + private String province; // 所在省份 + private String city; // 所在城市 + private String address; // 注册地址 + private String businessScope; // 经营范围 + private String contactPhone; // 公司电话 + private String contactEmail; // 公司邮箱 + private String ustatus; // 数据状态 + private Date updateTime; // 更新时间 + + @ExcelFields({ + @ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"), + @ExcelField(title = "唯一主键", attrName = "companyId", align = Align.CENTER, sort = 20), + @ExcelField(title = "公司全称", attrName = "companyName", align = Align.CENTER, sort = 30), + @ExcelField(title = "公司简称", attrName = "shortName", align = Align.CENTER, sort = 40), + @ExcelField(title = "统一社会信用代码", attrName = "creditCode", align = Align.CENTER, sort = 50), + @ExcelField(title = "法人姓名", attrName = "legalPerson", align = Align.CENTER, sort = 60), + @ExcelField(title = "注册资本", attrName = "registeredCapital", align = Align.CENTER, sort = 70), + @ExcelField(title = "成立日期", attrName = "establishDate", align = Align.CENTER, sort = 80, dataFormat = "yyyy-MM-dd hh:mm"), + @ExcelField(title = "所在省份", attrName = "province", align = Align.CENTER, sort = 90), + @ExcelField(title = "所在城市", attrName = "city", align = Align.CENTER, sort = 100), + @ExcelField(title = "注册地址", attrName = "address", align = Align.CENTER, sort = 110), + @ExcelField(title = "经营范围", attrName = "businessScope", align = Align.CENTER, sort = 120), + @ExcelField(title = "公司电话", attrName = "contactPhone", align = Align.CENTER, sort = 130), + @ExcelField(title = "公司邮箱", attrName = "contactEmail", align = Align.CENTER, sort = 140), + @ExcelField(title = "数据状态", attrName = "ustatus", align = Align.CENTER, sort = 150), + @ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 160, dataFormat = "yyyy-MM-dd hh:mm"), + }) + public MyCompany() { + this(null); + } + + public MyCompany(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/MyNotes.java b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyNotes.java new file mode 100644 index 0000000..9fd3f55 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyNotes.java @@ -0,0 +1,101 @@ +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-20 + */ +@EqualsAndHashCode(callSuper = true) +@Table(name="my_notes", alias="a", label="便签信息", columns={ + @Column(name="create_time", attrName="createTime", label="记录时间", isUpdate=false, isUpdateForce=true), + @Column(name="note_id", attrName="noteId", label="唯一标识", isPK=true), + @Column(name="title", attrName="title", label="标题", queryType=QueryType.LIKE), + @Column(name="content", attrName="content", label="内容", queryType=QueryType.LIKE), + @Column(name="priority", attrName="priority", label="级别"), + @Column(name="ustatus", attrName="ustatus", label="状态"), + @Column(name="start_time", attrName="startTime", label="开始时间", isQuery=false, isUpdateForce=true), + @Column(name="end_time", attrName="endTime", label="结束时间", isQuery=false, isUpdateForce=true), + @Column(name="type", attrName="type", label="类型"), + @Column(name="deadline", attrName="deadline", label="截至时间", isQuery=false), + @Column(name="update_time", attrName="updateTime", label="更新时间", isInsert=false, isQuery=false, isUpdateForce=true), + @Column(name="create_user", attrName="createUser", label="创建用户", isQuery=false), + }, orderBy="a.note_id DESC" +) +@Data +public class MyNotes extends DataEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + private Date createTime; // 记录时间 + private String noteId; // 唯一标识 + private String title; // 标题 + private String content; // 内容 + private String priority; // 级别 + private String ustatus; // 状态 + private Date startTime; // 开始时间 + private Date endTime; // 结束时间 + private String type; // 类型 + private Date deadline; // 截至时间 + private Date updateTime; // 更新时间 + private String createUser; // 创建用户 + + @ExcelFields({ + @ExcelField(title="记录时间", attrName="createTime", align=Align.CENTER, sort=10, dataFormat="yyyy-MM-dd hh:mm"), + @ExcelField(title="唯一标识", attrName="noteId", align=Align.CENTER, sort=20), + @ExcelField(title="标题", attrName="title", align=Align.CENTER, sort=30), + @ExcelField(title="内容", attrName="content", align=Align.CENTER, sort=40), + @ExcelField(title="级别", attrName="priority", align=Align.CENTER, sort=50), + @ExcelField(title="状态", attrName="ustatus", align=Align.CENTER, sort=60), + @ExcelField(title="开始时间", attrName="startTime", align=Align.CENTER, sort=70, dataFormat="yyyy-MM-dd hh:mm"), + @ExcelField(title="结束时间", attrName="endTime", align=Align.CENTER, sort=80, dataFormat="yyyy-MM-dd hh:mm"), + @ExcelField(title="类型", attrName="type", align=Align.CENTER, sort=90), + @ExcelField(title="截至时间", attrName="deadline", align=Align.CENTER, sort=100, dataFormat="yyyy-MM-dd hh:mm"), + @ExcelField(title="更新时间", attrName="updateTime", align=Align.CENTER, sort=110, dataFormat="yyyy-MM-dd hh:mm"), + @ExcelField(title="创建用户", attrName="createUser", align=Align.CENTER, sort=120), + }) + public MyNotes() { + this(null); + } + + public MyNotes(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/MyPerson.java b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyPerson.java new file mode 100644 index 0000000..06bc600 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/entity/MyPerson.java @@ -0,0 +1,106 @@ +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-20 + */ +@EqualsAndHashCode(callSuper = true) +@Table(name="my_person", alias="a", label="人员信息", columns={ + @Column(name="create_time", attrName="createTime", label="记录时间", isUpdate=false, isUpdateForce=true), + @Column(name="person_id", attrName="personId", label="唯一主键", isPK=true), + @Column(name="person_name", attrName="personName", label="姓名", queryType=QueryType.LIKE), + @Column(name="gender", attrName="gender", label="性别"), + @Column(name="id_card", attrName="idCard", label="身份证号"), + @Column(name="phone", attrName="phone", label="手机号码", isQuery=false), + @Column(name="email", attrName="email", label="邮箱", isQuery=false), + @Column(name="birth_date", attrName="birthDate", label="出生日期", isQuery=false), + @Column(name="address", attrName="address", label="居住地址", isQuery=false), + @Column(name="department", attrName="department", label="所属部门", isQuery=false), + @Column(name="position_name", attrName="positionName", label="职位", isQuery=false), + @Column(name="ustatus", attrName="ustatus", label="状态"), + @Column(name="company_id", attrName="companyId", label="公司编号"), + @Column(name="update_time", attrName="updateTime", label="更新时间", isInsert=false, isQuery=false, isUpdateForce=true), + }, orderBy="a.create_time DESC" +) +@Data +public class MyPerson extends DataEntity implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + private Date createTime; // 记录时间 + private String personId; // 唯一主键 + private String personName; // 姓名 + private String gender; // 性别 + private String idCard; // 身份证号 + private String phone; // 手机号码 + private String email; // 邮箱 + private Date birthDate; // 出生日期 + private String address; // 居住地址 + private String department; // 所属部门 + private String positionName; // 职位 + private String ustatus; // 状态 + private String companyId; // 公司编号 + private Date updateTime; // 更新时间 + + @ExcelFields({ + @ExcelField(title="记录时间", attrName="createTime", align=Align.CENTER, sort=10, dataFormat="yyyy-MM-dd hh:mm"), + @ExcelField(title="唯一主键", attrName="personId", align=Align.CENTER, sort=20), + @ExcelField(title="姓名", attrName="personName", align=Align.CENTER, sort=30), + @ExcelField(title="性别", attrName="gender", align=Align.CENTER, sort=40), + @ExcelField(title="身份证号", attrName="idCard", align=Align.CENTER, sort=50), + @ExcelField(title="手机号码", attrName="phone", align=Align.CENTER, sort=60), + @ExcelField(title="邮箱", attrName="email", align=Align.CENTER, sort=70), + @ExcelField(title="出生日期", attrName="birthDate", align=Align.CENTER, sort=80, dataFormat="yyyy-MM-dd hh:mm"), + @ExcelField(title="居住地址", attrName="address", align=Align.CENTER, sort=90), + @ExcelField(title="所属部门", attrName="department", align=Align.CENTER, sort=100), + @ExcelField(title="职位", attrName="positionName", align=Align.CENTER, sort=110), + @ExcelField(title="状态", attrName="ustatus", align=Align.CENTER, sort=120), + @ExcelField(title="公司编号", attrName="companyId", align=Align.CENTER, sort=130), + @ExcelField(title="更新时间", attrName="updateTime", align=Align.CENTER, sort=140, dataFormat="yyyy-MM-dd hh:mm"), + }) + public MyPerson() { + this(null); + } + + public MyPerson(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/service/MyCompanyService.java b/web-api/src/main/java/com/jeesite/modules/biz/service/MyCompanyService.java new file mode 100644 index 0000000..a248040 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/service/MyCompanyService.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.MyCompany; +import com.jeesite.modules.biz.dao.MyCompanyDao; +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-20 + */ +@Service +public class MyCompanyService extends CrudService { + + /** + * 获取单条数据 + * @param myCompany 主键 + */ + @Override + public MyCompany get(MyCompany myCompany) { + return super.get(myCompany); + } + + /** + * 查询分页数据 + * @param myCompany 查询条件 + * @param myCompany page 分页对象 + */ + @Override + public Page findPage(MyCompany myCompany) { + return super.findPage(myCompany); + } + + /** + * 查询列表数据 + * @param myCompany 查询条件 + */ + @Override + public List findList(MyCompany myCompany) { + return super.findList(myCompany); + } + + /** + * 保存数据(插入或更新) + * @param myCompany 数据对象 + */ + @Override + @Transactional + public void save(MyCompany myCompany) { + super.save(myCompany); + } + + /** + * 导入数据 + * @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(MyCompany.class); + for (MyCompany myCompany : list) { + try{ + ValidatorUtils.validateWithException(myCompany); + this.save(myCompany); + successNum++; + successMsg.append("
" + successNum + "、编号 " + myCompany.getId() + " 导入成功"); + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、编号 " + myCompany.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 myCompany 数据对象 + */ + @Override + @Transactional + public void updateStatus(MyCompany myCompany) { + super.updateStatus(myCompany); + } + + /** + * 删除数据 + * @param myCompany 数据对象 + */ + @Override + @Transactional + public void delete(MyCompany myCompany) { + super.delete(myCompany); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/service/MyNotesService.java b/web-api/src/main/java/com/jeesite/modules/biz/service/MyNotesService.java new file mode 100644 index 0000000..4d5e9ad --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/service/MyNotesService.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.MyNotes; +import com.jeesite.modules.biz.dao.MyNotesDao; +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-20 + */ +@Service +public class MyNotesService extends CrudService { + + /** + * 获取单条数据 + * @param myNotes 主键 + */ + @Override + public MyNotes get(MyNotes myNotes) { + return super.get(myNotes); + } + + /** + * 查询分页数据 + * @param myNotes 查询条件 + * @param myNotes page 分页对象 + */ + @Override + public Page findPage(MyNotes myNotes) { + return super.findPage(myNotes); + } + + /** + * 查询列表数据 + * @param myNotes 查询条件 + */ + @Override + public List findList(MyNotes myNotes) { + return super.findList(myNotes); + } + + /** + * 保存数据(插入或更新) + * @param myNotes 数据对象 + */ + @Override + @Transactional + public void save(MyNotes myNotes) { + super.save(myNotes); + } + + /** + * 导入数据 + * @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(MyNotes.class); + for (MyNotes myNotes : list) { + try{ + ValidatorUtils.validateWithException(myNotes); + this.save(myNotes); + successNum++; + successMsg.append("
" + successNum + "、编号 " + myNotes.getId() + " 导入成功"); + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、编号 " + myNotes.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 myNotes 数据对象 + */ + @Override + @Transactional + public void updateStatus(MyNotes myNotes) { + super.updateStatus(myNotes); + } + + /** + * 删除数据 + * @param myNotes 数据对象 + */ + @Override + @Transactional + public void delete(MyNotes myNotes) { + super.delete(myNotes); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/service/MyPersonService.java b/web-api/src/main/java/com/jeesite/modules/biz/service/MyPersonService.java new file mode 100644 index 0000000..46a0076 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/service/MyPersonService.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.MyPerson; +import com.jeesite.modules.biz.dao.MyPersonDao; +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-20 + */ +@Service +public class MyPersonService extends CrudService { + + /** + * 获取单条数据 + * @param myPerson 主键 + */ + @Override + public MyPerson get(MyPerson myPerson) { + return super.get(myPerson); + } + + /** + * 查询分页数据 + * @param myPerson 查询条件 + * @param myPerson page 分页对象 + */ + @Override + public Page findPage(MyPerson myPerson) { + return super.findPage(myPerson); + } + + /** + * 查询列表数据 + * @param myPerson 查询条件 + */ + @Override + public List findList(MyPerson myPerson) { + return super.findList(myPerson); + } + + /** + * 保存数据(插入或更新) + * @param myPerson 数据对象 + */ + @Override + @Transactional + public void save(MyPerson myPerson) { + super.save(myPerson); + } + + /** + * 导入数据 + * @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(MyPerson.class); + for (MyPerson myPerson : list) { + try{ + ValidatorUtils.validateWithException(myPerson); + this.save(myPerson); + successNum++; + successMsg.append("
" + successNum + "、编号 " + myPerson.getId() + " 导入成功"); + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、编号 " + myPerson.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 myPerson 数据对象 + */ + @Override + @Transactional + public void updateStatus(MyPerson myPerson) { + super.updateStatus(myPerson); + } + + /** + * 删除数据 + * @param myPerson 数据对象 + */ + @Override + @Transactional + public void delete(MyPerson myPerson) { + super.delete(myPerson); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/web/MyCompanyController.java b/web-api/src/main/java/com/jeesite/modules/biz/web/MyCompanyController.java new file mode 100644 index 0000000..3f27a38 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/web/MyCompanyController.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.MyCompany; +import com.jeesite.modules.biz.service.MyCompanyService; + +/** + * 公司信息 Controller + * @author gaoxq + * @version 2026-03-20 + */ +@Controller +@RequestMapping(value = "${adminPath}/biz/myCompany") +public class MyCompanyController extends BaseController { + + private final MyCompanyService myCompanyService; + + public MyCompanyController(MyCompanyService myCompanyService) { + this.myCompanyService = myCompanyService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public MyCompany get(String companyId, boolean isNewRecord) { + return myCompanyService.get(companyId, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("biz:myCompany:view") + @RequestMapping(value = {"list", ""}) + public String list(MyCompany myCompany, Model model) { + model.addAttribute("myCompany", myCompany); + return "modules/biz/myCompanyList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("biz:myCompany:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(MyCompany myCompany, HttpServletRequest request, HttpServletResponse response) { + myCompany.setPage(new Page<>(request, response)); + Page page = myCompanyService.findPage(myCompany); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("biz:myCompany:view") + @RequestMapping(value = "form") + public String form(MyCompany myCompany, Model model) { + model.addAttribute("myCompany", myCompany); + return "modules/biz/myCompanyForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("biz:myCompany:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated MyCompany myCompany) { + myCompanyService.save(myCompany); + return renderResult(Global.TRUE, text("保存公司成功!")); + } + + /** + * 导出数据 + */ + @RequiresPermissions("biz:myCompany:view") + @RequestMapping(value = "exportData") + public void exportData(MyCompany myCompany, HttpServletResponse response) { + List list = myCompanyService.findList(myCompany); + String fileName = "公司" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx"; + try(ExcelExport ee = new ExcelExport("公司", MyCompany.class)){ + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 下载模板 + */ + @RequiresPermissions("biz:myCompany:view") + @RequestMapping(value = "importTemplate") + public void importTemplate(HttpServletResponse response) { + MyCompany myCompany = new MyCompany(); + List list = ListUtils.newArrayList(myCompany); + String fileName = "公司模板.xlsx"; + try(ExcelExport ee = new ExcelExport("公司", MyCompany.class, Type.IMPORT)){ + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 导入数据 + */ + @ResponseBody + @RequiresPermissions("biz:myCompany:edit") + @PostMapping(value = "importData") + public String importData(MultipartFile file) { + try { + String message = myCompanyService.importData(file); + return renderResult(Global.TRUE, "posfull:"+message); + } catch (Exception ex) { + return renderResult(Global.FALSE, "posfull:"+ex.getMessage()); + } + } + + /** + * 删除数据 + */ + @RequiresPermissions("biz:myCompany:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(MyCompany myCompany) { + myCompanyService.delete(myCompany); + return renderResult(Global.TRUE, text("删除公司成功!")); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/web/MyNotesController.java b/web-api/src/main/java/com/jeesite/modules/biz/web/MyNotesController.java new file mode 100644 index 0000000..c8d30ae --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/web/MyNotesController.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.MyNotes; +import com.jeesite.modules.biz.service.MyNotesService; + +/** + * 便签信息 Controller + * @author gaoxq + * @version 2026-03-20 + */ +@Controller +@RequestMapping(value = "${adminPath}/biz/myNotes") +public class MyNotesController extends BaseController { + + private final MyNotesService myNotesService; + + public MyNotesController(MyNotesService myNotesService) { + this.myNotesService = myNotesService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public MyNotes get(String noteId, boolean isNewRecord) { + return myNotesService.get(noteId, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("biz:myNotes:view") + @RequestMapping(value = {"list", ""}) + public String list(MyNotes myNotes, Model model) { + model.addAttribute("myNotes", myNotes); + return "modules/biz/myNotesList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("biz:myNotes:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(MyNotes myNotes, HttpServletRequest request, HttpServletResponse response) { + myNotes.setPage(new Page<>(request, response)); + Page page = myNotesService.findPage(myNotes); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("biz:myNotes:view") + @RequestMapping(value = "form") + public String form(MyNotes myNotes, Model model) { + model.addAttribute("myNotes", myNotes); + return "modules/biz/myNotesForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("biz:myNotes:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated MyNotes myNotes) { + myNotesService.save(myNotes); + return renderResult(Global.TRUE, text("保存便签成功!")); + } + + /** + * 导出数据 + */ + @RequiresPermissions("biz:myNotes:view") + @RequestMapping(value = "exportData") + public void exportData(MyNotes myNotes, HttpServletResponse response) { + List list = myNotesService.findList(myNotes); + String fileName = "便签" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx"; + try(ExcelExport ee = new ExcelExport("便签", MyNotes.class)){ + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 下载模板 + */ + @RequiresPermissions("biz:myNotes:view") + @RequestMapping(value = "importTemplate") + public void importTemplate(HttpServletResponse response) { + MyNotes myNotes = new MyNotes(); + List list = ListUtils.newArrayList(myNotes); + String fileName = "便签模板.xlsx"; + try(ExcelExport ee = new ExcelExport("便签", MyNotes.class, Type.IMPORT)){ + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 导入数据 + */ + @ResponseBody + @RequiresPermissions("biz:myNotes:edit") + @PostMapping(value = "importData") + public String importData(MultipartFile file) { + try { + String message = myNotesService.importData(file); + return renderResult(Global.TRUE, "posfull:"+message); + } catch (Exception ex) { + return renderResult(Global.FALSE, "posfull:"+ex.getMessage()); + } + } + + /** + * 删除数据 + */ + @RequiresPermissions("biz:myNotes:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(MyNotes myNotes) { + myNotesService.delete(myNotes); + return renderResult(Global.TRUE, text("删除便签成功!")); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/web/MyPersonController.java b/web-api/src/main/java/com/jeesite/modules/biz/web/MyPersonController.java new file mode 100644 index 0000000..e0ad603 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/web/MyPersonController.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.MyPerson; +import com.jeesite.modules.biz.service.MyPersonService; + +/** + * 人员信息 Controller + * @author gaoxq + * @version 2026-03-20 + */ +@Controller +@RequestMapping(value = "${adminPath}/biz/myPerson") +public class MyPersonController extends BaseController { + + private final MyPersonService myPersonService; + + public MyPersonController(MyPersonService myPersonService) { + this.myPersonService = myPersonService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public MyPerson get(String personId, boolean isNewRecord) { + return myPersonService.get(personId, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("biz:myPerson:view") + @RequestMapping(value = {"list", ""}) + public String list(MyPerson myPerson, Model model) { + model.addAttribute("myPerson", myPerson); + return "modules/biz/myPersonList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("biz:myPerson:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(MyPerson myPerson, HttpServletRequest request, HttpServletResponse response) { + myPerson.setPage(new Page<>(request, response)); + Page page = myPersonService.findPage(myPerson); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("biz:myPerson:view") + @RequestMapping(value = "form") + public String form(MyPerson myPerson, Model model) { + model.addAttribute("myPerson", myPerson); + return "modules/biz/myPersonForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("biz:myPerson:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated MyPerson myPerson) { + myPersonService.save(myPerson); + return renderResult(Global.TRUE, text("保存人员成功!")); + } + + /** + * 导出数据 + */ + @RequiresPermissions("biz:myPerson:view") + @RequestMapping(value = "exportData") + public void exportData(MyPerson myPerson, HttpServletResponse response) { + List list = myPersonService.findList(myPerson); + String fileName = "人员" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx"; + try(ExcelExport ee = new ExcelExport("人员", MyPerson.class)){ + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 下载模板 + */ + @RequiresPermissions("biz:myPerson:view") + @RequestMapping(value = "importTemplate") + public void importTemplate(HttpServletResponse response) { + MyPerson myPerson = new MyPerson(); + List list = ListUtils.newArrayList(myPerson); + String fileName = "人员模板.xlsx"; + try(ExcelExport ee = new ExcelExport("人员", MyPerson.class, Type.IMPORT)){ + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 导入数据 + */ + @ResponseBody + @RequiresPermissions("biz:myPerson:edit") + @PostMapping(value = "importData") + public String importData(MultipartFile file) { + try { + String message = myPersonService.importData(file); + return renderResult(Global.TRUE, "posfull:"+message); + } catch (Exception ex) { + return renderResult(Global.FALSE, "posfull:"+ex.getMessage()); + } + } + + /** + * 删除数据 + */ + @RequiresPermissions("biz:myPerson:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(MyPerson myPerson) { + myPersonService.delete(myPerson); + return renderResult(Global.TRUE, text("删除人员成功!")); + } + +} \ No newline at end of file diff --git a/web-api/src/main/resources/mappings/modules/biz/MyCompanyDao.xml b/web-api/src/main/resources/mappings/modules/biz/MyCompanyDao.xml new file mode 100644 index 0000000..f87292b --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/biz/MyCompanyDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-api/src/main/resources/mappings/modules/biz/MyNotesDao.xml b/web-api/src/main/resources/mappings/modules/biz/MyNotesDao.xml new file mode 100644 index 0000000..c8582a9 --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/biz/MyNotesDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-api/src/main/resources/mappings/modules/biz/MyPersonDao.xml b/web-api/src/main/resources/mappings/modules/biz/MyPersonDao.xml new file mode 100644 index 0000000..814451e --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/biz/MyPersonDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-vue/packages/biz/api/biz/myCompany.ts b/web-vue/packages/biz/api/biz/myCompany.ts new file mode 100644 index 0000000..6d23618 --- /dev/null +++ b/web-vue/packages/biz/api/biz/myCompany.ts @@ -0,0 +1,59 @@ +/** + * 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 MyCompany extends BasicModel { + createTime?: string; // 记录时间 + companyId?: string; // 唯一主键 + companyName: string; // 公司全称 + shortName: string; // 公司简称 + creditCode: string; // 统一社会信用代码 + legalPerson: string; // 法人姓名 + registeredCapital: string; // 注册资本 + establishDate: string; // 成立日期 + province: string; // 所在省份 + city: string; // 所在城市 + address: string; // 注册地址 + businessScope: string; // 经营范围 + contactPhone?: string; // 公司电话 + contactEmail?: string; // 公司邮箱 + ustatus: string; // 数据状态 + updateTime?: string; // 更新时间 +} + +export const myCompanyList = (params?: MyCompany | any) => + defHttp.get({ url: adminPath + '/biz/myCompany/list', params }); + +export const myCompanyListData = (params?: MyCompany | any) => + defHttp.post>({ url: adminPath + '/biz/myCompany/listData', params }); + +export const myCompanyForm = (params?: MyCompany | any) => + defHttp.get({ url: adminPath + '/biz/myCompany/form', params }); + +export const myCompanySave = (params?: any, data?: MyCompany | any) => + defHttp.postJson({ url: adminPath + '/biz/myCompany/save', params, data }); + +export const myCompanyImportData = ( + params: UploadFileParams, + onUploadProgress: (progressEvent: AxiosProgressEvent) => void, +) => + defHttp.uploadFile( + { + url: ctxPath + adminPath + '/biz/myCompany/importData', + onUploadProgress, + }, + params, + ); + +export const myCompanyDelete = (params?: MyCompany | any) => + defHttp.get({ url: adminPath + '/biz/myCompany/delete', params }); diff --git a/web-vue/packages/biz/api/biz/myNotes.ts b/web-vue/packages/biz/api/biz/myNotes.ts new file mode 100644 index 0000000..dcd20bb --- /dev/null +++ b/web-vue/packages/biz/api/biz/myNotes.ts @@ -0,0 +1,55 @@ +/** + * 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 MyNotes extends BasicModel { + createTime?: string; // 记录时间 + noteId?: string; // 唯一标识 + title: string; // 标题 + content: string; // 内容 + priority: string; // 级别 + ustatus: string; // 状态 + startTime?: string; // 开始时间 + endTime?: string; // 结束时间 + type: string; // 类型 + deadline: string; // 截至时间 + updateTime?: string; // 更新时间 + createUser?: string; // 创建用户 +} + +export const myNotesList = (params?: MyNotes | any) => + defHttp.get({ url: adminPath + '/biz/myNotes/list', params }); + +export const myNotesListData = (params?: MyNotes | any) => + defHttp.post>({ url: adminPath + '/biz/myNotes/listData', params }); + +export const myNotesForm = (params?: MyNotes | any) => + defHttp.get({ url: adminPath + '/biz/myNotes/form', params }); + +export const myNotesSave = (params?: any, data?: MyNotes | any) => + defHttp.postJson({ url: adminPath + '/biz/myNotes/save', params, data }); + +export const myNotesImportData = ( + params: UploadFileParams, + onUploadProgress: (progressEvent: AxiosProgressEvent) => void, +) => + defHttp.uploadFile( + { + url: ctxPath + adminPath + '/biz/myNotes/importData', + onUploadProgress, + }, + params, + ); + +export const myNotesDelete = (params?: MyNotes | any) => + defHttp.get({ url: adminPath + '/biz/myNotes/delete', params }); diff --git a/web-vue/packages/biz/api/biz/myPerson.ts b/web-vue/packages/biz/api/biz/myPerson.ts new file mode 100644 index 0000000..2b57858 --- /dev/null +++ b/web-vue/packages/biz/api/biz/myPerson.ts @@ -0,0 +1,57 @@ +/** + * 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 MyPerson extends BasicModel { + createTime?: string; // 记录时间 + personId?: string; // 唯一主键 + personName: string; // 姓名 + gender: string; // 性别 + idCard: string; // 身份证号 + phone?: string; // 手机号码 + email?: string; // 邮箱 + birthDate: string; // 出生日期 + address?: string; // 居住地址 + department?: string; // 所属部门 + positionName?: string; // 职位 + ustatus?: string; // 状态 + companyId?: string; // 公司编号 + updateTime?: string; // 更新时间 +} + +export const myPersonList = (params?: MyPerson | any) => + defHttp.get({ url: adminPath + '/biz/myPerson/list', params }); + +export const myPersonListData = (params?: MyPerson | any) => + defHttp.post>({ url: adminPath + '/biz/myPerson/listData', params }); + +export const myPersonForm = (params?: MyPerson | any) => + defHttp.get({ url: adminPath + '/biz/myPerson/form', params }); + +export const myPersonSave = (params?: any, data?: MyPerson | any) => + defHttp.postJson({ url: adminPath + '/biz/myPerson/save', params, data }); + +export const myPersonImportData = ( + params: UploadFileParams, + onUploadProgress: (progressEvent: AxiosProgressEvent) => void, +) => + defHttp.uploadFile( + { + url: ctxPath + adminPath + '/biz/myPerson/importData', + onUploadProgress, + }, + params, + ); + +export const myPersonDelete = (params?: MyPerson | any) => + defHttp.get({ url: adminPath + '/biz/myPerson/delete', params }); diff --git a/web-vue/packages/biz/views/biz/myCompany/form.vue b/web-vue/packages/biz/views/biz/myCompany/form.vue new file mode 100644 index 0000000..b8c41c3 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myCompany/form.vue @@ -0,0 +1,206 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myCompany/list.vue b/web-vue/packages/biz/views/biz/myCompany/list.vue new file mode 100644 index 0000000..62d7a26 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myCompany/list.vue @@ -0,0 +1,305 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myCompany/select.ts b/web-vue/packages/biz/views/biz/myCompany/select.ts new file mode 100644 index 0000000..5da8364 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myCompany/select.ts @@ -0,0 +1,207 @@ +import { useI18n } from '@jeesite/core/hooks/web/useI18n'; +import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table'; +import { MyCompany, myCompanyListData } from '@jeesite/biz/api/biz/myCompany'; + +const { t } = useI18n('biz.myCompany'); + +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: 'companyName', + component: 'Input', + }, + { + label: t('统一社会信用代码'), + field: 'creditCode', + component: 'Input', + }, + { + label: t('所在省份'), + field: 'province', + component: 'Input', + }, + { + label: t('公司电话'), + field: 'contactPhone', + component: 'Input', + }, + { + label: t('数据状态'), + field: 'ustatus', + component: 'Select', + componentProps: { + dictType: '', + allowClear: true, + }, + }, + ], +}; + +const tableColumns: BasicColumn[] = [ + { + title: t('记录时间'), + dataIndex: 'createTime', + key: 'a.create_time', + sorter: true, + width: 230, + align: 'left', + slot: 'firstColumn', + }, + { + title: t('公司全称'), + dataIndex: 'companyName', + key: 'a.company_name', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('公司简称'), + dataIndex: 'shortName', + key: 'a.short_name', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('统一社会信用代码'), + dataIndex: 'creditCode', + key: 'a.credit_code', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('法人姓名'), + dataIndex: 'legalPerson', + key: 'a.legal_person', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('注册资本'), + dataIndex: 'registeredCapital', + key: 'a.registered_capital', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('成立日期'), + dataIndex: 'establishDate', + key: 'a.establish_date', + sorter: true, + width: 130, + align: 'center', + }, + { + title: t('所在省份'), + dataIndex: 'province', + key: 'a.province', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('所在城市'), + dataIndex: 'city', + key: 'a.city', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('注册地址'), + dataIndex: 'address', + key: 'a.address', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('经营范围'), + dataIndex: 'businessScope', + key: 'a.business_scope', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('公司电话'), + dataIndex: 'contactPhone', + key: 'a.contact_phone', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('公司邮箱'), + dataIndex: 'contactEmail', + key: 'a.contact_email', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('数据状态'), + dataIndex: 'ustatus', + key: 'a.ustatus', + sorter: true, + width: 130, + align: 'left', + dictType: '', + }, + { + title: t('更新时间'), + dataIndex: 'updateTime', + key: 'a.update_time', + sorter: true, + width: 130, + align: 'center', + }, +]; + +const tableProps: BasicTableProps = { + api: myCompanyListData, + beforeFetch: (params) => { + params['isAll'] = true; + return params; + }, + columns: tableColumns, + formConfig: searchForm, + rowKey: 'companyId', +}; + +export default { + modalProps, + tableProps, + itemCode: 'companyId', + itemName: 'companyId', + isShowCode: false, +}; diff --git a/web-vue/packages/biz/views/biz/myNotes/form.vue b/web-vue/packages/biz/views/biz/myNotes/form.vue new file mode 100644 index 0000000..3662845 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myNotes/form.vue @@ -0,0 +1,166 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myNotes/list.vue b/web-vue/packages/biz/views/biz/myNotes/list.vue new file mode 100644 index 0000000..08c2d4b --- /dev/null +++ b/web-vue/packages/biz/views/biz/myNotes/list.vue @@ -0,0 +1,275 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myPerson/form.vue b/web-vue/packages/biz/views/biz/myPerson/form.vue new file mode 100644 index 0000000..c04dd20 --- /dev/null +++ b/web-vue/packages/biz/views/biz/myPerson/form.vue @@ -0,0 +1,187 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myPerson/list.vue b/web-vue/packages/biz/views/biz/myPerson/list.vue new file mode 100644 index 0000000..739c29b --- /dev/null +++ b/web-vue/packages/biz/views/biz/myPerson/list.vue @@ -0,0 +1,294 @@ + + + diff --git a/web-vue/packages/biz/views/biz/myPerson/select.ts b/web-vue/packages/biz/views/biz/myPerson/select.ts new file mode 100644 index 0000000..9b173dd --- /dev/null +++ b/web-vue/packages/biz/views/biz/myPerson/select.ts @@ -0,0 +1,196 @@ +import { useI18n } from '@jeesite/core/hooks/web/useI18n'; +import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table'; +import { MyPerson, myPersonListData } from '@jeesite/biz/api/biz/myPerson'; + +const { t } = useI18n('biz.myPerson'); + +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: 'personName', + component: 'Input', + }, + { + label: t('性别'), + field: 'gender', + component: 'Input', + }, + { + label: t('身份证号'), + field: 'idCard', + component: 'Input', + }, + { + label: t('状态'), + field: 'ustatus', + component: 'Select', + componentProps: { + dictType: '', + allowClear: true, + }, + }, + { + label: t('公司编号'), + field: 'companyId', + component: 'Select', + componentProps: { + dictType: '', + allowClear: true, + }, + }, + ], +}; + +const tableColumns: BasicColumn[] = [ + { + title: t('记录时间'), + dataIndex: 'createTime', + key: 'a.create_time', + sorter: true, + width: 230, + align: 'left', + slot: 'firstColumn', + }, + { + title: t('姓名'), + dataIndex: 'personName', + key: 'a.person_name', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('性别'), + dataIndex: 'gender', + key: 'a.gender', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('身份证号'), + dataIndex: 'idCard', + key: 'a.id_card', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('手机号码'), + dataIndex: 'phone', + key: 'a.phone', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('邮箱'), + dataIndex: 'email', + key: 'a.email', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('出生日期'), + dataIndex: 'birthDate', + key: 'a.birth_date', + sorter: true, + width: 130, + align: 'center', + }, + { + title: t('居住地址'), + dataIndex: 'address', + key: 'a.address', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('所属部门'), + dataIndex: 'department', + key: 'a.department', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('职位'), + dataIndex: 'positionName', + key: 'a.position_name', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('状态'), + dataIndex: 'ustatus', + key: 'a.ustatus', + sorter: true, + width: 130, + align: 'left', + dictType: '', + }, + { + title: t('公司编号'), + dataIndex: 'companyId', + key: 'a.company_id', + sorter: true, + width: 130, + align: 'left', + dictType: '', + }, + { + title: t('更新时间'), + dataIndex: 'updateTime', + key: 'a.update_time', + sorter: true, + width: 130, + align: 'center', + }, +]; + +const tableProps: BasicTableProps = { + api: myPersonListData, + beforeFetch: (params) => { + params['isAll'] = true; + return params; + }, + columns: tableColumns, + formConfig: searchForm, + rowKey: 'personId', +}; + +export default { + modalProps, + tableProps, + itemCode: 'personId', + itemName: 'personId', + isShowCode: false, +}; diff --git a/web-vue/packages/biz/views/biz/myWebsiteStorage/list.vue b/web-vue/packages/biz/views/biz/myWebsiteStorage/list.vue index 6885fd7..03fb4c3 100644 --- a/web-vue/packages/biz/views/biz/myWebsiteStorage/list.vue +++ b/web-vue/packages/biz/views/biz/myWebsiteStorage/list.vue @@ -88,7 +88,7 @@ sorter: true, width: 150, align: 'center', - fixed: 'left', + fixed: 'left', }, { title: t('网站名称'), @@ -192,12 +192,6 @@ loading.value = false; } - const [registerImportModal, { openModal: importModal }] = useModal(); - - function handleImport() { - importModal(true, {}); - } - async function handleDelete(record: Recordable) { const params = { websiteId: record.websiteId }; const res = await myWebsiteStorageDelete(params);