master
parent
53a13352cd
commit
1d913c9a4f
@ -1,89 +0,0 @@
|
||||
package cn.xluobo.business.sc.base.controller;
|
||||
|
||||
import cn.xluobo.business.sc.base.domain.req.ReqSchoolSelect;
|
||||
import cn.xluobo.business.sc.base.domain.req.ReqSearchScSchool;
|
||||
import cn.xluobo.business.sc.base.repo.model.ScSchool;
|
||||
import cn.xluobo.business.sc.base.service.BusinessScSchoolService;
|
||||
import cn.xluobo.core.api.APIResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 学校信息 Controller
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-04-27 07:13:36
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/sc/school")
|
||||
public class ScSchoolController {
|
||||
@Autowired
|
||||
private BusinessScSchoolService scSchoolService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param reqSearchScSchool
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list/searchList")
|
||||
public APIResponse searchList(ReqSearchScSchool reqSearchScSchool) {
|
||||
return scSchoolService.searchList(reqSearchScSchool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端select
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list/select")
|
||||
public APIResponse select(ReqSchoolSelect schoolSelect) {
|
||||
return scSchoolService.select(schoolSelect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param schoolId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/info/detailById/{schoolId}")
|
||||
public APIResponse detailById(@PathVariable("schoolId") Long schoolId) {
|
||||
return scSchoolService.detailById(schoolId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param scSchool
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/add/addScSchool")
|
||||
public APIResponse addScSchool(@RequestBody ScSchool scSchool) {
|
||||
return scSchoolService.addScSchool(scSchool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param scSchool
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/update/updateScSchool")
|
||||
public APIResponse updateScSchool(@RequestBody ScSchool scSchool) {
|
||||
return scSchoolService.updateScSchool(scSchool);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param schoolIds
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/delete/deleteById/{schoolIds}")
|
||||
public APIResponse deleteById(@PathVariable("schoolIds") Long[] schoolIds) {
|
||||
return scSchoolService.deleteById(schoolIds);
|
||||
}
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
package cn.xluobo.business.sc.base.repo.mapper;
|
||||
|
||||
import cn.xluobo.business.sc.base.domain.req.ReqSchoolSelect;
|
||||
import cn.xluobo.business.sc.base.domain.resp.RespSchoolSelect;
|
||||
import cn.xluobo.business.sc.base.repo.model.ScSchool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 学校信息 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-04-27 07:13:36
|
||||
*/
|
||||
public interface ScSchoolMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<ScSchool> {
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param schoolSelect
|
||||
* @return
|
||||
*/
|
||||
List<RespSchoolSelect> selectForSelect(ReqSchoolSelect schoolSelect);
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.xluobo.business.sc.base.repo.mapper.ScSchoolMapper">
|
||||
|
||||
<select id="selectForSelect" resultType="cn.xluobo.business.sc.base.domain.resp.RespSchoolSelect">
|
||||
select school_id,school_name,province_code,city_code,
|
||||
fcn_dict_name(province_code,'province_code') as province_name,
|
||||
fcn_dict_name(city_code,'city_code') as city_name
|
||||
from sc_school
|
||||
where 1=1
|
||||
<if test="search != null and search != ''">
|
||||
and school_name like concat('%',#{search} ,'%')
|
||||
</if>
|
||||
<if test="schoolId != null and schoolId != ''">
|
||||
and school_id = #{schoolId}
|
||||
</if>
|
||||
limit 0,#{maxRecord}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -1,79 +0,0 @@
|
||||
package cn.xluobo.business.sc.base.repo.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 学校信息
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-04-27 07:13:36
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sc_school")
|
||||
public class ScSchool implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 学校id
|
||||
*/
|
||||
@TableId(value = "school_id", type = IdType.AUTO)
|
||||
private Long schoolId;
|
||||
|
||||
/**
|
||||
* 所属租户
|
||||
*/
|
||||
@TableField("tenant_id")
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 省份编码
|
||||
*/
|
||||
@TableField("province_code")
|
||||
private String provinceCode;
|
||||
|
||||
/**
|
||||
* 区号 如0431
|
||||
*/
|
||||
@TableField("city_code")
|
||||
private String cityCode;
|
||||
|
||||
@TableField("school_name")
|
||||
private String schoolName;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField("create_user")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_time")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField("last_update_user")
|
||||
private Long lastUpdateUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("last_update_time")
|
||||
private Date lastUpdateTime;
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package cn.xluobo.business.sc.base.service;
|
||||
|
||||
import cn.xluobo.business.sc.base.domain.req.ReqSchoolSelect;
|
||||
import cn.xluobo.business.sc.base.domain.resp.RespSchoolSelect;
|
||||
import cn.xluobo.business.sc.base.repo.model.ScSchool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 学校信息 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-04-27 07:13:36
|
||||
*/
|
||||
public interface IScSchoolService extends com.baomidou.mybatisplus.extension.service.IService<ScSchool> {
|
||||
|
||||
/**
|
||||
* 学校select
|
||||
*
|
||||
* @param schoolSelect
|
||||
* @return
|
||||
*/
|
||||
List<RespSchoolSelect> selectSchoolSelect(ReqSchoolSelect schoolSelect);
|
||||
|
||||
/**
|
||||
* 根据名称获取学校,如果不存在自动保存
|
||||
*
|
||||
* @param schoolName
|
||||
* @return
|
||||
*/
|
||||
Long getSchoolId(String schoolName);
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package cn.xluobo.business.sc.base.service.impl;
|
||||
|
||||
import cn.xluobo.business.sc.base.domain.req.ReqSchoolSelect;
|
||||
import cn.xluobo.business.sc.base.domain.resp.RespSchoolSelect;
|
||||
import cn.xluobo.business.sc.base.repo.mapper.ScSchoolMapper;
|
||||
import cn.xluobo.business.sc.base.repo.model.ScSchool;
|
||||
import cn.xluobo.business.sc.base.service.IScSchoolService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 学校信息 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-04-27 07:13:36
|
||||
*/
|
||||
@Service
|
||||
public class ScSchoolServiceImpl extends ServiceImpl<ScSchoolMapper, ScSchool> implements IScSchoolService {
|
||||
|
||||
@Override
|
||||
public List<RespSchoolSelect> selectSchoolSelect(ReqSchoolSelect schoolSelect) {
|
||||
return baseMapper.selectForSelect(schoolSelect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getSchoolId(String schoolName) {
|
||||
if(StringUtils.isNotEmpty(schoolName)) {
|
||||
QueryWrapper<ScSchool> qw = new QueryWrapper<>();
|
||||
qw.eq("school_name", schoolName);
|
||||
List<ScSchool> list = this.list(qw);
|
||||
if(null != list && list.size() >0 ){
|
||||
return list.get(0).getSchoolId();
|
||||
} else {
|
||||
ScSchool scSchool = new ScSchool();
|
||||
scSchool.setSchoolName(schoolName);
|
||||
this.save(scSchool);
|
||||
return scSchool.getSchoolId();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
package cn.xluobo.business.sys.admin.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_user_dept")
|
||||
public class SysUserDept {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "user_id", type = IdType.ASSIGN_ID)
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 校区id
|
||||
*/
|
||||
@TableField("dept_id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 租户
|
||||
*/
|
||||
@TableField("tenant_id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package cn.xluobo.business.sys.admin.repo.mapper;
|
||||
|
||||
import cn.xluobo.business.sys.admin.model.SysUserDept;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户拥有的校区权限 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-08-07
|
||||
*/
|
||||
public interface ISysUserDeptMapper extends BaseMapper<SysUserDept> {
|
||||
|
||||
}
|
||||
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.xluobo.business.sys.admin.repo.mapper.ISysUserDeptMapper">
|
||||
|
||||
</mapper>
|
||||
@ -1,16 +0,0 @@
|
||||
package cn.xluobo.business.sys.admin.service;
|
||||
|
||||
import cn.xluobo.business.sys.admin.model.SysUserDept;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户拥有的校区权限 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-08-07
|
||||
*/
|
||||
public interface ISysUserDeptService extends IService<SysUserDept> {
|
||||
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package cn.xluobo.business.sys.admin.service.impl;
|
||||
|
||||
import cn.xluobo.business.sys.admin.model.SysUserDept;
|
||||
import cn.xluobo.business.sys.admin.repo.mapper.ISysUserDeptMapper;
|
||||
import cn.xluobo.business.sys.admin.service.ISysUserDeptService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户拥有的校区权限 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-08-07
|
||||
*/
|
||||
@Service
|
||||
public class ISysUserDeptServiceImpl extends ServiceImpl<ISysUserDeptMapper, SysUserDept> implements ISysUserDeptService {
|
||||
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
package cn.xluobo.business.sys.staff.repo.mapper;
|
||||
|
||||
import cn.xluobo.business.sys.staff.domain.req.ReqSearchStaff;
|
||||
import cn.xluobo.business.sys.staff.domain.resp.RespStaffInfo;
|
||||
import cn.xluobo.business.sys.staff.repo.model.SysStaff;
|
||||
import cn.xluobo.core.page.RespPage;
|
||||
import com.baomidou.mybatisplus.annotation.SqlParser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 教师信息 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-03-17 11:27:37
|
||||
*/
|
||||
public interface SysStaffMapper extends BaseMapper<SysStaff> {
|
||||
|
||||
/**
|
||||
* 查询员工列表
|
||||
* @param reqSearchStaff
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
List<RespStaffInfo> selectStaffList(@Param("reqSearchStaff") ReqSearchStaff reqSearchStaff, @Param("page") RespPage page);
|
||||
|
||||
/**
|
||||
* 租户下员工数量
|
||||
* @param tenantId
|
||||
* @return
|
||||
*/
|
||||
@SqlParser(filter = true)
|
||||
Integer selectTenantStaffCount(String tenantId);
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.xluobo.business.sys.staff.repo.mapper.SysStaffMapper">
|
||||
|
||||
<select id="selectStaffList" resultType="cn.xluobo.business.sys.staff.domain.resp.RespStaffInfo">
|
||||
select a.*,b.username,b.locked,fcn_dict_name(a.personnel_status,'personnel_status') personnel_status_name,
|
||||
d.dept_name
|
||||
from sys_staff a
|
||||
left join sys_user b on a.user_id=b.user_id
|
||||
left join sys_dept d on a.dept_id=d.dept_id
|
||||
where a.delete_flag='0'
|
||||
<if test="reqSearchStaff.staffName != null and reqSearchStaff.staffName != ''">
|
||||
and a.staff_name like concat('%',#{reqSearchStaff.staffName},'%')
|
||||
</if>
|
||||
<if test="reqSearchStaff.personnelStatus != null and reqSearchStaff.personnelStatus != ''">
|
||||
and a.personnel_status = #{reqSearchStaff.personnelStatus,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="reqSearchStaff.teacher != null">
|
||||
and a.teacher = #{reqSearchStaff.teacher}
|
||||
</if>
|
||||
<if test="reqSearchStaff.sex != null and reqSearchStaff.sex != ''">
|
||||
and a.sex = #{reqSearchStaff.sex}
|
||||
</if>
|
||||
<if test="reqSearchStaff.deptId != null">
|
||||
and (a.dept_id=#{reqSearchStaff.deptId} or a.dept_id in (select dept_id from sys_dept dd where find_in_set(#{reqSearchStaff.deptId} ,dd.ancestors)))
|
||||
</if>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
<select id="selectTenantStaffCount" resultType="java.lang.Integer">
|
||||
select count(1) from sys_staff where tenant_id=#{tenantId} and delete_flag='0'
|
||||
</select>
|
||||
</mapper>
|
||||
@ -1,46 +0,0 @@
|
||||
package cn.xluobo.business.sys.staff.service;
|
||||
|
||||
import cn.xluobo.business.sys.staff.domain.req.ReqSearchStaff;
|
||||
import cn.xluobo.business.sys.staff.domain.resp.RespStaffInfo;
|
||||
import cn.xluobo.business.sys.staff.repo.model.SysStaff;
|
||||
import cn.xluobo.core.page.RespPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 教师信息 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-03-17 11:27:37
|
||||
*/
|
||||
public interface ISysStaffService extends IService<SysStaff> {
|
||||
|
||||
List<RespStaffInfo> searchStaffList(ReqSearchStaff reqSearchStaff, RespPage page);
|
||||
|
||||
/**
|
||||
* 教师列表
|
||||
* @param teacherName
|
||||
* @return
|
||||
*/
|
||||
List<SysStaff> teacherList(String teacherName);
|
||||
|
||||
/**
|
||||
* 员工列表
|
||||
* @param staffName
|
||||
* @return
|
||||
*/
|
||||
List<SysStaff> staffList(String staffName);
|
||||
|
||||
/**
|
||||
* 获取关联用户id
|
||||
* @param staffIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> getUserIds(List<Long> staffIds);
|
||||
|
||||
// 根据用户获取
|
||||
Long getStaffIdByUserId(Long userId);
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
package cn.xluobo.business.sys.staff.service.impl;
|
||||
|
||||
import cn.xluobo.business.sys.staff.domain.req.ReqSearchStaff;
|
||||
import cn.xluobo.business.sys.staff.domain.resp.RespStaffInfo;
|
||||
import cn.xluobo.business.sys.staff.repo.mapper.SysStaffMapper;
|
||||
import cn.xluobo.business.sys.staff.repo.model.SysStaff;
|
||||
import cn.xluobo.business.sys.staff.service.ISysStaffService;
|
||||
import cn.xluobo.core.page.RespPage;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 教师信息 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-03-17 11:27:37
|
||||
*/
|
||||
@Service
|
||||
public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> implements ISysStaffService {
|
||||
|
||||
@Override
|
||||
public List<RespStaffInfo> searchStaffList(ReqSearchStaff reqSearchStaff, RespPage page) {
|
||||
return baseMapper.selectStaffList(reqSearchStaff, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysStaff> teacherList(String teacherName) {
|
||||
QueryWrapper<SysStaff> qw = new QueryWrapper<>();
|
||||
qw.select("staff_name", "staff_id");
|
||||
qw.eq("teacher", "1");
|
||||
if (StringUtils.isNotEmpty(teacherName)) {
|
||||
qw.like("staff_name", teacherName);
|
||||
}
|
||||
qw.orderByAsc("staff_name");
|
||||
return this.list(qw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysStaff> staffList(String staffName) {
|
||||
QueryWrapper<SysStaff> qw = new QueryWrapper<>();
|
||||
qw.select("staff_name", "staff_id");
|
||||
if (StringUtils.isNotEmpty(staffName)) {
|
||||
qw.like("staff_name", staffName);
|
||||
}
|
||||
qw.orderByAsc("staff_name");
|
||||
return this.list(qw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getUserIds(List<Long> staffIds) {
|
||||
QueryWrapper<SysStaff> qw = new QueryWrapper<>();
|
||||
qw.select("user_id");
|
||||
qw.in("staff_id", staffIds);
|
||||
qw.isNotNull("user_id");
|
||||
List<SysStaff> staffList = this.list(qw);
|
||||
List<Long> userIds = staffList.stream().map(SysStaff::getUserId).collect(Collectors.toList());
|
||||
return userIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getStaffIdByUserId(Long userId) {
|
||||
QueryWrapper<SysStaff> qw = new QueryWrapper<>();
|
||||
qw.eq("user_id", userId);
|
||||
SysStaff sysStaff = this.getOne(qw);
|
||||
if (null != sysStaff) {
|
||||
return sysStaff.getStaffId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
package com.ruoyi.web.controller.mall;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mall.domain.Express;
|
||||
import com.ruoyi.mall.service.ExpressService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递管理Controller
|
||||
*/
|
||||
@Api(description ="快递管理接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/pms/express")
|
||||
public class ExpressController extends BaseController {
|
||||
@Autowired
|
||||
private ExpressService service;
|
||||
|
||||
@ApiOperation("查询快递管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<Express>> list(@RequestBody Express query, Pageable page) {
|
||||
List<Express> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
@ApiOperation("所有快递管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:list')")
|
||||
@PostMapping("/all")
|
||||
public ResponseEntity<List<Express>> all(@RequestBody Express query) {
|
||||
return ResponseEntity.ok(service.selectList(query, null));
|
||||
}
|
||||
|
||||
@ApiOperation("导出快递管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:export')")
|
||||
@Log(title = "快递管理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(Express query) {
|
||||
// List<Express> list = service.selectList(query, null);
|
||||
// ExcelUtil<ExpressVO> util = new ExcelUtil<>(ExpressVO.class);
|
||||
// return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "快递管理数据"));
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation("获取快递管理详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<Express> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增快递管理")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:add')")
|
||||
@Log(title = "快递管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody Express Express) {
|
||||
return ResponseEntity.ok(service.insert(Express));
|
||||
}
|
||||
|
||||
@ApiOperation("修改快递管理")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:edit')")
|
||||
@Log(title = "快递管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody Express Express) {
|
||||
return ResponseEntity.ok(service.update(Express));
|
||||
}
|
||||
|
||||
@ApiOperation("删除快递管理")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:remove')")
|
||||
@Log(title = "快递管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
}
|
||||
}
|
||||
@ -1,70 +0,0 @@
|
||||
package com.ruoyi.generator;
|
||||
|
||||
import com.ruoyi.generator.domain.GenTable;
|
||||
import com.ruoyi.generator.service.IGenTableService;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = SpringAppTest.class)
|
||||
@ActiveProfiles("local")
|
||||
public class ApplicationTest {
|
||||
@Autowired
|
||||
@Qualifier("genTableServiceImpl")
|
||||
private IGenTableService genTableService;
|
||||
|
||||
@Test
|
||||
public void test2() {
|
||||
List<String> tableNames = Arrays.asList(
|
||||
// "pms_brand",
|
||||
// "pms_product_category" ,
|
||||
// "pms_product",
|
||||
// "pms_sku"
|
||||
// "ums_member",
|
||||
// "ums_member_address",
|
||||
// "ums_member_wechat",
|
||||
// "ums_member_cart"
|
||||
// "oms_order",
|
||||
// "oms_order_delivery_history",
|
||||
// "oms_order_item",
|
||||
// "oms_order_operate_history",
|
||||
// "oms_aftersale",
|
||||
// "oms_aftersale_item"
|
||||
"act_coupon_activity",
|
||||
"act_member_coupon"
|
||||
);
|
||||
// 查询表信息
|
||||
List<GenTable> tableList = genTableService.selectGenTableByName(tableNames);
|
||||
List<GenTable> notExist = new ArrayList<>();
|
||||
try {
|
||||
tableList.forEach(it -> {
|
||||
if (it.getTableId() == null) {
|
||||
it.setAudit(1);
|
||||
notExist.add(it);
|
||||
}
|
||||
});
|
||||
if (notExist.size() > 0) {
|
||||
genTableService.importGenTable(notExist, -1L);
|
||||
}
|
||||
for (String tableName : tableNames) {
|
||||
genTableService.generatorCode(tableName);
|
||||
}
|
||||
} finally {
|
||||
// 删除生成
|
||||
if (notExist.size() > 0) {
|
||||
Long[] ids = notExist.stream().map(GenTable::getTableId).toArray(Long[]::new);
|
||||
genTableService.deleteGenTableByIds(ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package com.ruoyi.generator;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class CommonTest {
|
||||
@Test
|
||||
public void testPath() {
|
||||
System.out.println(System.getProperty("user.dir"));
|
||||
System.out.println(FileUtil.getParent(System.getProperty("user.dir"), 1) + File.separator);
|
||||
}
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
package com.ruoyi.generator;
|
||||
|
||||
import com.ruoyi.generator.domain.GenTable;
|
||||
import com.ruoyi.generator.mapper.GenTableColumnMapper;
|
||||
import com.ruoyi.generator.mapper.GenTableMapper;
|
||||
import com.ruoyi.generator.service.GenTableServiceImpl;
|
||||
import com.ruoyi.generator.service.IGenTableService;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mockito;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.TestConfiguration;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
public class SingleComponentTest {
|
||||
@TestConfiguration
|
||||
static class EmployeeServiceImplTestContextConfiguration {
|
||||
@Bean
|
||||
public IGenTableService employeeService() {
|
||||
return new GenTableServiceImpl();
|
||||
}
|
||||
}
|
||||
|
||||
@MockBean
|
||||
private GenTableMapper genTableMapper;
|
||||
@MockBean
|
||||
private GenTableColumnMapper genTableColumnMapper;
|
||||
|
||||
@Autowired
|
||||
private IGenTableService genTableService;
|
||||
|
||||
private String tableName = "sys_dept";
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
GenTable table = new GenTable();
|
||||
table.setTableName(tableName);
|
||||
Mockito.when(genTableMapper.selectGenTableByName(tableName))
|
||||
.thenReturn(table);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test1() {
|
||||
genTableService.generatorCode(tableName);
|
||||
}
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package com.ruoyi.generator;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication(
|
||||
scanBasePackages = {"com.ruoyi.generator"}
|
||||
)
|
||||
@MapperScan("com.ruoyi.generator.mapper")
|
||||
public class SpringAppTest {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringAppTest.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙");
|
||||
}
|
||||
}
|
||||
@ -1,95 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.7.0</version>
|
||||
</parent>
|
||||
<artifactId>ruoyi-mall</artifactId>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-java</artifactId>
|
||||
<version>0.2.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>${mybatis.plus.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15to18</artifactId>
|
||||
<version>1.64</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@ -1,25 +0,0 @@
|
||||
package com.cyl.config;
|
||||
|
||||
import com.cyl.wechat.WechatPayConfig;
|
||||
import com.wechat.pay.java.service.payments.jsapi.JsapiService;
|
||||
import com.wechat.pay.java.service.refund.RefundService;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.DependsOn;
|
||||
|
||||
@Configuration
|
||||
@DependsOn("WechatPayData")
|
||||
@ConditionalOnProperty(prefix = "wechat", name = "enabled", havingValue = "true")
|
||||
public class WechatConfig {
|
||||
|
||||
@Bean
|
||||
public JsapiService jsapiService(){
|
||||
return new JsapiService.Builder().config(WechatPayConfig.getInstance()).build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RefundService refundService(){
|
||||
return new RefundService.Builder().config(WechatPayConfig.getInstance()).build();
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
package com.cyl.external;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ExternalException extends RuntimeException {
|
||||
private String code;
|
||||
|
||||
public ExternalException(String code, String message) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue