Commit 1ba1a5d1 by huluobin

bug fix

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