Commit f5bfce65 by huluobin

# 更新

parent 9f0c9d9e
...@@ -13,5 +13,5 @@ import java.lang.annotation.*; ...@@ -13,5 +13,5 @@ import java.lang.annotation.*;
@Target(ElementType.METHOD) @Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
public @interface AuthIgnore { public @interface Auth {
} }
...@@ -73,7 +73,13 @@ public interface CostDao extends BaseMapper<CostDomain> { ...@@ -73,7 +73,13 @@ public interface CostDao extends BaseMapper<CostDomain> {
//根据费用单状态获取费用单 //根据费用单状态获取费用单
List<CostDomain> selectByStatus(Integer costStatus); List<CostDomain> selectByStatus(Integer costStatus);
//分页查询费用单 /**
* 分页查询费用单
*
* @param page
* @param req
* @return
*/
Page<CostDomain> queryPage(@Param("page") Page<Object> page, Page<CostDomain> queryPage(@Param("page") Page<Object> page,
@Param("req") CostQueryPageReq req); @Param("req") CostQueryPageReq req);
......
package com.blt.other.module.sys.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@RestController
@RequestMapping("/role")
public class RoleController {
}
package com.blt.other.module.sys.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 角色和主体权限绑定关系 前端控制器
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@RestController
@RequestMapping("/roleCostCompanyBinding")
public class RoleCostCompanyBindingController {
}
package com.blt.other.module.sys.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@RestController
@RequestMapping("/userRoleBinding")
public class UserRoleBindingController {
}
package com.blt.other.module.sys.dao;
import com.blt.other.module.sys.model.RoleCostCompanyBinding;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 角色和主体权限绑定关系 Mapper 接口
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
public interface RoleCostCompanyBindingMapper extends BaseMapper<RoleCostCompanyBinding> {
}
package com.blt.other.module.sys.dao;
import com.blt.other.module.sys.model.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
public interface RoleMapper extends BaseMapper<Role> {
}
package com.blt.other.module.sys.dao;
import com.blt.other.module.sys.model.UserRoleBinding;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
public interface UserRoleBindingMapper extends BaseMapper<UserRoleBinding> {
}
package com.blt.other.module.sys.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Role对象", description="")
public class Role implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "角色名")
private String roleName;
}
package com.blt.other.module.sys.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 角色和主体权限绑定关系
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="RoleCostCompanyBinding对象", description="角色和主体权限绑定关系")
public class RoleCostCompanyBinding implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "角色id")
private Integer roleId;
@ApiModelProperty(value = "财务主体id")
private Integer costCompanyId;
}
package com.blt.other.module.sys.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UserRoleBinding对象", description="")
public class UserRoleBinding implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "oa用户id")
private Integer oaUserId;
@ApiModelProperty(value = "角色id")
private Integer roleId;
}
package com.blt.other.module.sys.service;
import com.blt.other.module.sys.model.RoleCostCompanyBinding;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 角色和主体权限绑定关系 服务类
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
public interface IRoleCostCompanyBindingService extends IService<RoleCostCompanyBinding> {
}
package com.blt.other.module.sys.service;
import com.blt.other.module.sys.model.Role;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
public interface IRoleService extends IService<Role> {
}
package com.blt.other.module.sys.service;
import com.blt.other.module.sys.model.UserRoleBinding;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
public interface IUserRoleBindingService extends IService<UserRoleBinding> {
}
package com.blt.other.module.sys.service.impl;
import com.blt.other.module.sys.model.RoleCostCompanyBinding;
import com.blt.other.module.sys.dao.RoleCostCompanyBindingMapper;
import com.blt.other.module.sys.service.IRoleCostCompanyBindingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 角色和主体权限绑定关系 服务实现类
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@Service
public class RoleCostCompanyBindingServiceImpl extends ServiceImpl<RoleCostCompanyBindingMapper, RoleCostCompanyBinding> implements IRoleCostCompanyBindingService {
}
package com.blt.other.module.sys.service.impl;
import com.blt.other.module.sys.model.Role;
import com.blt.other.module.sys.dao.RoleMapper;
import com.blt.other.module.sys.service.IRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {
}
package com.blt.other.module.sys.service.impl;
import com.blt.other.module.sys.model.UserRoleBinding;
import com.blt.other.module.sys.dao.UserRoleBindingMapper;
import com.blt.other.module.sys.service.IUserRoleBindingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author robbendev
* @since 2021-03-10
*/
@Service
public class UserRoleBindingServiceImpl extends ServiceImpl<UserRoleBindingMapper, UserRoleBinding> implements IUserRoleBindingService {
}
...@@ -282,22 +282,28 @@ ...@@ -282,22 +282,28 @@
group_concat(distinct t2.username) as cost_current_reviewer group_concat(distinct t2.username) as cost_current_reviewer
from cost t1 from cost t1
left join cost_current_reviewer t2 on t1.cost_no = t2.cost_no left join cost_current_reviewer t2 on t1.cost_no = t2.cost_no
WHERE <if test=" req.createUserid!=null ">
left join (select t3.oa_user_id, cc.company_no from bailun_other.oa_user t3
left join user_role_binding urb on t3.oa_user_id = urb.oa_user_id
left join role_cost_company_binding rccb on urb.role_id = rccb.role_id
left join cost_company cc on rccb.cost_company_id = cc.id
group t3.oa_user_id,t3.company_id) t on t1.create_userid = t.oa_user_id and t1.company_no = t.company_no
</if>
where
true true
<if test=" req.typeName!=null and req.typeName != ''">and t1.type_name= #{req.typeName}</if> <if test=" req.typeName!=null and req.typeName != ''">and t1.type_name= #{req.typeName}</if>
<if test=" req.costForm!=null and req.costForm != ''">and t1.cost_form= #{req.costForm}</if> <if test=" req.costForm!=null and req.costForm != ''">and t1.cost_form= #{req.costForm}</if>
<if test=" req.isLend!=null and req.isLend != ''">and t1.is_lend=#{req.isLend}</if> <if test=" req.isLend!=null and req.isLend != ''">and t1.is_lend=#{req.isLend}</if>
<if test=" req.companyNo!=null and req.companyNo != ''">and t1.company_no=#{req.companyNo}</if> <if test=" req.companyNo!=null and req.companyNo != ''">and t1.company_no=#{req.companyNo}</if>
<if test=" req.createUserid!=null ">and t1.create_userid=#{req.createUserid}</if> <if test=" req.createUserid!=null ">and (t1.create_userid=#{req.createUserid} or t.company_no is not null)</if>
<if test=" req.currentUserId!=null ">and t1.create_userid=#{req.currentUserId}</if>
<if test=" req.costStatus!=null ">and find_in_set(t1.cost_status,#{req.costStatus})</if> <if test=" req.costStatus!=null ">and find_in_set(t1.cost_status,#{req.costStatus})</if>
<if test=" req.lendStatus!=null ">and t1.lend_status=#{req.lendStatus}</if> <if test=" req.lendStatus!=null ">and t1.lend_status=#{req.lendStatus}</if>
<if test=" req.isTax!=null ">and t1.is_tax=#{req.isTax}</if> <if test=" req.isTax!=null ">and t1.is_tax=#{req.isTax}</if>
<if test=" req.isLend!=null ">and t1.is_lend=#{req.isLend}</if> <if test=" req.isLend!=null ">and t1.is_lend=#{req.isLend}</if>
<if test=" req.beginTime != null">AND t1.create_time <![CDATA[>=]]> #{req.beginTime}</if> <if test=" req.beginTime != null">and t1.create_time <![CDATA[>=]]> #{req.beginTime}</if>
<if test=" req.endTime != null">AND t1.create_time <![CDATA[<=]]>#{req.endTime}</if> <if test=" req.endTime != null">and t1.create_time <![CDATA[<=]]>#{req.endTime}</if>
<if test=" req.beginPayTime != null">AND t1.pay_time <![CDATA[>=]]> #{req.beginPayTime}</if> <if test=" req.beginPayTime != null">and t1.pay_time <![CDATA[>=]]> #{req.beginPayTime}</if>
<if test=" req.endPayTime != null">AND t1.pay_time <![CDATA[<=]]>#{req.endPayTime}</if> <if test=" req.endPayTime != null">and t1.pay_time <![CDATA[<=]]>#{req.endPayTime}</if>
<if test=" req.linkCost!=null and req.linkCost != ''">and (t1.sup_cost_no=#{req.linkCost} or t1.cost_no=#{req.linkCost})</if> <if test=" req.linkCost!=null and req.linkCost != ''">and (t1.sup_cost_no=#{req.linkCost} or t1.cost_no=#{req.linkCost})</if>
<if test=" req.projectTypes!=null and req.projectTypes != ''">and find_in_set(t1.project_type,#{req.projectTypes})</if> <if test=" req.projectTypes!=null and req.projectTypes != ''">and find_in_set(t1.project_type,#{req.projectTypes})</if>
<if test="req.bankCardUser !=null and req.bankCardUser !='' ">and t1.bank_card_user like concat('%',#{req.bankCardUser},'%')</if> <if test="req.bankCardUser !=null and req.bankCardUser !='' ">and t1.bank_card_user like concat('%',#{req.bankCardUser},'%')</if>
...@@ -307,22 +313,22 @@ ...@@ -307,22 +313,22 @@
<if test="key != null and key != '' ">or t1.cost_plan_no = #{key}</if> <if test="key != null and key != '' ">or t1.cost_plan_no = #{key}</if>
</foreach> </foreach>
<foreach collection="req.keys" item="key" index="index"> <foreach collection="req.keys" item="key" index="index">
<if test="key != null and key != '' ">or t1.cost_no LIKE CONCAT('%',#{key},'%')</if> <if test="key != null and key != '' ">or t1.cost_no like concat('%',#{key},'%')</if>
</foreach> </foreach>
<foreach collection="req.keys" item="key" index="index"> <foreach collection="req.keys" item="key" index="index">
<if test="key != null and key != '' ">or t1.type_name LIKE CONCAT('%',#{key},'%')</if> <if test="key != null and key != '' ">or t1.type_name like concat('%',#{key},'%')</if>
</foreach> </foreach>
<foreach collection="req.keys" item="key" index="index"> <foreach collection="req.keys" item="key" index="index">
<if test="key != null and key != '' ">or t1.company_name LIKE CONCAT('%',#{key},'%')</if> <if test="key != null and key != '' ">or t1.company_name like concat('%',#{key},'%')</if>
</foreach> </foreach>
<foreach collection="req.keys" item="key" index="index"> <foreach collection="req.keys" item="key" index="index">
<if test="key != null and key != '' ">or t1.bank_card_user LIKE CONCAT('%',#{key},'%')</if> <if test="key != null and key != '' ">or t1.bank_card_user like concat('%',#{key},'%')</if>
</foreach> </foreach>
) )
</if> </if>
group by t1.id group by t1.id
ORDER BY order BY
t1.id DESC t1.id desc
</select> </select>
<select id="manageCostList" resultType="com.blt.other.module.cost.model.CostDomain"> <select id="manageCostList" resultType="com.blt.other.module.cost.model.CostDomain">
...@@ -339,7 +345,8 @@ ...@@ -339,7 +345,8 @@
from cost t1 from cost t1
left join oa_user t2 on t1.create_userid = t2.oa_user_id left join oa_user t2 on t1.create_userid = t2.oa_user_id
left join oa_department od on t2.department_id = od.department_id left join oa_department od on t2.department_id = od.department_id
where t1.last_modify_date &gt;= #{startDate} and t1.last_modify_date &lt;= #{endDate} where t1.last_modify_date &gt;= #{startDate}
and t1.last_modify_date &lt;= #{endDate}
</select> </select>
</mapper> </mapper>
<?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="com.blt.other.module.sys.dao.RoleCostCompanyBindingMapper">
</mapper>
<?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="com.blt.other.module.sys.dao.RoleMapper">
</mapper>
<?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="com.blt.other.module.sys.dao.UserRoleBindingMapper">
</mapper>
...@@ -41,7 +41,7 @@ public class CodeGenerator { ...@@ -41,7 +41,7 @@ public class CodeGenerator {
// 全局配置 // 全局配置
GlobalConfig gc = new GlobalConfig(); GlobalConfig gc = new GlobalConfig();
String projectPath = System.getProperty("user.dir"); String projectPath = "/Users/huluobin/IdeaProjects/bailuntec-cost/cost-service";
gc.setOutputDir(projectPath + "/src/main/java"); gc.setOutputDir(projectPath + "/src/main/java");
gc.setAuthor("robbendev"); gc.setAuthor("robbendev");
gc.setOpen(false); gc.setOpen(false);
...@@ -54,18 +54,18 @@ public class CodeGenerator { ...@@ -54,18 +54,18 @@ public class CodeGenerator {
// 数据源配置 // 数据源配置
DataSourceConfig dsc = new DataSourceConfig(); DataSourceConfig dsc = new DataSourceConfig();
// dsc.setUrl("jdbc:mysql://106.55.55.253:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&useSSL=false&&zeroDateTimeBehavior=convertToNull"); // dsc.setUrl("jdbc:mysql://106.55.55.253:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&useSSL=false&&zeroDateTimeBehavior=convertToNull");
dsc.setUrl("jdbc:mysql://cdb-aanqm573.gz.tencentcdb.com:10120/bailun_other?useUnicode=true&characterEncoding=utf-8&useSSL=false&&zeroDateTimeBehavior=convertToNull"); dsc.setUrl("jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true");
// dsc.setSchemaName("public"); // dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.jdbc.Driver"); dsc.setDriverName("com.mysql.jdbc.Driver");
dsc.setUsername("root"); dsc.setUsername("root");
dsc.setPassword("Aarob2020#"); dsc.setPassword("#7kfnymAM$Y9-Ntf");
mpg.setDataSource(dsc); mpg.setDataSource(dsc);
// 包配置 // 包配置
PackageConfig pc = new PackageConfig(); PackageConfig pc = new PackageConfig();
String s = scanner("模块名"); String s = scanner("模块名");
String ss = "." + s; String ss = "." + s;
pc.setParent("com.blt.other" + ss); pc.setParent("com.blt.other.module" + ss);
pc.setEntity("model"); pc.setEntity("model");
pc.setService("service"); pc.setService("service");
pc.setServiceImpl("service" + ".impl"); pc.setServiceImpl("service" + ".impl");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment