Commit e0249ef0 by huluobin

update

parent 80032e4c
package com.blt.other.module.cost.controller.cost;
package com.blt.other.module.cost.controller;
import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.response.CostResult;
......
package com.blt.other.module.cost.controller.cost;
package com.blt.other.module.cost.controller;
import com.bailuntec.common.JsonUtilByFsJson;
import com.bailuntec.cost.api.dto.CostDto;
......
package com.blt.other.module.cost.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 费用单当前审核人 前端控制器
* </p>
*
* @author robbendev
* @since 2020-12-16
*/
@RestController
@RequestMapping("//cost-current-reviewer")
public class CostCurrentReviewerController {
}
package com.blt.other.module.cost.controller.cost;
package com.blt.other.module.cost.controller;
import com.blt.other.common.util.AxiosUtil;
import com.blt.other.common.util.PathUtil;
......
package com.blt.other.module.cost.controller.costplan;
package com.blt.other.module.cost.controller;
import com.bailuntec.cost.api.dto.CostPlanTempDto;
import com.blt.other.common.util.CurUtils;
......
package com.blt.other.module.cost.controller.costplan;
package com.blt.other.module.cost.controller;
import com.blt.other.common.util.CurUtils;
import com.blt.other.module.cost.dto.response.RestResp;
......
package com.blt.other.module.cost.controller.costplan;
package com.blt.other.module.cost.controller;
import com.blt.other.module.cost.dto.request.AddItemReq;
import com.blt.other.module.cost.dto.request.AddItemResp;
......
package com.blt.other.module.cost.controller.costtemplate;
package com.blt.other.module.cost.controller;
import com.bailuntec.cost.api.response.CostResult;
......
package com.blt.other.module.cost.controller.costtemplate;
package com.blt.other.module.cost.controller;
import com.bailuntec.cost.api.response.CostResult;
......
package com.blt.other.module.cost.controller.cost;
package com.blt.other.module.cost.controller;
import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.response.CostResult;
......
package com.blt.other.module.cost.dao;
import com.blt.other.module.cost.model.CostCurrentReviewer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 费用单当前审核人 Mapper 接口
* </p>
*
* @author robbendev
* @since 2020-12-16
*/
public interface CostCurrentReviewerMapper extends BaseMapper<CostCurrentReviewer> {
}
package com.blt.other.module.cost.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 2020-12-16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="CostCurrentReviewer对象", description="费用单当前审核人")
public class CostCurrentReviewer implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "费用单号")
private String costNo;
@ApiModelProperty(value = "审核人id")
private Integer oaUserId;
@ApiModelProperty(value = "审核人姓名")
private String username;
}
package com.blt.other.module.cost.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.blt.other.module.cost.model.CostCurrentReviewer;
/**
* <p>
* 费用单当前审核人 服务类
* </p>
*
* @author robbendev
* @since 2020-12-16
*/
public interface ICostCurrentReviewerService extends IService<CostCurrentReviewer> {
/**
* currentUserId 是否可以审核 costNo
*
* @param oaUserId 用户id
* @param costNo 费用单号
* @return canAudit
*/
Boolean canAudit(Integer oaUserId, String costNo);
}
package com.blt.other.module.cost.service.impl;
import com.bailuntec.common.ListUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blt.other.module.cost.dao.CostCurrentReviewerMapper;
import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.model.CostCurrentReviewer;
import com.blt.other.module.cost.service.ICostCurrentReviewerService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 费用单当前审核人 服务实现类
* </p>
*
* @author robbendev
* @since 2020-12-16
*/
@Service
public class CostCurrentReviewerServiceImpl extends ServiceImpl<CostCurrentReviewerMapper, CostCurrentReviewer> implements ICostCurrentReviewerService {
@Override
public Boolean canAudit(Integer oaUserId, String costNo) {
List<CostCurrentReviewer> costCurrentReviewerList = baseMapper.selectList(new LambdaQueryWrapper<CostCurrentReviewer>()
.eq(CostCurrentReviewer::getCostNo, costNo));
return ListUtil.isNotEmpty(costCurrentReviewerList) && costCurrentReviewerList.stream()
.map(CostCurrentReviewer::getOaUserId).anyMatch(id -> id.equals(oaUserId))
}
}
......@@ -18,7 +18,6 @@ import com.blt.other.common.util.SessionUtils;
import com.blt.other.module.auth.dao.CostReviewerMapper;
import com.blt.other.module.auth.dao.OaDepartmentMapper;
import com.blt.other.module.auth.dao.OaUserMapper;
import com.blt.other.module.auth.model.CostReviewer;
import com.blt.other.module.auth.model.OaDepartment;
import com.blt.other.module.auth.model.OaUser;
import com.blt.other.module.auth.service.UserService;
......@@ -141,31 +140,17 @@ public abstract class AbstractCostService implements CostService {
CostReviewerMapper costReviewerMapper;
@Resource
OaUserMapper oaUserMapper;
@Resource
ICostCurrentReviewerService costCurrentReviewerService;
@Override
public CostDomain getCostByCostNo(String costNo) {
CostDomain costDomain = costDao.selectByCostNo(costNo);
costDomain.setCostTemplate(costTemplateService.queryDetail(costDomain.getCostTemplateId()));
CostCompanyDomain costCompany = costCompanyDao.selectByNo(costDomain.getCompanyNo());
Integer currentUserId = SessionUtils.getCurrentUserId();
OaUser costUser = oaUserMapper.selectByOaUserId(costDomain.getCreateUserid());
if (currentUserId == null) {
costDomain.setCanAudit(false);
} else if (costDomain.getCostStatus().equals(CostDomain.STATUS_DEPARTMENT_CHECK)) {
costDomain.setCanAudit(costReviewerMapper.queryOne(costUser.getPrimaryDepartmentId(), CostReviewer.departmentReviewer, currentUserId) != null);
} else if (costDomain.getCostStatus().equals(CostDomain.STATUS_FINANCIAL_CHECK)) {
costDomain.setCanAudit(costReviewerMapper.queryOne(costCompany.getId(), CostReviewer.financialReviewer, currentUserId) != null);
} else if (costDomain.getCostStatus().equals(CostDomain.STATUS_FINAL_CHECK)) {
costDomain.setCanAudit(costReviewerMapper.queryOne(costCompany.getId(), CostReviewer.finalReviewer, currentUserId) != null);
} else if (costDomain.getCostStatus().equals(CostDomain.STATUS_HR_CHECK)) {
costDomain.setCanAudit(costReviewerMapper.queryOne(costCompany.getId(), CostReviewer.hrReviewer, currentUserId) != null);
} else {
costDomain.setCanAudit(false);
}
// //todo
// costDomain.setCanAudit(true);
costDomain.setCanAudit(costCurrentReviewerService.canAudit(currentUserId, costNo));
return costDomain;
}
......
......@@ -32,7 +32,7 @@
<AsyncLogger name="io.lettuce" level="ERROR" includeLocation="true"/>
<AsyncRoot level="INFO" includeLocation="true">
<appender-ref ref="FILE"/>
<!-- <appender-ref ref="CONSOLE"/>-->
<appender-ref ref="CONSOLE"/>
</AsyncRoot>
</Loggers>
......
<?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.cost.dao.CostCurrentReviewerMapper">
</mapper>
......@@ -53,18 +53,19 @@ public class CodeGenerator {
// 数据源配置
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.setSchemaName("public");
dsc.setDriverName("com.mysql.jdbc.Driver");
dsc.setUsername("root");
dsc.setPassword("gogirl2020test.");
dsc.setPassword("Aarob2020#");
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
String s = scanner("模块名");
String ss = "." + s;
pc.setParent("com.blt.other.module" + ss);
pc.setParent("com.blt.other" + ss);
pc.setEntity("model");
pc.setService("service");
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