Commit 09950487 by tbl

合并代码

parent b28cf9fe
package com.blt.other.other_cost.controller; package com.blt.other.other_cost.controller;
import com.blt.other.other_auth.service.UserService;
import com.blt.other.other_commons.utils.AxiosUtil; import com.blt.other.other_commons.utils.AxiosUtil;
import com.blt.other.other_commons.utils.PathUtil; import com.blt.other.other_commons.utils.PathUtil;
import com.blt.other.other_cost.service.CostDetailService; import com.blt.other.other_cost.service.CostDetailService;
...@@ -10,6 +11,8 @@ import com.blt.other.other_cost.utils.CostFileUtil; ...@@ -10,6 +11,8 @@ import com.blt.other.other_cost.utils.CostFileUtil;
import com.blt.other.other_database.model.CostDetailDomain; import com.blt.other.other_database.model.CostDetailDomain;
import com.blt.other.other_database.model.CostPlanTempDomain; import com.blt.other.other_database.model.CostPlanTempDomain;
import com.blt.other.other_database.model.CostTypeKindDomain; import com.blt.other.other_database.model.CostTypeKindDomain;
import com.blt.other.other_database.model.UserDomain;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.InputStreamResource; import org.springframework.core.io.InputStreamResource;
...@@ -41,14 +44,34 @@ public class CostDetailController { ...@@ -41,14 +44,34 @@ public class CostDetailController {
private CostService costService; private CostService costService;
@Autowired @Autowired
private CostLogService costLogService; private CostLogService costLogService;
@Autowired
private UserService userService;
@PostMapping("/getCostDetailList") @PostMapping("/getCostDetailList")
public Map<String,Object> getCostDetailList(HttpServletResponse response, HttpServletRequest request){ public Map<String,Object> getCostDetailList(HttpServletResponse response, HttpServletRequest request,Integer userId){
AxiosUtil.setCors(response,request); AxiosUtil.setCors(response,request);
String costNo = request.getParameter("costNo"); String costNo = request.getParameter("costNo");
List<CostDetailDomain> costDetailListByCostNo = costDetailService.getCostDetailListByCostNo(costNo); List<CostDetailDomain> costDetailListByCostNo = costDetailService.getCostDetailListByCostNo(costNo);
Map<String,Object> result = new HashMap<>(); Map<String,Object> result = new HashMap<>();
UserDomain user = userService.findByUserid(userId);
for (CostDetailDomain detail : costDetailListByCostNo) {
if (detail != null && costDetailListByCostNo.size() > 0){
//类型标题 大类
String typeName = detail.getTypeName();
//种类标题 小类
String kindName = detail.getKindName();
if ((typeName.contains("工资") || kindName.contains("工资")) && !(user.getUseraccount().equals("程文爱") || user.getUseraccount().equals("苏佩虹") || user.getUseraccount().equals("张晓雯") || user.getUseraccount().equals("王埕") || user.getUseraccount().equals("赵伟铭") || user.getUseraccount().equals("李静雯") || user.getUseraccount().equals("董梓玲")||user.getUseraccount().equals("简金源") ||detail.getCreateUsername().equals(user.getUseraccount()))){
detail.setFilePath("");
}
if (detail.getFilePath()== null){
detail.setFilePath("");
}
}
}
result.put("costDetails",costDetailListByCostNo); result.put("costDetails",costDetailListByCostNo);
return result; return result;
} }
......
...@@ -276,6 +276,31 @@ public class CostListController { ...@@ -276,6 +276,31 @@ public class CostListController {
} }
return null; return null;
} }
@PostMapping("/exportListAll")
public String exportListAll(HttpServletResponse response, HttpServletRequest request) throws IOException {
AxiosUtil.setCors(response,request);
Enumeration<String> parameterNames = request.getParameterNames();
if (null != parameterNames && parameterNames.hasMoreElements()) {
String s = parameterNames.nextElement();
CostExportVo costExportVo = (CostExportVo) MyMapperUtil.getObject(s, CostExportVo.class);
List<String> exportNos = costExportVo.getParams().getExportNos();
if (null != costExportVo.getParams().getKeys().getCostForm() && 3 ==costExportVo.getParams().getKeys().getCostForm()){
costExportVo.getParams().getKeys().setIsLend(1);
}
if (null != costExportVo.getParams().getKeys().getCostForm() && 4 ==costExportVo.getParams().getKeys().getCostForm()){
costExportVo.getParams().getKeys().setCostForm(3);
costExportVo.getParams().getKeys().setIsLend(2);
}
List<String> costNo = costService.listCostNoAll(costExportVo);
exportNos = costNo;
String filePath = costExportService.exportFees(exportNos);
// 保存下载记录
CostExpDomain exp = costExportService.saveRecord(costExportVo,filePath);
return exp.getExpNo();
}
return null;
}
@GetMapping("download") @GetMapping("download")
public ResponseEntity<InputStreamResource> download(HttpServletRequest request, HttpServletResponse response) throws IOException { public ResponseEntity<InputStreamResource> download(HttpServletRequest request, HttpServletResponse response) throws IOException {
......
...@@ -62,10 +62,16 @@ public class CostListPrintController { ...@@ -62,10 +62,16 @@ public class CostListPrintController {
CostListPrintDto print = new CostListPrintDto(); CostListPrintDto print = new CostListPrintDto();
CostDto cost = costService.getCostDtoByNo(costNo); CostDto cost = costService.getCostDtoByNo(costNo);
UserDomain user = userService.findByUserid(cost.getCreateUserid()); UserDomain user = userService.findByUserid(cost.getCreateUserid());
if (user == null){
print.setDepartment("");
print.setCreateUsername(cost.getCreateUsername()+"【注销】");
}else {
print.setDepartment(user.getDepartmentname1());
print.setCreateUsername(cost.getCreateUsername());
}
print.setId(cost.getId()); print.setId(cost.getId());
print.setCompanyName(cost.getCompanyName()); print.setCompanyName(cost.getCompanyName());
print.setDepartment(user.getDepartmentname1()); //print.setDepartment(user.getDepartmentname1());
print.setCreateUsername(cost.getCreateUsername());
print.setCostNo(costNo); print.setCostNo(costNo);
print.setCreateTime(cost.getCreateTime()); print.setCreateTime(cost.getCreateTime());
print.setBankCompany(cost.getBankCompany()); print.setBankCompany(cost.getBankCompany());
......
...@@ -2,6 +2,7 @@ package com.blt.other.other_cost.dao; ...@@ -2,6 +2,7 @@ package com.blt.other.other_cost.dao;
import com.blt.other.other_cost.dto.CostDto; import com.blt.other.other_cost.dto.CostDto;
import com.blt.other.other_cost.dto.ManageCostDto; import com.blt.other.other_cost.dto.ManageCostDto;
import com.blt.other.other_cost.vo.CostExportVo;
import com.blt.other.other_database.model.CostDomain; import com.blt.other.other_database.model.CostDomain;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -13,7 +14,6 @@ import java.util.List; ...@@ -13,7 +14,6 @@ import java.util.List;
@Mapper @Mapper
@Repository @Repository
public interface CostDao { public interface CostDao {
/** /**
* insert 费用单记录 * insert 费用单记录
* @param costDomain * @param costDomain
...@@ -124,6 +124,7 @@ public interface CostDao { ...@@ -124,6 +124,7 @@ public interface CostDao {
List<CostDto> getCostByRejectStatus(); List<CostDto> getCostByRejectStatus();
List<String> listCostNo(); List<String> listCostNo();
List<String> listCostNoAll(CostExportVo costExportVo);
Integer updateCashierAnnex(@Param("costNo") String costNo, @Param("filePath") String filePath, @Param("downloadUrl") String downloadUrl); Integer updateCashierAnnex(@Param("costNo") String costNo, @Param("filePath") String filePath, @Param("downloadUrl") String downloadUrl);
} }
...@@ -13,4 +13,5 @@ public interface CostExportService { ...@@ -13,4 +13,5 @@ public interface CostExportService {
String createExpNo(); String createExpNo();
CostExpDomain getByExpNo(String expNo); CostExpDomain getByExpNo(String expNo);
} }
package com.blt.other.other_cost.service; package com.blt.other.other_cost.service;
import com.blt.other.other_cost.dto.CostDto; import com.blt.other.other_cost.dto.CostDto;
import com.blt.other.other_cost.vo.CostExportVo;
import com.blt.other.other_database.model.CostDomain; import com.blt.other.other_database.model.CostDomain;
import java.util.List; import java.util.List;
...@@ -103,6 +104,7 @@ public interface CostService { ...@@ -103,6 +104,7 @@ public interface CostService {
List<CostDto> getCostByRejectStatus(); List<CostDto> getCostByRejectStatus();
List<String> listCostNo(); List<String> listCostNo();
List<String> listCostNoAll(CostExportVo costExportVo);
Integer updateCashierAnnex(String costNo, String filePath, String downloadUrl); Integer updateCashierAnnex(String costNo, String filePath, String downloadUrl);
} }
...@@ -5,6 +5,7 @@ import com.blt.other.other_commons.utils.CurUtils; ...@@ -5,6 +5,7 @@ import com.blt.other.other_commons.utils.CurUtils;
import com.blt.other.other_cost.dao.*; import com.blt.other.other_cost.dao.*;
import com.blt.other.other_cost.dto.CostDto; import com.blt.other.other_cost.dto.CostDto;
import com.blt.other.other_cost.service.CostService; import com.blt.other.other_cost.service.CostService;
import com.blt.other.other_cost.vo.CostExportVo;
import com.blt.other.other_database.mapper.StatusMapper; import com.blt.other.other_database.mapper.StatusMapper;
import com.blt.other.other_database.model.CostDetailDomain; import com.blt.other.other_database.model.CostDetailDomain;
import com.blt.other.other_database.model.CostDomain; import com.blt.other.other_database.model.CostDomain;
...@@ -365,6 +366,10 @@ public class CostServiceImpl implements CostService { ...@@ -365,6 +366,10 @@ public class CostServiceImpl implements CostService {
public List<String> listCostNo() { public List<String> listCostNo() {
return costDao.listCostNo(); return costDao.listCostNo();
} }
@Override
public List<String> listCostNoAll(CostExportVo costExportVo) {
return costDao.listCostNoAll(costExportVo);
}
@Override @Override
public Integer updateCashierAnnex(String costNo, String filePath, String downloadUrl) { public Integer updateCashierAnnex(String costNo, String filePath, String downloadUrl) {
......
package com.blt.other.other_cost.vo; package com.blt.other.other_cost.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -27,6 +30,8 @@ public class CostExportVo { ...@@ -27,6 +30,8 @@ public class CostExportVo {
public class ExportNos { public class ExportNos {
private List<String> exportNos; private List<String> exportNos;
private Integer userid; private Integer userid;
private String key;
private Keys keys;
public List<String> getExportNos() { public List<String> getExportNos() {
return exportNos; return exportNos;
...@@ -44,12 +49,172 @@ public class CostExportVo { ...@@ -44,12 +49,172 @@ public class CostExportVo {
this.userid = userid; this.userid = userid;
} }
public String getKey(){
return key;
}
public void setKey(String key){
this.key = key;
}
public void setKeys(Keys keys){
this.keys = keys;
}
public Keys getKeys(){
return keys;
}
@Override @Override
public String toString() { public String toString() {
return "ExportNos{" + return "ExportNos{" +
"exportNos=" + exportNos + "exportNos=" + exportNos +
", userid=" + userid + ", userid=" + userid +
", key=" + key +
", keys=" + keys +
'}'; '}';
} }
public class Keys{
private String companyNo;
private Integer costForm;
private String createUsercode;
private String kindNo;
private Integer costStatus;
private Integer lendStatus;
private Integer isTax;
private Integer isLend;
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private Date beginTime;
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private Date endTime;
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private Date beginPayTime;
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private Date endPayTime;
private String linkCost;
public String getCompanyNo() {
return companyNo;
}
public void setCompanyNo(String companyNo) {
this.companyNo = companyNo;
}
public Integer getCostForm() {
return costForm;
}
public void setCostForm(Integer costForm) {
this.costForm = costForm;
}
public String getCreateUsercode() {
return createUsercode;
}
public void setCreateUsercode(String createUsercode) {
this.createUsercode = createUsercode;
}
public String getKindNo() {
return kindNo;
}
public void setKindNo(String kindNo) {
this.kindNo = kindNo;
}
public Integer getCostStatus() {
return costStatus;
}
public void setCostStatus(Integer costStatus) {
this.costStatus = costStatus;
}
public Integer getIsTax() {
return isTax;
}
public void setIsTax(Integer isTax) {
this.isTax = isTax;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Date getBeginPayTime() {
return beginPayTime;
}
public void setBeginPayTime(Date beginPayTime) {
this.beginPayTime = beginPayTime;
}
public Date getEndPayTime() {
return endPayTime;
}
public void setEndPayime(Date endPayTime) {
this.endPayTime = endPayTime;
}
public Integer getLendStatus() {
return lendStatus;
}
public void setLendStatus(Integer lendStatus) {
this.lendStatus = lendStatus;
}
public Integer getIsLend() {
return isLend;
}
public void setIsLend(Integer isLend) {
this.isLend = isLend;
}
public String getLinkCost() {
return linkCost;
}
public void setLinkCost(String linkCost) {
this.linkCost = linkCost;
}
@Override
public String toString() {
return "Keys{" +
"companyNo='" + companyNo + '\'' +
", costForm=" + costForm +
", createUsercode='" + createUsercode + '\'' +
", kindNo='" + kindNo + '\'' +
", costStatus=" + costStatus +
", lendStatus=" + lendStatus +
", isTax=" + isTax +
", isLend=" + isLend +
", beginTime=" + beginTime +
", endTime=" + endTime +
", beginPayTime=" + beginPayTime +
", endPayTime=" + endPayTime +
", linkCost='" + linkCost + '\'' +
'}';
}
}
} }
} }
...@@ -313,12 +313,12 @@ public class BuyServiceImpl implements BuyService { ...@@ -313,12 +313,12 @@ public class BuyServiceImpl implements BuyService {
result += ",借支单已结清"; result += ",借支单已结清";
} else if(counteract.compareTo(subtract) == 1){ } else if(counteract.compareTo(subtract) == 1){
// 冲销金额>借支单待还金额,不允许关联借支单 // 冲销金额>借支单待还金额,不允许关联借支单
result = "采购单的金额大于借支单待还金额,不允许进行冲销,请驳回"; /*result = "采购单的金额大于借支单待还金额,不允许进行冲销,请驳回";
return result; return result;*/
/*// 冲销金额>借支单待还金额,借支单改为待补差额状态,生成一张待提交的付款计划单 // 冲销金额>借支单待还金额,借支单改为待补差额状态,生成一张待提交的付款计划单
linkLendCost.setLendStatus(3); linkLendCost.setLendStatus(3);
// 生成一张已完成的借还单,金额为借支单剩余待还金额,不包含待补差额 // 生成一张已完成的借还单,金额为借支单剩余待还金额,不包含待补差额
backCost = generateBackCost(buyListDto, linkLendCost, exRate); backCost = generateBackCost(buyListDto, linkLendCost,counteract, exRate);
backCost.setAmount(subtract); backCost.setAmount(subtract);
backCost.setCounteract(subtract); backCost.setCounteract(subtract);
backCost.setPayPlanAmount(subtract.divide(exRate, 4)); backCost.setPayPlanAmount(subtract.divide(exRate, 4));
...@@ -349,10 +349,10 @@ public class BuyServiceImpl implements BuyService { ...@@ -349,10 +349,10 @@ public class BuyServiceImpl implements BuyService {
payPlan.setCounteract(new BigDecimal(0)); payPlan.setCounteract(new BigDecimal(0));
payPlan.setPayCounteract(new BigDecimal(0)); payPlan.setPayCounteract(new BigDecimal(0));
payPlan.setIsTax(0); payPlan.setIsTax(0);
payPlan.setTypeNo(null); payPlan.setTypeNo("CTN1809140510102");
payPlan.setTypeName(null); payPlan.setTypeName("办公费");
payPlan.setKindNo(null); payPlan.setKindNo("CTK1809141710103");
payPlan.setKindName(null); payPlan.setKindName("办公用品");
payPlan.setCostReason("借支差额:" + payPlan.getSupCostNo()); payPlan.setCostReason("借支差额:" + payPlan.getSupCostNo());
Integer insertCostPlan = costPlanDao.insert(payPlan); Integer insertCostPlan = costPlanDao.insert(payPlan);
if (null != insertCostPlan && insertCostPlan == 1) { if (null != insertCostPlan && insertCostPlan == 1) {
...@@ -378,7 +378,7 @@ public class BuyServiceImpl implements BuyService { ...@@ -378,7 +378,7 @@ public class BuyServiceImpl implements BuyService {
result = "采购单关联借支单时,生成一张补差额的付款计划单失败"; result = "采购单关联借支单时,生成一张补差额的付款计划单失败";
return result; return result;
} }
result += ",借支单待补差额" + linkLendCost.getCompensate().setScale(2, BigDecimal.ROUND_HALF_UP).toString() + linkLendCost.getDic();*/ result += ",借支单待补差额" + linkLendCost.getCompensate().setScale(2, BigDecimal.ROUND_HALF_UP).toString() + linkLendCost.getDic();
} }
costDao.insert(backCost); costDao.insert(backCost);
costLogService.save(backCost.getCostNo(), updateUserId, "采购单【" + buyListDto.getBuyno() + "】冲销借支单【" + linkLendCost.getCostNo() + "】时由系统自动生成"); costLogService.save(backCost.getCostNo(), updateUserId, "采购单【" + buyListDto.getBuyno() + "】冲销借支单【" + linkLendCost.getCostNo() + "】时由系统自动生成");
...@@ -513,10 +513,10 @@ public class BuyServiceImpl implements BuyService { ...@@ -513,10 +513,10 @@ public class BuyServiceImpl implements BuyService {
String result = null; String result = null;
if(counteract.compareTo(BigDecimal.ZERO) != 1){ if(counteract.compareTo(BigDecimal.ZERO) != 1){
result = "采购单金额必须大于0,请修改"; result = "采购单金额必须大于0,请修改";
} else if(counteract.compareTo(subtract) == 1){ } /*else if(counteract.compareTo(subtract) == 1){
// 冲销金额>借支单待还金额,不允许关联借支单 // 冲销金额>借支单待还金额,不允许关联借支单
result = "采购单的金额大于借支单待还金额,不允许进行冲销"; result = "采购单的金额大于借支单待还金额,不允许进行冲销";
} }*/
return result; return result;
} }
......
...@@ -563,6 +563,41 @@ ...@@ -563,6 +563,41 @@
<select id="listCostNo" resultType="java.lang.String"> <select id="listCostNo" resultType="java.lang.String">
select cost_no from cost where cost_form = 1 and cost_status = 4 and cashier_file_path = '' select cost_no from cost where cost_form = 1 and cost_status = 4 and cashier_file_path = ''
</select> </select>
<select id="listCostNoAll" resultType="java.lang.String">
select cost_no from cost
WHERE
id >= 0
<if test=" params.keys.costForm!=null and params.keys.costForm != ''">and cost_form= #{params.keys.costForm}</if>
<if test=" params.keys.companyNo!=null and params.keys.companyNo != ''">and company_no=#{params.keys.companyNo}</if>
<if test=" params.keys.createUsercode!=null and params.keys.createUsercode != ''">and create_usercode=#{params.keys.createUsercode}</if>
<if test=" params.keys.kindNo!=null and params.keys.kindNo != ''">and kind_no=#{params.keys.kindNo}</if>
<if test=" params.keys.costStatus!=null and params.keys.costStatus != '' and params.keys.costStatus != 10">and cost_status=#{params.keys.costStatus}</if>
<if test=" params.keys.costStatus!=null and params.keys.costStatus != '' and params.keys.costStatus == 10">and cost_status=0</if>
<if test=" params.keys.lendStatus!=null and params.keys.lendStatus != ''">and lend_status=#{params.keys.lendStatus}</if>
<if test=" params.keys.isTax!=null and params.keys.isTax == 0">and is_tax=0</if>
<if test=" params.keys.isTax!=null and params.keys.isTax == 1">and is_tax=1</if>
<if test=" params.keys.isLend!=null and params.keys.isLend == 1">and is_lend=1</if>
<if test=" params.keys.isLend!=null and params.keys.isLend == 2">and is_lend=2</if>
<if test=" params.keys.beginTime != null">AND create_time <![CDATA[>=]]> #{params.keys.beginTime}</if>
<if test=" params.keys.endTime != null">AND create_time <![CDATA[<=]]>#{params.keys.endTime}</if>
<if test=" params.keys.beginPayTime != null">AND pay_time <![CDATA[>=]]> #{params.keys.beginPayTime}</if>
<if test=" params.keys.endPayTime != null">AND pay_time <![CDATA[<=]]>#{params.keys.endPayTime}</if>
<if test=" params.keys.linkCost!=null and params.keys.linkCost != ''">and sup_cost_no=#{params.keys.linkCost}</if>
<if test=" params.key!=null and params.key != ''">
and (cost_plan_no = #{params.key}
OR
cost_no LIKE CONCAT('%',#{params.key},'%')
OR
create_username LIKE CONCAT('%',#{params.key},'%')
OR
type_name LIKE CONCAT('%',#{params.key},'%')
OR
kind_name LIKE CONCAT('%',#{params.key},'%')
OR
company_name LIKE CONCAT('%',#{params.key},'%'))
</if>
</select>
<update id="updateCashierAnnex"> <update id="updateCashierAnnex">
update cost set cashier_file_path = #{filePath}, cashier_download_path = #{downloadUrl} where cost_no = #{costNo} update cost set cashier_file_path = #{filePath}, cashier_download_path = #{downloadUrl} where cost_no = #{costNo}
......
...@@ -30,10 +30,10 @@ public class OtherApplicationTests { ...@@ -30,10 +30,10 @@ public class OtherApplicationTests {
*/ */
@Test @Test
public void test() { public void test() {
List<String> strings = costTofinanceDao.listErrorFee(); /*List<String> strings = costTofinanceDao.listErrorFee();
for (String string : strings) { for (String string : strings) {
costCheckController.tofinanceMethod(string); costCheckController.tofinanceMethod(string);
} }*/
} }
/** /**
...@@ -41,10 +41,10 @@ public class OtherApplicationTests { ...@@ -41,10 +41,10 @@ public class OtherApplicationTests {
*/ */
@Test @Test
public void test2() { public void test2() {
HttpServletRequest request = new MockHttpServletRequest(); /* HttpServletRequest request = new MockHttpServletRequest();
request.setAttribute("costNo", "F009455"); request.setAttribute("costNo", "F009455");
request.setAttribute("updateuserid", "2653"); request.setAttribute("updateuserid", "2653");
Map<String, Object> pass = costCheckController.pass(request, null); Map<String, Object> pass = costCheckController.pass(request, null);
System.out.println(pass); System.out.println(pass);*/
} }
} }
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