| | |
| | | .authorizeHttpRequests((requests) -> {
|
| | | permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
|
| | | // 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
| | | requests.antMatchers("/login", "/register", "/captchaImage","/loginCheck","/userDeptList/**","/loginCheckFactory").permitAll()
|
| | | requests.antMatchers("/login", "/register", "/captchaImage","/loginCheck","/userLoginFacotryList/**","/loginCheckFactory").permitAll()
|
| | | // 静态资源,可匿名访问
|
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
| | | .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
| | |
| | | import java.util.List;
|
| | | import java.util.Set;
|
| | |
|
| | | import com.ruoyi.project.system.domain.SysDept;
|
| | | import com.ruoyi.project.system.domain.vo.SysUserDeptVo;
|
| | | import com.ruoyi.project.system.mapper.SysDeptMapper;
|
| | | import com.ruoyi.project.system.service.ISysUserDeptService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.util.ObjectUtils;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | |
| | | @Autowired
|
| | | private ISysUserDeptService userDeptService;
|
| | |
|
| | | @Autowired
|
| | | private SysDeptMapper sysDeptMapper;
|
| | |
|
| | | /**
|
| | | * 登录方法
|
| | | *
|
| | |
| | | {
|
| | | LoginUser loginUser = SecurityUtils.getLoginUser();
|
| | | SysUser user = loginUser.getUser();
|
| | | // 获取当前登录公司
|
| | | Integer tenantId = loginUser.getTenantId();
|
| | | if(null != tenantId){
|
| | | user.setTenantId(tenantId);
|
| | | SysDept sysDept = sysDeptMapper.selectDeptById(tenantId.longValue());
|
| | | if(!ObjectUtils.isEmpty(sysDept)){
|
| | | user.setCurrentFactoryName(sysDept.getDeptName());
|
| | | }
|
| | | }
|
| | | // 角色集合
|
| | | Set<String> roles = permissionService.getRolePermission(user);
|
| | | // 权限集合
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @GetMapping("/userDeptList")
|
| | | public AjaxResult userDeptList(SysUserDeptVo sysUserDeptVo){
|
| | | return AjaxResult.success(userDeptService.selectUserDeptList(sysUserDeptVo));
|
| | | @GetMapping("/userLoginFacotryList")
|
| | | public AjaxResult userLoginFacotryList(SysUserDeptVo sysUserDeptVo){
|
| | | return AjaxResult.success(userDeptService.userLoginFacotryList(sysUserDeptVo));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | ajax.put("posts", postService.selectPostAll());
|
| | | SysUserDeptVo sysUserDeptVo = new SysUserDeptVo();
|
| | | sysUserDeptVo.setUserId(userId);
|
| | | List<SysUserDeptVo> sysUserDeptVos = userDeptService.selectUserDeptList(sysUserDeptVo);
|
| | | List<SysUserDeptVo> sysUserDeptVos = userDeptService.userLoginFacotryList(sysUserDeptVo);
|
| | | ajax.put("deptIds",sysUserDeptVos.stream().map(SysUserDeptVo::getDeptId).collect(Collectors.toList()));
|
| | | return ajax;
|
| | | }
|
| | |
| | |
|
| | | private Long currentDeptId;
|
| | |
|
| | | /** 当前登录公司 */
|
| | | private String currentFactoryName;
|
| | |
|
| | | public String getCurrentFactoryName() {
|
| | | return currentFactoryName;
|
| | | }
|
| | |
|
| | | public void setCurrentFactoryName(String currentFactoryName) {
|
| | | this.currentFactoryName = currentFactoryName;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 部门名称
|
| | | */
|
| | |
| | | @Mapper |
| | | public interface SysUserDeptMapper extends BaseMapper<SysUserDept> { |
| | | |
| | | List<SysUserDeptVo> selectUserDeptList(@Param("userDeptVo") SysUserDeptVo userDeptVo); |
| | | List<SysUserDeptVo> userLoginFacotryList(@Param("userDeptVo") SysUserDeptVo userDeptVo); |
| | | } |
| | |
| | | |
| | | public interface ISysUserDeptService { |
| | | |
| | | List<SysUserDeptVo> selectUserDeptList(SysUserDeptVo userDeptVo); |
| | | List<SysUserDeptVo> userLoginFacotryList(SysUserDeptVo userDeptVo); |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | private SysUserDeptMapper sysUserDeptMapper; |
| | | |
| | | @Override |
| | | public List<SysUserDeptVo> selectUserDeptList(SysUserDeptVo userDeptVo) { |
| | | return sysUserDeptMapper.selectUserDeptList(userDeptVo); |
| | | public List<SysUserDeptVo> userLoginFacotryList(SysUserDeptVo userDeptVo) { |
| | | return sysUserDeptMapper.userLoginFacotryList(userDeptVo); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.InvoicePurchaseDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentDto; |
| | | import com.ruoyi.sales.pojo.ReceiptPayment; |
| | | import com.ruoyi.sales.service.ReceiptPaymentService; |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping("/receiptPayment") |
| | | public class ReceiptPaymentController { |
| | | public class ReceiptPaymentController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ReceiptPaymentService receiptPaymentService; |
| | |
| | | public AjaxResult getAmountMouth() { |
| | | return AjaxResult.success(receiptPaymentService.getAmountMouth()); |
| | | } |
| | | |
| | | /** |
| | | * 查询回款记录 |
| | | */ |
| | | @GetMapping("/receiptPaymentHistoryList") |
| | | public TableDataInfo receiptPaymentHistoryList(ReceiptPaymentDto receiptPaymentDto) { |
| | | startPage(); |
| | | List<ReceiptPaymentDto> list = receiptPaymentService.receiptPaymentHistoryList(receiptPaymentDto); |
| | | return getDataTable(list); |
| | | } |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | public interface ReceiptPaymentMapper extends BaseMapper<ReceiptPayment> { |
| | | |
| | |
| | | */ |
| | | BigDecimal getReceiptAmount(@Param("customerId") Integer customerId, @Param("total") long total); |
| | | |
| | | /** |
| | | * 查询回款记录 |
| | | */ |
| | | List<ReceiptPaymentDto> receiptPaymentHistoryList(@Param("params") ReceiptPaymentDto receiptPaymentDto); |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "创建用户") |
| | |
| | | InvoiceLedgerDto invoiceInfo(Integer id); |
| | | |
| | | Map<String,BigDecimal> getAmountMouth(); |
| | | |
| | | /** |
| | | * 查询回款记录 |
| | | */ |
| | | List<ReceiptPaymentDto> receiptPaymentHistoryList(ReceiptPaymentDto receiptPaymentDto); |
| | | } |
| | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.YearMonth; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class ReceiptPaymentServiceImpl extends ServiceImpl<ReceiptPaymentMapper,ReceiptPayment> implements ReceiptPaymentService { |
| | |
| | | result.put("contractAmount", contractAmount); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 查询回款记录 |
| | | */ |
| | | @Override |
| | | public List<ReceiptPaymentDto> receiptPaymentHistoryList(ReceiptPaymentDto receiptPaymentDto) { |
| | | return receiptPaymentMapper.receiptPaymentHistoryList(receiptPaymentDto); |
| | | } |
| | | } |
| | |
| | | LIMIT #{total} ) AS limited_rows |
| | | </select> |
| | | |
| | | <select id="receiptPaymentHistoryList" resultType="com.ruoyi.sales.dto.ReceiptPaymentDto"> |
| | | SELECT |
| | | T1.receipt_payment_date, |
| | | T5.customer_name, |
| | | T1.receipt_payment_amount, |
| | | T1.receipt_payment_type, |
| | | T1.registrant, |
| | | T1.create_time |
| | | FROM |
| | | receipt_payment T1 |
| | | LEFT JOIN |
| | | invoice_ledger T2 ON T1.invoice_ledger_id = T2.id |
| | | LEFT JOIN invoice_registration_product T3 ON T2.invoice_registration_product_id = T3.id |
| | | LEFT JOIN sales_ledger T4 ON T3.sales_ledger_id = T4.id |
| | | LEFT JOIN customer T5 ON T5.id = T4.customer_id |
| | | <where> |
| | | <if test="params.searchText != null and params.searchText != '' "> |
| | | T5.customer_name LIKE CONCAT('%',#{params.searchText},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY T1.receipt_payment_date DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysUserDeptMapper"> |
| | | |
| | | <select id="selectUserDeptList" resultType="com.ruoyi.project.system.domain.vo.SysUserDeptVo"> |
| | | <select id="userLoginFacotryList" resultType="com.ruoyi.project.system.domain.vo.SysUserDeptVo"> |
| | | SELECT |
| | | T1.user_id, |
| | | T1.dept_id, |
| | |
| | | sys_user_dept T1 |
| | | LEFT JOIN sys_dept T2 ON T1.dept_id = T2.dept_id |
| | | <where> |
| | | T1.dept_id IN (select dept_id from sys_dept where parent_id = 100) |
| | | <if test="userDeptVo.userId != null"> |
| | | T1.user_id = #{userDeptVo.userId} |
| | | AND T1.user_id = #{userDeptVo.userId} |
| | | </if> |
| | | <if test="userDeptVo.userName != null and userDeptVo.userName != '' "> |
| | | T1.user_id IN ( |
| | | AND T1.user_id IN ( |
| | | SELECT user_id FROM sys_user WHERE nick_name LIKE CONCAT('%',#{userDeptVo.userName},'%') |
| | | ) |
| | | </if> |