Commit 1ba1a5d1 by huluobin

bug fix

parent e3ed459e
......@@ -4,12 +4,12 @@ package com.blt.other.common.exception;
import lombok.Builder;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.HashMap;
import java.util.Map;
......@@ -24,7 +24,6 @@ import java.util.Map;
public class GlobalExceptionHandler {
/**
* 自定义异常
*/
......@@ -46,7 +45,7 @@ public class GlobalExceptionHandler {
* 自定义异常
*/
@ResponseBody
@ExceptionHandler(RuntimeException.class)
@ExceptionHandler({RuntimeException.class})
public Map<String, Object> handleRuntimeException(HttpServletRequest request,
RuntimeException e) {
Map<String, Object> result = new HashMap<>();
......@@ -58,6 +57,22 @@ public class GlobalExceptionHandler {
return result;
}
/**
* 数据库唯一键冲突异常
*/
@ResponseBody
@ExceptionHandler({SQLIntegrityConstraintViolationException.class})
public Map<String, Object> handleSQLIntegrityConstraintViolationException(HttpServletRequest request,
RuntimeException e) {
Map<String, Object> result = new HashMap<>();
result.put("success", false);
result.put("msg", "数据重复");
result.put("message", "数据重复");
log.error(e.getMessage(), e);
return result;
}
/**
* 未捕获异常
......
package com.blt.other.common.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.bailuntec.common.JsonUtilByFsJson;
import com.blt.other.common.base.SysUser;
import com.blt.other.common.exception.BizRuntimeException;
......@@ -40,7 +42,8 @@ public class JwtUtil {
JwtConsumer consumer = new JwtConsumerBuilder()
.setExpectedAudience("http://localhost:5001/resources", "bailunApi")
.setVerificationKey(new RsaJsonWebKey(JsonUtilByFsJson.jsonToBean(PUBLIC_KEY, map.getClass())).getPublicKey())
.setVerificationKey(new RsaJsonWebKey(JSON.parseObject(PUBLIC_KEY, new TypeReference<HashMap<String, Object>>() {
})).getPublicKey())
.build();
JwtClaims claims = consumer.processToClaims(token.replaceAll(TOKEN_PREFIX, ""));
if (claims != null) {
......
......@@ -3,6 +3,7 @@ package com.blt.other.database.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -40,17 +41,24 @@ public class CostTypeDomain {
@ApiModelProperty("费用模版类型作用")
private Integer costTemplateType;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "创建人id")
private Integer createUserId;
@ApiModelProperty(value = "创建人")
private String createUser;
@ApiModelProperty(value = "更新人id")
private Integer updateUserId;
@ApiModelProperty(value = "更新人")
private String updateUser;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "最后更新时间")
private LocalDateTime lastUpdateTime;
}
......@@ -31,13 +31,21 @@ public class OaDepartmentController {
@Resource
IOaDepartmentService oaDepartmentService;
@ApiOperation("获取百伦公司主体下面的一级部门列表")
@ApiOperation("获取公司主体下面的一级部门列表")
@GetMapping("/primaryDepartment")
public CostResult<List<OaDepartment>> oaDepartment(@RequestParam Integer companyId) {
List<OaDepartment> oaDepartmentList = oaDepartmentService.oaDepartment(companyId);
public CostResult<List<OaDepartment>> primaryDepartment(@RequestParam Integer companyId) {
List<OaDepartment> oaDepartmentList = oaDepartmentService.primaryDepartment(companyId);
return CostResult.success(oaDepartmentList);
}
@ApiOperation("获取公所有部门列表")
@GetMapping("/allOaDepartment")
public CostResult<List<OaDepartment>> allOaDepartment() {
List<OaDepartment> oaDepartmentList = oaDepartmentService.allOaDepartment();
return CostResult.success(oaDepartmentList);
}
@ApiOperation("更新部门审核金额")
@GetMapping("/updateDepartmentMinimumReviewAmount")
public CostResult<Void> updateDepartmentMinimumReviewAmount(@RequestParam Integer oaDepartmentId,
......
......@@ -7,6 +7,8 @@ import com.blt.other.module.sys.dto.response.DepartmentReviewerListItem;
import com.blt.other.module.auth.model.OaDepartment;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
......@@ -28,4 +30,6 @@ public interface OaDepartmentMapper extends BaseMapper<OaDepartment> {
@Param("req") DepartmentReviewerListReq req);
OaDepartment selectByDepartmentId(Integer oaDepartmentId);
List<OaDepartment> allOaDepartment();
}
......@@ -29,7 +29,7 @@ public interface IOaDepartmentService extends IService<OaDepartment> {
* @param companyId 公司主体id
* @return 一级部门列表
*/
List<OaDepartment> oaDepartment(@NonNull Integer companyId);
List<OaDepartment> primaryDepartment(@NonNull Integer companyId);
/**
......@@ -50,4 +50,10 @@ public interface IOaDepartmentService extends IService<OaDepartment> {
* @param amount 金额
*/
void updateDepartmentMinimumReviewAmount(Integer oaDepartmentId, BigDecimal amount);
/**
* 获取百伦所有部门
* @return 所有部门
*/
List<OaDepartment> allOaDepartment();
}
package com.blt.other.module.auth.service.impl;
import com.bailuntec.common.ListUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blt.other.module.sys.dao.CostReviewerMapper;
import com.blt.other.module.auth.dao.OaDepartmentMapper;
import com.blt.other.module.auth.dao.OaUserMapper;
import com.blt.other.module.sys.dto.request.DepartmentReviewerListReq;
import com.blt.other.module.sys.dto.response.DepartmentReviewerListItem;
import com.blt.other.module.sys.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.IOaDepartmentService;
import com.blt.other.module.sys.dao.CostReviewerMapper;
import com.blt.other.module.sys.model.CostReviewer;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Service;
......@@ -21,8 +16,6 @@ import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* <p>
......@@ -40,7 +33,7 @@ public class OaDepartmentServiceImpl extends ServiceImpl<OaDepartmentMapper, OaD
OaUserMapper oaUserMapper;
@Override
public List<OaDepartment> oaDepartment(@NonNull Integer companyId) {
public List<OaDepartment> primaryDepartment(@NonNull Integer companyId) {
return this.list(new LambdaQueryWrapper<OaDepartment>()
.eq(OaDepartment::getParentId, 0)
.eq(OaDepartment::getCompanyId, companyId));
......@@ -85,4 +78,9 @@ public class OaDepartmentServiceImpl extends ServiceImpl<OaDepartmentMapper, OaD
oaDepartment.setDepartmentMinimumReviewAmount(amount);
baseMapper.updateById(oaDepartment);
}
@Override
public List<OaDepartment> allOaDepartment() {
return baseMapper.allOaDepartment();
}
}
......@@ -42,6 +42,15 @@ public class AccountingSubjectController {
return CostResult.success();
}
@ApiOperation("更新会计一级科目")
@PostMapping("/modify")
public CostResult<Void> modify(@RequestBody AccountingSubjectAddReq req) {
log.info("新增会计一级科目:{}", JsonUtilByFsJson.beanToJson(req));
accountingSubjectService.modify(req);
return CostResult.success();
}
@ApiOperation("获取会计一级科目")
@PostMapping("/queryAll")
public CostResult<List<AccountingSubject>> queryAll() {
......
......@@ -2,13 +2,13 @@ package com.blt.other.module.cost.controller;
import com.bailuntec.cost.api.response.CostResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.database.model.LogisticsSupplierBankDomain;
import com.blt.other.module.cost.dto.request.CostTypeAddReq;
import com.blt.other.module.cost.dto.request.CostTypeModifyReq;
import com.blt.other.module.cost.dto.request.CostTypeQueryPageReq;
import com.blt.other.module.cost.dto.response.CostTypeResult;
import com.blt.other.module.cost.service.CostTypeKindService;
import com.blt.other.module.cost.service.CostTypeService;
import com.blt.other.database.model.LogisticsSupplierBankDomain;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......@@ -36,6 +36,23 @@ public class CostTypeController {
return CostResult.success(page);
}
@ApiOperation("获取费用类型详情")
@PostMapping("/queryDetail")
public CostResult<CostTypeResult> queryDetail(@RequestParam Integer id) {
CostTypeResult result = costTypeService.queryDetail(id);
return CostResult.success(result);
}
@ApiOperation("删除费用类型详情")
@PostMapping("/deleteById")
public CostResult<Void> deleteById(@RequestParam Integer id) {
costTypeService.deleteById(id);
return CostResult.success();
}
@ApiOperation("添加费用类型")
@PostMapping("/addCostType")
public CostResult<Void> addCostType(@RequestBody CostTypeAddReq req) {
......
......@@ -19,4 +19,7 @@ public interface CostTypeDao extends BaseMapper<CostTypeDomain> {
//根据编号查
CostTypeDomain selectByNo(String typeNo);
//获取费用类型详情
CostTypeResult queryDetail(Integer id);
}
package com.blt.other.module.cost.dto.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 4:37 下午
*/
@Data
public class AccountingSubjectModifyReq {
@ApiModelProperty(value = "会计一级类目编号")
private String subjectNo;
@ApiModelProperty(value = "会计一级类目名称")
private String name;
@ApiModelProperty(value = "更新人id")
private Integer updateUserId;
}
......@@ -14,6 +14,7 @@ import lombok.Data;
@Data
public class CostTypeModifyReq {
@ApiModelProperty("费用类型编号")
private String typeNo;
......@@ -26,9 +27,6 @@ public class CostTypeModifyReq {
@ApiModelProperty("会计一级科目")
private String accountingSubjectNo;
@ApiModelProperty("会计一级科目")
private String accountingSubjectName;
private Integer currentUserId;
......
package com.blt.other.module.cost.dto.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 10:28 上午
*/
@Data
public class SpecDepartmentCheckDeleteReq {
@ApiModelProperty(value = "id")
private Integer id;
}
package com.blt.other.module.cost.dto.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 10:28 上午
*/
@Data
public class SpecDepartmentCheckModifyReq {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "付款财务主体id")
private Integer costCompanyId;
@ApiModelProperty(value = "申请人oa公司id")
private Integer oaCompanyId;
@ApiModelProperty(value = "特殊审核人oa用户id")
private Integer reviewerUserId;
@ApiModelProperty(value = "修改人id")
private Integer updateUserId;
}
......@@ -2,9 +2,12 @@ package com.blt.other.module.cost.dto.response;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* <p>
*
......@@ -30,9 +33,30 @@ public class CostTypeResult {
private String typeName;
@ApiModelProperty(value = "会计一级类目编号")
private String accountingSubjectCode;
private String accountingSubjectNo;
@ApiModelProperty(value = "会计一级类目名称")
private String accountingSubjectName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "创建人id")
private Integer createUserId;
@ApiModelProperty(value = "创建人")
private String createUser;
@ApiModelProperty(value = "更新人id")
private Integer updateUserId;
@ApiModelProperty(value = "更新人")
private String updateUser;
@ApiModelProperty(value = "最后更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime lastUpdateTime;
}
......@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -11,7 +13,7 @@ import lombok.EqualsAndHashCode;
/**
* <p>
*
*
* </p>
*
* @author robbendev
......@@ -33,6 +35,7 @@ public class AccountingSubject implements Serializable {
@ApiModelProperty(value = "会计一级类目名称")
private String name;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
......@@ -42,6 +45,7 @@ public class AccountingSubject implements Serializable {
@ApiModelProperty(value = "更新人")
private String updateUser;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "最后更新时间")
private LocalDateTime lastUpdateTime;
......
......@@ -2,11 +2,11 @@ package com.blt.other.module.cost.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.blt.other.database.model.CostTypeDomain;
import com.blt.other.module.cost.dto.request.CostTypeAddReq;
import com.blt.other.module.cost.dto.request.CostTypeModifyReq;
import com.blt.other.module.cost.dto.request.CostTypeQueryPageReq;
import com.blt.other.module.cost.dto.response.CostTypeResult;
import com.blt.other.database.model.CostTypeDomain;
public interface CostTypeService extends IService<CostTypeDomain> {
......@@ -32,4 +32,19 @@ public interface CostTypeService extends IService<CostTypeDomain> {
* @param req req
*/
void modifyCostType(CostTypeModifyReq req);
/**
* 获取费用类型详情
*
* @param id id
* @return res
*/
CostTypeResult queryDetail(Integer id);
/**
* 删除费用类型详情
*
* @param id id
*/
void deleteById(Integer id);
}
......@@ -20,4 +20,11 @@ public interface IAccountingSubjectService extends IService<AccountingSubject> {
* @param req req
*/
void add(AccountingSubjectAddReq req);
/**
* 更新一级科目
*
* @param req req
*/
void modify(AccountingSubjectAddReq req);
}
......@@ -44,4 +44,19 @@ public class AccountingSubjectServiceImpl extends ServiceImpl<AccountingSubjectM
accountingSubject.setLastUpdateTime(LocalDateTime.now());
this.save(accountingSubject);
}
@Override
public void modify(AccountingSubjectAddReq req) {
AccountingSubject accountingSubject = baseMapper.selectByNo(req.getSubjectNo());
accountingSubject.setUpdateUserId(req.getUpdateUserId());
OaUser oaUser = oaUserMapper.selectByOaUserId(req.getUpdateUserId());
accountingSubject.setUpdateUser(oaUser.getUserName());
accountingSubject.setLastUpdateTime(LocalDateTime.now());
accountingSubject.setName(req.getName());
baseMapper.updateById(accountingSubject);
}
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.database.model.CostTypeDomain;
import com.blt.other.module.auth.dao.OaUserMapper;
import com.blt.other.module.auth.model.OaUser;
import com.blt.other.module.cost.dao.AccountingSubjectMapper;
......@@ -14,7 +15,6 @@ import com.blt.other.module.cost.dto.request.CostTypeQueryPageReq;
import com.blt.other.module.cost.dto.response.CostTypeResult;
import com.blt.other.module.cost.model.AccountingSubject;
import com.blt.other.module.cost.service.CostTypeService;
import com.blt.other.database.model.CostTypeDomain;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
......@@ -37,7 +37,7 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
costTypeDomain.setTypeName(req.getTypeName());
costTypeDomain.setDescription(req.getDescription());
costTypeDomain.setCostTemplateType(req.getType());
costTypeDomain.setCostTemplateType(this.getCostTemplateType(req.getType()));
this.save(costTypeDomain);
}
......@@ -64,19 +64,24 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
costTypeDomain.setUpdateUserId(oaUser.getOaUserId());
costTypeDomain.setUpdateUser(oaUser.getUserName());
costTypeDomain.setLastUpdateTime(LocalDateTime.now());
costTypeDomain.setAccountingSubjectNo(req.getAccountingSubjectNo());
log.info("{} 更新会计一级科目", oaUser.getUserName());
this.updateById(costTypeDomain);
}
log.info("{} 更新会计一级科目", oaUser.getUserName());
if (req.getAccountingSubjectNo() != null) {
AccountingSubject accountingSubject = accountingSubjectMapper.selectByNo(req.getAccountingSubjectNo());
accountingSubject.setName(req.getAccountingSubjectName().trim());
accountingSubject.setLastUpdateTime(LocalDateTime.now());
accountingSubject.setUpdateUserId(oaUser.getOaUserId());
accountingSubject.setUpdateUser(oaUser.getUserName());
accountingSubject.setLastUpdateTime(LocalDateTime.now());
accountingSubjectMapper.updateById(accountingSubject);
}
}
@Override
public CostTypeResult queryDetail(Integer id) {
return baseMapper.queryDetail(id);
}
@Override
public void deleteById(Integer id) {
baseMapper.deleteById(id);
}
/**
......
......@@ -55,6 +55,20 @@ public class SpecDepartmentCheckConfigController {
return CostResult.success();
}
@ApiOperation("更新特殊审核数据")
@PostMapping("/modify")
public CostResult<Void> modify(@RequestBody SpecDepartmentCheckModifyReq req) {
specDepartmentCheckConfigService.modify(req);
return CostResult.success();
}
@ApiOperation("删除特殊审核数据")
@PostMapping("/delete")
public CostResult<Void> delete(@RequestBody SpecDepartmentCheckDeleteReq req) {
specDepartmentCheckConfigService.delete(req);
return CostResult.success();
}
@ApiOperation("批量导入数据")
@PostMapping("/importExcel")
public CostResult<Void> importExcel(@RequestBody SpecDepartmentCheckImportExcelReq excel) throws IOException {
......
......@@ -51,7 +51,21 @@ public interface ISpecDepartmentCheckConfigService extends IService<SpecDepartme
* 导出excel
*
* @param response response
* @param req req
* @param req req
*/
void exportExcel(HttpServletResponse response, SpecDepartmentCheckExportExcelReq req) throws IOException;
/**
* 更新特殊审核数据
*
* @param req req
*/
void modify(SpecDepartmentCheckModifyReq req);
/**
* 删除特殊审核数据
*
* @param req req
*/
void delete(SpecDepartmentCheckDeleteReq req);
}
......@@ -9,13 +9,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blt.other.module.auth.dao.OaCompanyMapper;
import com.blt.other.module.auth.dao.OaUserMapper;
import com.blt.other.module.auth.model.OaUser;
import com.blt.other.module.auth.service.IOaCompanyService;
import com.blt.other.module.cost.dao.SpecDepartmentCheckConfigMapper;
import com.blt.other.module.cost.dto.request.*;
import com.blt.other.module.sys.model.SpecDepartmentCheckConfig;
import com.blt.other.module.cost.service.CostCompanyService;
import com.blt.other.module.sys.model.SpecDepartmentCheckConfig;
import com.blt.other.module.sys.service.ISpecDepartmentCheckConfigService;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -49,6 +50,8 @@ public class SpecDepartmentCheckConfigServiceImpl extends ServiceImpl<SpecDepart
private CostCompanyService costCompanyService;
@Resource
private IOaCompanyService oaCompanyService;
@Resource
private OaCompanyMapper oaCompanyMapper;
private <T extends SpecDepartmentCheckBaseQuery> LambdaQueryWrapper<SpecDepartmentCheckConfig> buildQueryWrapper(T req) {
LambdaQueryWrapper<SpecDepartmentCheckConfig> wrapper = new LambdaQueryWrapper<>();
......@@ -100,10 +103,10 @@ public class SpecDepartmentCheckConfigServiceImpl extends ServiceImpl<SpecDepart
specDepartmentCheckConfig.setReviewerUser(oaUserMapper.selectByOaUserId(req.getReviewerUserId()).getUserName());
specDepartmentCheckConfig.setOaCompanyId(req.getOaCompanyId());
specDepartmentCheckConfig.setOaCompany(oaCompanyService.getById(req.getOaCompanyId()).getName());
specDepartmentCheckConfig.setOaCompany(oaCompanyMapper.selectByCompanyId(req.getOaCompanyId()).getName());
specDepartmentCheckConfig.setCostCompanyId(req.getCostCompanyId());
specDepartmentCheckConfig.setOaCompany(costCompanyService.getById(req.getCostCompanyId()).getCompanyName());
specDepartmentCheckConfig.setCostCompanyName(costCompanyService.getById(req.getCostCompanyId()).getCompanyName());
specDepartmentCheckConfig.setUpdateUserId(req.getUpdateUserId());
specDepartmentCheckConfig.setUpdateUserName(oaUserMapper.selectByOaUserId(req.getUpdateUserId()).getUserName());
......@@ -143,6 +146,36 @@ public class SpecDepartmentCheckConfigServiceImpl extends ServiceImpl<SpecDepart
EasyExcel.write(response.getOutputStream(), SpecDepartmentCheckConfigExportExcelItem.class).sheet("sheet").doWrite(aiList);
}
@Override
public void modify(SpecDepartmentCheckModifyReq req) {
SpecDepartmentCheckConfig specDepartmentCheckConfig = this.getById(req.getId());
if (req.getReviewerUserId() != null) {
specDepartmentCheckConfig.setReviewerUserId(req.getReviewerUserId());
specDepartmentCheckConfig.setReviewerUser(oaUserMapper.selectByOaUserId(req.getReviewerUserId()).getUserName());
}
if (req.getOaCompanyId() != null) {
specDepartmentCheckConfig.setOaCompanyId(req.getOaCompanyId());
specDepartmentCheckConfig.setOaCompany(oaCompanyMapper.selectByCompanyId(req.getOaCompanyId()).getName());
}
if (req.getCostCompanyId() != null) {
specDepartmentCheckConfig.setCostCompanyId(req.getCostCompanyId());
specDepartmentCheckConfig.setCostCompanyName(costCompanyService.getById(req.getCostCompanyId()).getCompanyName());
}
specDepartmentCheckConfig.setUpdateUserId(req.getUpdateUserId());
specDepartmentCheckConfig.setUpdateUserName(oaUserMapper.selectByOaUserId(req.getUpdateUserId()).getUserName());
specDepartmentCheckConfig.setLastUpdateTime(LocalDateTime.now());
this.save(specDepartmentCheckConfig);
}
@Override
public void delete(SpecDepartmentCheckDeleteReq req) {
this.removeById(req.getId());
}
@Data
static class SpecDepartmentCheckConfigExportExcelItem {
......
......@@ -4,16 +4,23 @@
<mapper namespace="com.blt.other.module.cost.dao.CostTypeDao">
<select id="queryPage" resultType="com.blt.other.module.cost.dto.response.CostTypeResult">
select t1.type_no,
select t1.id,
t1.type_no,
t1.type_name,
t1.description,
t1.accounting_subject_code,
t2.name as accounting_subject_name
t1.accounting_subject_no,
t2.name as accounting_subject_name,
t1.create_time,
t1.update_user,
t1.update_user_id,
t1.last_update_time,
t1.create_user_id,
t1.create_user
from cost_type t1
left join accounting_subject t2 on t1.accounting_subject_code = t2.subject_no
left join accounting_subject t2 on t1.accounting_subject_no = t2.subject_no
where t1.cost_template_type =#{req.costTemplateType}
<if test="req.accountingSubjectNo !=null">
and t1.accounting_subject_code = #{req.accountingSubjectNo}
and t1.accounting_subject_no = #{req.accountingSubjectNo}
</if>
</select>
......@@ -23,4 +30,22 @@
where type_no = #{typeNo}
</select>
<select id="queryDetail" resultType="com.blt.other.module.cost.dto.response.CostTypeResult">
select t1.id,
t1.type_no,
t1.type_name,
t1.description,
t1.accounting_subject_no,
t2.name as accounting_subject_name,
t1.create_time,
t1.update_user,
t1.update_user_id,
t1.last_update_time,
t1.create_user_id,
t1.create_user
from cost_type t1
left join accounting_subject t2 on t1.accounting_subject_no = t2.subject_no
where t1.id = #{id}
</select>
</mapper>
......@@ -6,7 +6,7 @@
SELECT distinct t1.*,
t2.`name` company_name
from oa_department t1
left join oa_department s2 on t1.department_id = s2.parent_id
left join oa_department s2 on t1.department_id = s2.parent_id
left join oa_company t2 on s2.company_id = t2.oa_company_id
left join cost_reviewer t3 on t1.department_id = t3.refer_id and (t3.type = 1)
where t1.parent_id = 0
......@@ -37,6 +37,12 @@
from oa_department
where department_id = #{oaDepartmentId}
</select>
<select id="allOaDepartment" resultType="com.blt.other.module.auth.model.OaDepartment">
select t1.*,
t2.name company_name
from oa_department t1
left join oa_company t2 on t1.company_id = t2.oa_company_id
</select>
</mapper>
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