Commit 2d34535d by huluobin

Roll Back !!

parent 0543ddbf
...@@ -84,6 +84,10 @@ public class CostDto { ...@@ -84,6 +84,10 @@ public class CostDto {
//客户编号 //客户编号
private String customerNum; private String customerNum;
@ApiModelProperty("能否审核")
@TableField(exist = false)
private Boolean canAudit;
@TableField(typeHandler = JacksonTypeHandler.class) @TableField(typeHandler = JacksonTypeHandler.class)
@ApiModelProperty("附加字段") @ApiModelProperty("附加字段")
private List<CostAttach> attach; private List<CostAttach> attach;
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
<select id="getCostList" resultType="com.blt.other.other_cost.dto.CostDto"> <select id="getCostList" resultType="com.blt.other.other_cost.dto.CostDto">
select * from cost where last_modify_date &gt;= #{startDate} and last_modify_date &lt;= #{endDate} select * from cost where last_modify_date &gt;= #{startDate} and last_modify_date &lt;= #{endDate}
</select> </select>
<!--管理成本:查询付款单+收款单+借还单+采购单--> <!--管理成本:查询付款单+收款单+借还单+采购单-->
<select id="selectManageCost" resultType="com.blt.other.other_cost.dto.ManageCostDto"> <select id="selectManageCost" resultType="com.blt.other.other_cost.dto.ManageCostDto">
SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form manageCostType,u.departmentname1 departmentName, SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form manageCostType,u.departmentname1 departmentName,
...@@ -187,4 +186,4 @@ ...@@ -187,4 +186,4 @@
<if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if> <if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -254,6 +254,7 @@ ...@@ -254,6 +254,7 @@
<serverId>bailuntec-docker</serverId> <serverId>bailuntec-docker</serverId>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
<!--配置资源文件目录--> <!--配置资源文件目录-->
......
package com.blt.other.common.interceptor;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
/**
* <p>
* spring mvc拦截器配置
* </p>
*
* @author robbendev
*/
@Configuration
@AllArgsConstructor
public class MvcInterceptorConfig extends WebMvcConfigurationSupport {
private final SessionHandlerInterceptor sessionHandlerInterceptor;
@Override
protected void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(sessionHandlerInterceptor);
super.addInterceptors(registry);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
//swagger增加url映射
registry.addResourceHandler("/swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("/doc.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
}
package com.blt.other.common.interceptor;
import com.blt.other.common.util.SessionUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Component
@AllArgsConstructor
@Slf4j
public class SessionHandlerInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
try {
String userid = request.getHeader("userid");
SessionUtils.putCurrentUserId(Integer.valueOf(userid));
}catch (Exception ignore){
}
return true;
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
SessionUtils.removeCurrentUserId();
}
}
package com.blt.other.common.job; package com.blt.other.common.job;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.module.auth.dao.UserDao; import com.blt.other.module.auth.dao.UserDao;
import com.blt.other.module.cost.dao.CostDao; import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.dao.CostLogDao; import com.blt.other.module.cost.dao.CostLogDao;
import com.bailuntec.cost.api.dto.CostDto;
import com.blt.other.module.cost.service.CostService;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostService;
import com.blt.other.module.database.model.CostLogDomain; import com.blt.other.module.database.model.CostLogDomain;
import com.blt.other.module.database.model.UserDomain; import com.blt.other.module.database.model.UserDomain;
import org.quartz.JobExecutionContext; import org.quartz.JobExecutionContext;
...@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean; import org.springframework.scheduling.quartz.QuartzJobBean;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -39,24 +40,27 @@ public class CostStatusSyncJob extends QuartzJobBean { ...@@ -39,24 +40,27 @@ public class CostStatusSyncJob extends QuartzJobBean {
@Override @Override
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
logger.info("系统自动作废驳回费用单"); logger.info("系统自动作废驳回费用单");
List<CostDto> costDtoList = costDao.getCostByRejectStatus(); List<CostDomain> costDomainList = costDao.selectList(new LambdaQueryWrapper<CostDomain>()
for(CostDto costDto : costDtoList) { .eq(CostDomain::getCostStatus, CostDomain.STATUS_REJECT)
CostDomain costDomain = new CostDomain(); .eq(CostDomain::getRejectType, 1)
costDomain.setCostNo(costDto.getCostNo()); .lt(CostDomain::getRejectTime, LocalDateTime.now().minusDays(1)));
costDomain.setCostStatus(5);
int result = costDao.updateByNo(costDomain); costDomainList.forEach(costDomain -> {
if(result > 0) { costDomain.setCostStatus(CostDomain.STATUS_DELETE);
int result = costDao.updateById(costDomain);
if (result > 0) {
CostLogDomain costLog = new CostLogDomain(); CostLogDomain costLog = new CostLogDomain();
costLog.setCostNo(costDto.getCostNo()); costLog.setCostNo(costDomain.getCostNo());
costLog.setUpdateTime(new Date()); costLog.setUpdateTime(new Date());
UserDomain user = userDao.selectByuserid(2493); UserDomain user = userDao.selectByuserid(2493);
costLog.setUpdateUsercode(user.getUsercode()); costLog.setUpdateUsercode(user.getUsercode());
costLog.setUpdateUserid(2493); costLog.setUpdateUserid(2493);
costLog.setUpdateUsername(user.getUsername()); costLog.setUpdateUsername(user.getUsername());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
costLog.setUpdateNote(sdf.format(costLog.getUpdateTime())+" 过期财务驳回单系统自动作废 更新人:"+user.getUsername()); costLog.setUpdateNote(sdf.format(costLog.getUpdateTime()) + " 过期财务驳回单系统自动作废 更新人:" + user.getUsername());
costLogDao.insert(costLog); costLogDao.insert(costLog);
} }
} });
} }
} }
package com.blt.other.common.util;
/**
* 应用会话管理工具类
*/
public class SessionUtils {
/*当前登录用户id*/
private static final ThreadLocal<Integer> useridThreadLocal = new ThreadLocal<>();
public static void putCurrentUserId(Integer currentUserId) {
useridThreadLocal.set(currentUserId);
}
public static Integer getCurrentUserId() {
return useridThreadLocal.get();
}
public static void removeCurrentUserId() {
useridThreadLocal.remove();
}
}
...@@ -6,8 +6,8 @@ import com.bailuntec.cost.api.dto.LogisticsCostDto; ...@@ -6,8 +6,8 @@ import com.bailuntec.cost.api.dto.LogisticsCostDto;
import com.bailuntec.cost.api.dto.ManageCostDto; import com.bailuntec.cost.api.dto.ManageCostDto;
import com.bailuntec.cost.api.dto.WageCostDto; import com.bailuntec.cost.api.dto.WageCostDto;
import com.bailuntec.cost.api.response.CostResult; import com.bailuntec.cost.api.response.CostResult;
import com.blt.other.module.cost.service.CostApiService;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostApiService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -166,12 +166,8 @@ public class CostApiController implements CostApi { ...@@ -166,12 +166,8 @@ public class CostApiController implements CostApi {
@ApiOperation("查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单") @ApiOperation("查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单")
@GetMapping("/noPayCost") @GetMapping("/noPayCost")
public CostResult<List<CostDto>> getNoPayCost(@RequestParam(name = "costNoList") List<String> costNoList) { public CostResult<List<CostDto>> getNoPayCost(@RequestParam(name = "costNoList") List<String> costNoList) {
if (costNoList != null && costNoList.size() > 0) { List<CostDomain> costDomainList = costApiService.getNoPayCost(costNoList);
List<CostDomain> costDomainList = costApiService.getNoPayCost(costNoList); return CostResult.success(costDomainList.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
return CostResult.success(costDomainList.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
} else {
return CostResult.error();
}
} }
......
package com.blt.other.module.cost.controller.cost; package com.blt.other.module.cost.controller.cost;
import com.bailuntec.cost.api.dto.CostDto; import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.response.CostResult;
import com.blt.other.common.util.AxiosUtil; import com.blt.other.common.util.AxiosUtil;
import com.blt.other.module.cost.dto.CostApiDto; import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
...@@ -27,9 +28,6 @@ import javax.servlet.http.HttpServletRequest; ...@@ -27,9 +28,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api(tags = "费用审核接口") @Api(tags = "费用审核接口")
@RestController @RestController
...@@ -138,13 +136,10 @@ public class CostCheckController { ...@@ -138,13 +136,10 @@ public class CostCheckController {
return resp; return resp;
} }
@ApiOperation("出纳单附件下载")
@GetMapping("downCashierAnnex") @GetMapping("downCashierAnnex")
public Map<String, Object> downCashierAnnex(HttpServletRequest request, HttpServletResponse response) { public CostResult<String> downCashierAnnex() {
AxiosUtil.setCors(response, request); costCashiercallbackService.downCashierAnnex();
Map<String, Object> result = new HashMap<>(); return CostResult.success("出纳单附件下载完成", null);
List<String> list = costCashiercallbackService.downCashierAnnex();
result.put("success", true);
result.put("msg", "出纳单附件下载完成");
return result;
} }
} }
...@@ -9,6 +9,7 @@ import com.blt.other.common.util.MyMapperUtil; ...@@ -9,6 +9,7 @@ import com.blt.other.common.util.MyMapperUtil;
import com.blt.other.common.util.PathUtil; import com.blt.other.common.util.PathUtil;
import com.blt.other.module.cost.dao.CostDao; import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.dto.CostApiDto; import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.dto.CostPageResult;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostExportService; import com.blt.other.module.cost.service.CostExportService;
import com.blt.other.module.cost.service.CostListSearchService; import com.blt.other.module.cost.service.CostListSearchService;
...@@ -64,26 +65,29 @@ public class CostController { ...@@ -64,26 +65,29 @@ public class CostController {
@ApiOperation("获取前端要打印的费用单列表") @ApiOperation("获取前端要打印的费用单列表")
@PostMapping("/list/print/list") @PostMapping("/list/print/list")
public CostResult<List<CostListPrintDto>> printList(@RequestBody CostListPrintVo costListPrintVo) { public CostApiDto.PrintListResp printList(@RequestBody CostListPrintVo costListPrintVo) {
costService = CostServiceFactory.getCostService(); costService = CostServiceFactory.getCostService();
List<CostListPrintDto> listPrintDtos = costService.printList(costListPrintVo.getPrintNos()); List<CostListPrintDto> listPrintDtos = costService.printList(costListPrintVo.getPrintNos());
return CostResult.success(listPrintDtos); CostApiDto.PrintListResp resp = new CostApiDto.PrintListResp();
resp.setSuccess(true);
resp.setPrintList(listPrintDtos);
return resp;
} }
@ApiOperation("搜索") @ApiOperation("搜索")
@PostMapping("/list/search/key") @PostMapping("/list/search/key")
public CostResult<PageInfo<CostDto>> getByKey(@RequestParam Integer pageNum, public CostApiDto.GetByKeyResp getByKey(@RequestParam Integer pageNum,
@RequestParam Integer pageSize, @RequestParam Integer pageSize,
@RequestParam String key) { @RequestParam String key) {
costService = CostServiceFactory.getCostService(); costService = CostServiceFactory.getCostService();
PageInfo<CostDto> pageInfo = costListSearchService.searchByKey(key, pageNum, pageSize); return costListSearchService.searchByKey(key, pageNum, pageSize);
return CostResult.success(pageInfo);
} }
@ApiOperation("搜索?") @ApiOperation("搜索?")
@PostMapping("/list/search/keys") @PostMapping("/list/search/keys")
public CostResult<PageInfo<CostDto>> getByKeys(@RequestBody CostListSearchKeysVo searchKeysVo) { public CostApiDto.GetByKeyResp getByKeys(@RequestBody CostListSearchKeysVo searchKeysVo) {
costService = CostServiceFactory.getCostService(); costService = CostServiceFactory.getCostService();
if (null != searchKeysVo.getParams().getKeys().getCostForm() && 3 == searchKeysVo.getParams().getKeys().getCostForm()) { if (null != searchKeysVo.getParams().getKeys().getCostForm() && 3 == searchKeysVo.getParams().getKeys().getCostForm()) {
...@@ -93,8 +97,8 @@ public class CostController { ...@@ -93,8 +97,8 @@ public class CostController {
searchKeysVo.getParams().getKeys().setCostForm(3); searchKeysVo.getParams().getKeys().setCostForm(3);
searchKeysVo.getParams().getKeys().setIsLend(2); searchKeysVo.getParams().getKeys().setIsLend(2);
} }
PageInfo<CostDto> pageInfo = costListSearchService.searchByKeys(searchKeysVo); return costListSearchService.searchByKeys(searchKeysVo);
return CostResult.success(pageInfo);
} }
@ApiOperation("获取借支单列表") @ApiOperation("获取借支单列表")
...@@ -106,29 +110,25 @@ public class CostController { ...@@ -106,29 +110,25 @@ public class CostController {
@ApiOperation("获取所有费用单") @ApiOperation("获取所有费用单")
@GetMapping("/list/getAllCost") @GetMapping("/list/getAllCost")
public CostResult<PageInfo<CostDto>> getAllCost(@RequestParam Integer pageNum, public CostPageResult getAllCost(@RequestParam Integer pageNum,
@RequestParam Integer pageSize, @RequestParam Integer pageSize,
@RequestParam Integer userId, @RequestParam Integer userId,
@RequestParam(defaultValue = "0", required = false) Integer authType, @RequestParam(defaultValue = "0", required = false) Integer authType,
@RequestParam(required = false) String projectTypes) { @RequestParam(required = false) String projectTypes) {
if (authType != 0) { if (authType != 0) {
userId = null; userId = null;
} }
costService = CostServiceFactory.getCostService(); costService = CostServiceFactory.getCostService();
PageInfo<CostDto> pageInfo = costService.getAllCost(pageNum, pageSize, userId, projectTypes); return costService.getAllCost(pageNum, pageSize, userId, projectTypes);
return CostResult.success(pageInfo);
} }
@ApiOperation("获取费用详情") @ApiOperation("获取费用详情")
@PostMapping("/list/getCostDetail") @PostMapping("/list/getCostDetail")
public CostResp.GetCostDetailResp getCostDetail(@RequestParam String costNo) { public CostResult<CostDto> getCostDetail(@RequestParam String costNo) {
CostResp.GetCostDetailResp resp = new CostResp.GetCostDetailResp();
costService = CostServiceFactory.getCostService(costNo); costService = CostServiceFactory.getCostService(costNo);
CostDomain costDomain = costService.getCostByCostNo(costNo); CostDomain costDomain = costService.getCostByCostNo(costNo);
resp.setMsg("success"); return CostResult.success(costDomain.castToDto());
resp.setCost(costDomain.castToDto());
return resp;
} }
@ApiOperation("修改发票附件") @ApiOperation("修改发票附件")
......
package com.blt.other.module.cost.dao; package com.blt.other.module.cost.dao;
import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.dto.ManageCostDto; import com.bailuntec.cost.api.dto.ManageCostDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -29,52 +28,17 @@ public interface CostDao extends BaseMapper<CostDomain> { ...@@ -29,52 +28,17 @@ public interface CostDao extends BaseMapper<CostDomain> {
*/ */
CostDomain selectByCostNo(String costNo); CostDomain selectByCostNo(String costNo);
/**
* 修改费用单信息
*
* @param costDomain
* @return
*/
Integer updateByNo(CostDomain costDomain);
/**
* 获取 status >= costStatus(param) 的费用单
*
* @return
*/
List<CostDomain> selectByStatus(Integer costStatus);
/**
* 根据借支类型获取费用列表
*
* @param isLend
* @return
*/
List<CostDomain> selectByLend(Integer isLend);
/**
* 根据关键字获取费用单
*
* @return
*/
List<CostDomain> selectByKey(@Param("searchKey") String searchKey, @Param("costStatus") Integer costStatus);
List<CostDomain> selectByCostStatus(Integer costStatus);
List<CostDomain> selectByLendStatus(Integer lendStatus);
List<CostDomain> selectByCostForm(Integer costForm);
List<CostDomain> selectByCostFormAndStatus(@Param("costForm") Integer costForm, @Param("costStatus") Integer costStatus);
List<CostDomain> selectBySupCostNo(String supCostNo);
List<CostDomain> selectByKeys(CostDomain costDomain); List<CostDomain> selectByKeys(CostDomain costDomain);
List<CostDomain> selectByLendAndStatus(@Param("isLend") Integer isLend, @Param("costStatus") Integer costStatus);
List<CostDomain> selectByCostPlanNo(String costPlanNo); List<CostDomain> selectByCostPlanNo(String costPlanNo);
/**
* 查询最近一次费用单
*
* @return 费用单
*/
CostDomain selectLastCost(); CostDomain selectLastCost();
List<CostDomain> selectLinkLendCost(@Param("createuserid") Integer createuserid); List<CostDomain> selectLinkLendCost(@Param("createuserid") Integer createuserid);
...@@ -132,35 +96,28 @@ public interface CostDao extends BaseMapper<CostDomain> { ...@@ -132,35 +96,28 @@ public interface CostDao extends BaseMapper<CostDomain> {
/** /**
* 查询资产负债表相关费用单 * 查询资产负债表相关费用单
* *
* @param startDate * @param startDate date
* @param endDate * @param endDate date
* @return * @return 资产负债表相关费用单
*/ */
List<CostDomain> selectBalanceSheetCost(@Param("startDate") Date startDate, @Param("endDate") Date endDate); List<CostDomain> selectBalanceSheetCost(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
/**
* 查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单
*
* @param costNoList 费用单号
* @return 费用单
*/
List<CostDomain> selectNoPayCost(@Param("list") List<String> costNoList);
Integer selectCostStatusByNo(@Param("costNo") String costNo);
List<CostDto> getCostByRejectStatus();
List<String> listCostNo();
List<String> listCostNoAll(CostExportVo costExportVo); List<String> listCostNoAll(CostExportVo costExportVo);
Integer updateCashierAnnex(@Param("costNo") String costNo, @Param("filePath") String filePath, @Param("downloadUrl") String downloadUrl); /**
* 审核列表查询
List<CostDto> getCostList(@Param("startDate") String startDate, @Param("endDate") String endDate); *
* @param page page
* @param type type
* @param status status
* @param userid userid
* @param isManage ismange
* @return
*/
IPage<CostDomain> checkCostList(@Param("page") IPage<CostDomain> page, IPage<CostDomain> checkCostList(@Param("page") IPage<CostDomain> page,
@Param("type") Integer type, @Param("type") Integer type,
@Param("status") Integer status, @Param("status") Integer status,
@Param("userid") Integer userid, @Param("userid") Integer userid,
@Param("isManage") Boolean isManage); @Param("isManage") Boolean isManage);
} }
...@@ -19,6 +19,7 @@ import lombok.experimental.Accessors; ...@@ -19,6 +19,7 @@ import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -44,6 +45,9 @@ public class CostDomain implements Serializable { ...@@ -44,6 +45,9 @@ public class CostDomain implements Serializable {
public final static int STATUS_UN_PAY = 2; public final static int STATUS_UN_PAY = 2;
public final static int STATUS_PAYED = 4; public final static int STATUS_PAYED = 4;
public final static int STATUS_REJECT = 3;
public final static int STATUS_DELETE = 5;
// 费用单编号 // 费用单编号
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
private Integer id; private Integer id;
...@@ -240,6 +244,12 @@ public class CostDomain implements Serializable { ...@@ -240,6 +244,12 @@ public class CostDomain implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private CostTemplate costTemplate; private CostTemplate costTemplate;
private LocalDateTime lastModifyDate;
@ApiModelProperty("能否审核")
@TableField(exist = false)
private Boolean canAudit;
public CostDto castToDto() { public CostDto castToDto() {
StatusMapper statusMapper = SpringContextUtil.getBean(StatusMapper.class); StatusMapper statusMapper = SpringContextUtil.getBean(StatusMapper.class);
......
...@@ -80,15 +80,15 @@ public class CostTemplate implements Serializable { ...@@ -80,15 +80,15 @@ public class CostTemplate implements Serializable {
public boolean shouldDepartmentAutoCheck() { public boolean shouldDepartmentAutoCheck() {
return enableAutoReview && enableDepartmentReview; return enableAutoReview && enableDepartmentReview && !isDefault;
} }
public boolean shouldFinanciaAutoCheck() { public boolean shouldFinancialAutoCheck() {
return enableAutoReview && enableFinancialAutoReview; return enableAutoReview && enableFinancialAutoReview && !isDefault;
} }
public boolean shouldFinalAutoCheck() { public boolean shouldFinalAutoCheck() {
return enableAutoReview && enableFinalReview; return enableAutoReview && enableFinalReview && !isDefault;
} }
public boolean shouldFinalCheck(BigDecimal amount) { public boolean shouldFinalCheck(BigDecimal amount) {
......
...@@ -4,8 +4,8 @@ import com.bailuntec.cost.api.dto.CostDto; ...@@ -4,8 +4,8 @@ import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.dto.LogisticsCostDto; import com.bailuntec.cost.api.dto.LogisticsCostDto;
import com.bailuntec.cost.api.dto.ManageCostDto; import com.bailuntec.cost.api.dto.ManageCostDto;
import com.bailuntec.cost.api.dto.WageCostDto; import com.bailuntec.cost.api.dto.WageCostDto;
import com.blt.other.module.database.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import org.springframework.cglib.core.Local;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -57,7 +57,7 @@ public interface CostApiService { ...@@ -57,7 +57,7 @@ public interface CostApiService {
* @param payUserId 支付用户id * @param payUserId 支付用户id
* @return 单据 * @return 单据
*/ */
List<ManageCostDto> getLogisticsCostList(LocalDateTime startDateS, LocalDateTime endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception; List<ManageCostDto> getLogisticsCostList(LocalDateTime startDateStr, LocalDateTime endDateStr, String feeSuperType, String feeSubType, Integer companyValue, String companyName, String departmentName, Integer createUserId, Integer payUserId) throws Exception;
/** /**
* 查询资产负债表相关费用单 * 查询资产负债表相关费用单
......
package com.blt.other.module.cost.service; package com.blt.other.module.cost.service;
import com.bailuntec.cost.api.dto.CostDto;
import com.blt.other.module.cost.dto.CostApiDto; import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.vo.CostListSearchKeysVo; import com.blt.other.module.cost.vo.CostListSearchKeysVo;
import com.github.pagehelper.PageInfo;
import java.util.List; import java.util.List;
...@@ -16,7 +14,7 @@ public interface CostListSearchService { ...@@ -16,7 +14,7 @@ public interface CostListSearchService {
* @param key key * @param key key
* @return res * @return res
*/ */
PageInfo<CostDto> searchByKey(String key, int pageNum, int pageSize); CostApiDto.GetByKeyResp searchByKey(String key, int pageNum, int pageSize);
/** /**
* 多条件筛选 * 多条件筛选
...@@ -24,7 +22,7 @@ public interface CostListSearchService { ...@@ -24,7 +22,7 @@ public interface CostListSearchService {
* @param searchKeysVo param * @param searchKeysVo param
* @return res * @return res
*/ */
PageInfo<CostDto> searchByKeys(CostListSearchKeysVo searchKeysVo); CostApiDto.GetByKeyResp searchByKeys(CostListSearchKeysVo searchKeysVo);
/** /**
* 获取借支单列表 * 获取借支单列表
......
...@@ -2,14 +2,12 @@ package com.blt.other.module.cost.service; ...@@ -2,14 +2,12 @@ package com.blt.other.module.cost.service;
import com.bailuntec.cost.api.dto.CostDto; import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.dto.CostListPrintDto; import com.bailuntec.cost.api.dto.CostListPrintDto;
import com.bailuntec.cost.api.response.CostResult;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.blt.other.module.cost.dto.CostApiDto; import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.dto.CostPageResult; import com.blt.other.module.cost.dto.CostPageResult;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.vo.ApplyCallbackUrlVo; import com.blt.other.module.cost.vo.ApplyCallbackUrlVo;
import com.blt.other.module.cost.vo.CashierCallbackUrlVo; import com.blt.other.module.cost.vo.CashierCallbackUrlVo;
import com.github.pagehelper.PageInfo;
import java.util.List; import java.util.List;
...@@ -29,7 +27,7 @@ public interface CostService { ...@@ -29,7 +27,7 @@ public interface CostService {
* *
* @return allCost * @return allCost
*/ */
PageInfo<CostDto> getAllCost(Integer pageNum, Integer pageSize, Integer userId, String projectTypes); CostPageResult getAllCost(Integer pageNum, Integer pageSize, Integer userId, String projectTypes);
/** /**
* 根据 costNo 获取 cost * 根据 costNo 获取 cost
......
package com.blt.other.module.cost.service.impl; package com.blt.other.module.cost.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blt.other.module.cost.model.CostDetailDomain;
import com.blt.other.module.cost.model.CostDomain;
import com.bailuntec.cost.api.dto.*; import com.bailuntec.cost.api.dto.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
import com.blt.other.common.util.HttpUtil; import com.blt.other.common.util.HttpUtil;
import com.blt.other.common.util.PathUtil; import com.blt.other.common.util.PathUtil;
import com.blt.other.module.auth.dao.UserDao; import com.blt.other.module.auth.dao.UserDao;
import com.blt.other.module.cost.dao.*; import com.blt.other.module.cost.dao.*;
import com.blt.other.module.cost.model.CostDetailDomain;
import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostApiService; import com.blt.other.module.cost.service.CostApiService;
import com.blt.other.module.cost.service.CostService; import com.blt.other.module.cost.service.CostService;
import com.blt.other.module.cost.service.UserCostFinansysService; import com.blt.other.module.cost.service.UserCostFinansysService;
import com.blt.other.module.cost.utils.CostFileUtil; import com.blt.other.module.cost.utils.CostFileUtil;
import com.blt.other.module.cost.utils.CostUtils; import com.blt.other.module.cost.utils.CostUtils;
import com.blt.other.module.database.model.*; import com.blt.other.module.database.model.CostCompanyDomain;
import com.blt.other.module.database.model.CostLogDomain;
import com.blt.other.module.database.model.CostTypeKindDomain;
import com.blt.other.module.database.model.UserDomain;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -31,6 +35,7 @@ import java.time.LocalDateTime; ...@@ -31,6 +35,7 @@ import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service
public class CostApiServiceImpl implements CostApiService { public class CostApiServiceImpl implements CostApiService {
...@@ -255,7 +260,10 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -255,7 +260,10 @@ public class CostApiServiceImpl implements CostApiService {
@Override @Override
public List<CostDomain> getNoPayCost(List<String> costNoList) { public List<CostDomain> getNoPayCost(List<String> costNoList) {
return costDao.selectNoPayCost(costNoList); return costDao.selectList(new LambdaQueryWrapper<CostDomain>()
.eq(CostDomain::getCostForm, CostDomain.COST_FROM_1)
.eq(CostDomain::getCostStatus, CostDomain.STATUS_PAYED)
.in(CostDomain::getCostNo, costNoList));
} }
@Override @Override
...@@ -357,6 +365,11 @@ public class CostApiServiceImpl implements CostApiService { ...@@ -357,6 +365,11 @@ public class CostApiServiceImpl implements CostApiService {
@Override @Override
public List<CostDto> getCostList(String startDate, String endDate) { public List<CostDto> getCostList(String startDate, String endDate) {
return this.costDao.getCostList(startDate, endDate); return this.costDao.selectList(new LambdaQueryWrapper<CostDomain>()
.ge(CostDomain::getLastModifyDate, startDate)
.le(CostDomain::getLastModifyDate, endDate))
.stream()
.map(CostDomain::castToDto)
.collect(Collectors.toList());
} }
} }
package com.blt.other.module.cost.service.impl; package com.blt.other.module.cost.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.util.PathUtil; import com.blt.other.common.util.PathUtil;
import com.blt.other.module.cost.dao.CostCashiercallbackDao; import com.blt.other.module.cost.dao.CostCashiercallbackDao;
import com.blt.other.module.cost.dao.CostDao; import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostCashiercallbackService; import com.blt.other.module.cost.service.CostCashiercallbackService;
import com.blt.other.module.cost.service.CostService; import com.blt.other.module.cost.service.CostService;
import com.blt.other.module.database.model.CostCashiercallbackDomain; import com.blt.other.module.database.model.CostCashiercallbackDomain;
...@@ -24,6 +26,7 @@ import java.io.IOException; ...@@ -24,6 +26,7 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors;
@Service @Service
public class CostCashiercallbackServiceImpl implements CostCashiercallbackService { public class CostCashiercallbackServiceImpl implements CostCashiercallbackService {
...@@ -42,6 +45,7 @@ public class CostCashiercallbackServiceImpl implements CostCashiercallbackServic ...@@ -42,6 +45,7 @@ public class CostCashiercallbackServiceImpl implements CostCashiercallbackServic
@Autowired @Autowired
CostDao costDao; CostDao costDao;
@Override @Override
public Integer saveCostCashiercallbackResponse(CostCashiercallbackDomain costCashiercallbackDomain) { public Integer saveCostCashiercallbackResponse(CostCashiercallbackDomain costCashiercallbackDomain) {
return costCashiercallbackDao.insert(costCashiercallbackDomain); return costCashiercallbackDao.insert(costCashiercallbackDomain);
...@@ -54,7 +58,14 @@ public class CostCashiercallbackServiceImpl implements CostCashiercallbackServic ...@@ -54,7 +58,14 @@ public class CostCashiercallbackServiceImpl implements CostCashiercallbackServic
@Override @Override
public List<String> downCashierAnnex() { public List<String> downCashierAnnex() {
List<String> costNoList = costDao.listCostNo(); List<String> costNoList = costDao.selectList(new LambdaQueryWrapper<CostDomain>()
.eq(CostDomain::getCostForm, CostDomain.COST_FROM_1)
.eq(CostDomain::getCostStatus, CostDomain.STATUS_PAYED)
.eq(CostDomain::getCashierFilePath, ""))
.stream()
.map(CostDomain::getCostNo)
.collect(Collectors.toList());
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
HttpEntity<Resource> httpEntity = new HttpEntity<>(headers); HttpEntity<Resource> httpEntity = new HttpEntity<>(headers);
for (String costNo : costNoList) { for (String costNo : costNoList) {
......
...@@ -3,6 +3,7 @@ package com.blt.other.module.cost.service.impl; ...@@ -3,6 +3,7 @@ package com.blt.other.module.cost.service.impl;
import com.bailuntec.cost.api.dto.CostDto; import com.bailuntec.cost.api.dto.CostDto;
import com.blt.other.module.cost.dao.CostDao; import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.dao.CostListSearchDao; import com.blt.other.module.cost.dao.CostListSearchDao;
import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.service.CostListSearchService; import com.blt.other.module.cost.service.CostListSearchService;
import com.blt.other.module.cost.service.CostService; import com.blt.other.module.cost.service.CostService;
...@@ -13,6 +14,7 @@ import com.google.common.collect.Lists; ...@@ -13,6 +14,7 @@ import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -28,27 +30,41 @@ public class CostListSearchServiceImpl implements CostListSearchService { ...@@ -28,27 +30,41 @@ public class CostListSearchServiceImpl implements CostListSearchService {
CostDao costDao; CostDao costDao;
@Override @Override
public PageInfo<CostDto> searchByKey(String key, int pageNum, int pageSize) { public CostApiDto.GetByKeyResp searchByKey(String key, int pageNum, int pageSize) {
CostApiDto.GetByKeyResp resp = new CostApiDto.GetByKeyResp();
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<CostDto> costDtos = costListSearchDao.selectByKey(Lists.newArrayList(key.split(",")) List<CostDomain> costDomains = costListSearchDao.selectByKey(Lists.newArrayList(key.split(",")).stream().filter(Objects::nonNull).collect(Collectors.toList()));
.stream() List<CostDto> dtos = costDomains.stream().map(CostDomain::castToDto).collect(Collectors.toList());
.filter(Objects::nonNull)
.collect(Collectors.toList())) PageInfo<CostDomain> pageInfo = new PageInfo<>(costDomains);
.stream() resp.setCosts(dtos);
.map(CostDomain::castToDto) resp.setPageInfo(pageInfo);
.collect(Collectors.toList()); resp.setSuccess(true);
return new PageInfo<>(costDtos); return resp;
} }
@Override @Override
public PageInfo<CostDto> searchByKeys(CostListSearchKeysVo searchKeysVo) { public CostApiDto.GetByKeyResp searchByKeys(CostListSearchKeysVo searchKeysVo) {
CostApiDto.GetByKeyResp resp = new CostApiDto.GetByKeyResp();
PageHelper.startPage(searchKeysVo.getParams().getPageNum(), searchKeysVo.getParams().getPageSize()); PageHelper.startPage(searchKeysVo.getParams().getPageNum(), searchKeysVo.getParams().getPageSize());
List<CostDomain> domains = costListSearchDao.selectByKeys(searchKeysVo); List<CostDomain> domains = costListSearchDao.selectByKeys(searchKeysVo);
CostDomain supCost = costDao.selectByCostNo(searchKeysVo.getParams().getKeys().getLinkCost());
domains.add(supCost); PageInfo<CostDomain> pageInfo = new PageInfo<>(domains);
return new PageInfo<>(domains.stream().map(CostDomain::castToDto).collect(Collectors.toList())); if (null != searchKeysVo.getParams().getKeys().getLinkCost() && !searchKeysVo.getParams().getKeys().getLinkCost().isEmpty()) {
List<CostDomain> list = new ArrayList<>();
CostDomain supCost = costDao.selectByCostNo(searchKeysVo.getParams().getKeys().getLinkCost());
list.add(supCost);
if (null != domains && domains.size() >= 1) {
list.addAll(domains);
}
resp.setCosts(list.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
} else {
resp.setCosts(domains.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
}
resp.setPageInfo(pageInfo);
resp.setSuccess(true);
return resp;
} }
@Override @Override
......
...@@ -3,6 +3,7 @@ package com.blt.other.module.cost.service.impl.cost; ...@@ -3,6 +3,7 @@ package com.blt.other.module.cost.service.impl.cost;
import com.bailuntec.api.bailuntec.cw.CwApi; import com.bailuntec.api.bailuntec.cw.CwApi;
import com.bailuntec.api.bailuntec.cw.request.PostApplyReq; import com.bailuntec.api.bailuntec.cw.request.PostApplyReq;
import com.bailuntec.common.JsonUtilByJackson; import com.bailuntec.common.JsonUtilByJackson;
import com.bailuntec.common.ListUtil;
import com.bailuntec.cost.api.dto.CostDto; import com.bailuntec.cost.api.dto.CostDto;
import com.bailuntec.cost.api.dto.CostListPrintDto; import com.bailuntec.cost.api.dto.CostListPrintDto;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -11,14 +12,18 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -11,14 +12,18 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
import com.blt.other.common.util.MoneyUtil; import com.blt.other.common.util.MoneyUtil;
import com.blt.other.common.util.SessionUtils;
import com.blt.other.module.auth.dao.CostReviewerMapper;
import com.blt.other.module.auth.dao.OaUserMapper;
import com.blt.other.module.auth.model.CostReviewer;
import com.blt.other.module.auth.model.OaUser;
import com.blt.other.module.auth.service.UserService; import com.blt.other.module.auth.service.UserService;
import com.blt.other.module.cost.dao.CostCompanyDao; import com.blt.other.module.cost.dao.*;
import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.dao.CostDetailDao;
import com.blt.other.module.cost.dao.CostTypeKindDao;
import com.blt.other.module.cost.dto.CostApiDto; import com.blt.other.module.cost.dto.CostApiDto;
import com.blt.other.module.cost.dto.CostPageResult;
import com.blt.other.module.cost.model.CostDetailDomain; import com.blt.other.module.cost.model.CostDetailDomain;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.model.CostTemplateBaseCol;
import com.blt.other.module.cost.service.*; import com.blt.other.module.cost.service.*;
import com.blt.other.module.cost.vo.ApplyCallbackUrlDataDataVo; import com.blt.other.module.cost.vo.ApplyCallbackUrlDataDataVo;
import com.blt.other.module.cost.vo.ApplyCallbackUrlVo; import com.blt.other.module.cost.vo.ApplyCallbackUrlVo;
...@@ -93,23 +98,46 @@ public abstract class AbstractCostService implements CostService { ...@@ -93,23 +98,46 @@ public abstract class AbstractCostService implements CostService {
} }
@Override @Override
public PageInfo<CostDto> getAllCost(Integer pageNum, public CostPageResult getAllCost(Integer pageNum,
Integer pageSize, Integer pageSize,
Integer userId, Integer userId,
String projectTypes) { String projectTypes) {
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<String> projectTypeList = new ArrayList<>(); List<String> projectTypeList = new ArrayList<>();
if (!StringUtils.isEmpty(projectTypes)) { if (!StringUtils.isEmpty(projectTypes)) {
projectTypeList = Lists.newArrayList(projectTypes.split(",")).stream().filter(str -> !StringUtils.isEmpty(str)).collect(Collectors.toList()); projectTypeList = Lists.newArrayList(projectTypes.split(",")).stream().filter(str -> !StringUtils.isEmpty(str)).collect(Collectors.toList());
} }
List<CostDomain> costDomains = costDao.selectAll(userId, projectTypeList); List<CostDomain> costDomains = costDao.selectAll(userId, projectTypeList);
return new PageInfo<>(costDomains.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
CostPageResult result = new CostPageResult();
result.setCosts(costDomains.stream().map(CostDomain::castToDto).collect(Collectors.toList()));
result.setPageInfo(new PageInfo<>(costDomains));
return result;
} }
@Resource
CostReviewerMapper costReviewerMapper;
@Resource
OaUserMapper oaUserMapper;
@Override @Override
public CostDomain getCostByCostNo(String costNo) { public CostDomain getCostByCostNo(String costNo) {
CostDomain costDomain = costDao.selectByCostNo(costNo); CostDomain costDomain = costDao.selectByCostNo(costNo);
costDomain.setCostTemplate(costTemplateService.queryDetail(costDomain.getCostTemplateId())); costDomain.setCostTemplate(costTemplateService.queryDetail(costDomain.getCostTemplateId()));
CostCompanyDomain costCompany = costCompanyDao.selectByNo(costDomain.getCompanyNo());
Integer currentUserId = SessionUtils.getCurrentUserId();
OaUser costUser = oaUserMapper.selectByOaUserId(currentUserId);
if (costDomain.getCostStatus().equals(CostDomain.STATUS_DEPARTMENT_CHECK)) {
costDomain.setCanAudit(costReviewerMapper.queryOne(costUser.getPrimaryDepartmentId(), CostReviewer.departmentReviewer, currentUserId) != null);
} else if (costReviewerMapper.queryOne(costCompany.getId(), CostReviewer.financialReviewer, currentUserId) != null) {
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 {
costDomain.setCanAudit(false);
}
return costDomain; return costDomain;
} }
...@@ -130,6 +158,9 @@ public abstract class AbstractCostService implements CostService { ...@@ -130,6 +158,9 @@ public abstract class AbstractCostService implements CostService {
} }
@Resource
CostTemplateBaseColMapper costTemplateBaseColMapper;
private void setCostDomain(CostDomain costDomain) { private void setCostDomain(CostDomain costDomain) {
if (null != costDomain.getCompanyNo()) { if (null != costDomain.getCompanyNo()) {
costDomain.setCompanyName(costCompanyDao.selectByNo(costDomain.getCompanyNo()).getCompanyName()); costDomain.setCompanyName(costCompanyDao.selectByNo(costDomain.getCompanyNo()).getCompanyName());
...@@ -142,6 +173,14 @@ public abstract class AbstractCostService implements CostService { ...@@ -142,6 +173,14 @@ public abstract class AbstractCostService implements CostService {
costDomain.setTypeNo(costTypeKindDomain.getTypeNo()); costDomain.setTypeNo(costTypeKindDomain.getTypeNo());
} }
} }
if (ListUtil.isNotEmpty(costDomain.getAttach())) {
costDomain.getAttach().forEach(costAttach -> {
CostTemplateBaseCol costTemplateBaseCol = costTemplateBaseColMapper.selectById(costAttach.getCostTemplateBaseColId());
BeanUtils.copyProperties(costTemplateBaseCol, costAttach, "id");
});
}
} }
...@@ -165,7 +204,8 @@ public abstract class AbstractCostService implements CostService { ...@@ -165,7 +204,8 @@ public abstract class AbstractCostService implements CostService {
costDomain.setCostNo(costNo); costDomain.setCostNo(costNo);
costDomain.setAmount(amount); costDomain.setAmount(amount);
costDomain.setKindName(costDetailDomains.get(0).getKindName() + " 等 " + costDetailDomains.size() + " 项"); costDomain.setKindName(costDetailDomains.get(0).getKindName() + " 等 " + costDetailDomains.size() + " 项");
costDao.updateByNo(costDomain); costDao.update(costDomain, new LambdaQueryWrapper<CostDomain>()
.eq(CostDomain::getCostNo, costDomain.getCostNo()));
} }
} }
...@@ -174,7 +214,8 @@ public abstract class AbstractCostService implements CostService { ...@@ -174,7 +214,8 @@ public abstract class AbstractCostService implements CostService {
CostDomain costDomain = new CostDomain(); CostDomain costDomain = new CostDomain();
costDomain.setCostNo(costNo); costDomain.setCostNo(costNo);
costDomain.setCostStatus(i); costDomain.setCostStatus(i);
return costDao.updateByNo(costDomain); return costDao.update(costDomain, new LambdaQueryWrapper<CostDomain>()
.eq(CostDomain::getCostNo, costDomain.getCostNo()));
} }
@Override @Override
...@@ -184,7 +225,10 @@ public abstract class AbstractCostService implements CostService { ...@@ -184,7 +225,10 @@ public abstract class AbstractCostService implements CostService {
@Override @Override
public void updateCashierAnnex(String costNo, String filePath, String downloadUrl) { public void updateCashierAnnex(String costNo, String filePath, String downloadUrl) {
costDao.updateCashierAnnex(costNo, filePath, downloadUrl); CostDomain costDomain = costDao.selectByCostNo(costNo);
costDomain.setCashierFilePath(filePath);
costDomain.setCashierDownloadPath(downloadUrl);
costDao.updateById(costDomain);
} }
@Override @Override
......
...@@ -34,6 +34,13 @@ public class DepartmentCheckState extends CostState { ...@@ -34,6 +34,13 @@ public class DepartmentCheckState extends CostState {
throw new BizRuntimeException("invalid status"); throw new BizRuntimeException("invalid status");
} }
//如果是默认模版 不需要部门审核
if (costTemplate.getIsDefault()) {
//流转状态
nextState(financialCheckState);
costSubscribe.subscribe(costContext);
}
//需要自动审核 //需要自动审核
if (costTemplate.shouldDepartmentAutoCheck()) { if (costTemplate.shouldDepartmentAutoCheck()) {
//自动审核通过 //自动审核通过
......
...@@ -38,6 +38,15 @@ public class FinalCheckState extends CostState { ...@@ -38,6 +38,15 @@ public class FinalCheckState extends CostState {
throw new BizRuntimeException("invalid status"); throw new BizRuntimeException("invalid status");
} }
//如果是默认模版 不需要最终审核
if (costTemplate.getIsDefault()) {
//流转状态
nextState(unPayState);
//通知财务系统
costContext.costService.toFinancial(costDomain);
}
//如果不需要审核 直接通过 //如果不需要审核 直接通过
if (!costTemplate.shouldFinalCheck(costDomain.getAmount())) { if (!costTemplate.shouldFinalCheck(costDomain.getAmount())) {
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY); costDomain.setCostStatus(CostDomain.STATUS_UN_PAY);
...@@ -67,7 +76,7 @@ public class FinalCheckState extends CostState { ...@@ -67,7 +76,7 @@ public class FinalCheckState extends CostState {
CostCompanyDomain costCompany = costCompanyDao.selectByNo(costDomain.getCompanyNo()); CostCompanyDomain costCompany = costCompanyDao.selectByNo(costDomain.getCompanyNo());
//人工审核通过 //人工审核通过
if (costReviewerMapper.queryOne(costCompany.getId(), CostReviewer.financialReviewer, currentUserId) != null) { if (costReviewerMapper.queryOne(costCompany.getId(), CostReviewer.finalReviewer, currentUserId) != null) {
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY); costDomain.setCostStatus(CostDomain.STATUS_UN_PAY);
costDao.updateById(costDomain); costDao.updateById(costDomain);
......
...@@ -40,7 +40,7 @@ public class FinancialCheckState extends CostState { ...@@ -40,7 +40,7 @@ public class FinancialCheckState extends CostState {
} }
//需要自动审核 //需要自动审核
if (costTemplate.shouldFinalAutoCheck()) { if (costTemplate.shouldFinancialAutoCheck()) {
//自动审核通过 //自动审核通过
if (this.autoCheck(costDomain)) { if (this.autoCheck(costDomain)) {
costDomain.setCostStatus(CostDomain.STATUS_FINAL_CHECK); costDomain.setCostStatus(CostDomain.STATUS_FINAL_CHECK);
......
...@@ -190,7 +190,8 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme ...@@ -190,7 +190,8 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
supCost.setCompensate(new BigDecimal(0)); supCost.setCompensate(new BigDecimal(0));
} }
supCost.setCompensate(supCost.getCompensate().add(payPlan.getPlanAmount())); supCost.setCompensate(supCost.getCompensate().add(payPlan.getPlanAmount()));
costDao.updateByNo(supCost); costDao.update(supCost, new LambdaQueryWrapper<CostDomain>()
.eq(CostDomain::getCostNo, supCost.getCostNo()));
} else { } else {
log.info("生成一张补差额的付款单失败:" + costDomain1); log.info("生成一张补差额的付款单失败:" + costDomain1);
......
...@@ -3,6 +3,7 @@ package com.blt.other.module.purchasing.service.impl; ...@@ -3,6 +3,7 @@ package com.blt.other.module.purchasing.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.bailuntec.cost.api.domain.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.util.BuyUtils; import com.blt.other.common.util.BuyUtils;
import com.blt.other.common.util.CurUtils; import com.blt.other.common.util.CurUtils;
import com.blt.other.common.util.MoneyUtil; import com.blt.other.common.util.MoneyUtil;
...@@ -391,7 +392,8 @@ public class BuyServiceImpl implements BuyService { ...@@ -391,7 +392,8 @@ public class BuyServiceImpl implements BuyService {
costDao.insert(backCost); costDao.insert(backCost);
costLogService.save(backCost.getCostNo(), updateUserId, "采购单【" + buyListDto.getBuyno() + "】冲销借支单【" + linkLendCost.getCostNo() + "】时由系统自动生成"); costLogService.save(backCost.getCostNo(), updateUserId, "采购单【" + buyListDto.getBuyno() + "】冲销借支单【" + linkLendCost.getCostNo() + "】时由系统自动生成");
costDao.updateByNo(linkLendCost); costDao.update(linkLendCost, new LambdaQueryWrapper<CostDomain>()
.eq(CostDomain::getCostNo, linkLendCost.getCostNo()));
costLogService.save(linkLendCost.getCostNo(), updateUserId, "财务审核:" + result); costLogService.save(linkLendCost.getCostNo(), updateUserId, "财务审核:" + result);
return result; return result;
} }
......
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