Commit 2d7a2b9a by wutong

费用单处理新增判断, 若是已支付状态就不准改

parent 364cc7ea
......@@ -12,6 +12,7 @@ import com.blt.other.other_cost.vo.ApplyMoneyDetail;
import com.blt.other.other_cost.vo.CashierCallbackUrlVo;
import com.blt.other.other_database.model.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
......@@ -116,6 +117,20 @@ public class CostCheckController {
Map<String, Object> map = null;
String costNo = request.getParameter("costNo");
String updateuserid = request.getParameter("updateuserid");
Integer costStatus = costService.getCostStatusByNo(costNo);
/**
* 吴通新增
* 如果是支付状态, 就不准改
*/
if (null != costStatus && costStatus.equals(4)) {
map = new HashMap<>();
map.put("msg","error");
map.put("result",0);
map.put("finance",false);
costLogService.save(costNo,Integer.parseInt(updateuserid),"尝试修改已支付费用单,被拦截");
return map;
}
costLogService.save(costNo,Integer.parseInt(updateuserid),"费用系统财务审核通过");
// 审核通过,自动提交到出纳付款
......@@ -392,7 +407,7 @@ public class CostCheckController {
* @param costNo
* @return
*/
private boolean tofinanceMethod(String costNo){
public boolean tofinanceMethod(String costNo){
// 获取费用单信息
List<ApplyMoneyDetail> applyMoneyDetailList = new ArrayList<>();
ApplyMoneyDetail applyMoneyDetail = new ApplyMoneyDetail();
......
......@@ -113,4 +113,6 @@ public interface CostDao {
* @return
*/
List<CostDomain> selectNoPayCost(@Param("list") List<String> costNoList);
Integer selectCostStatusByNo(@Param("costNo") String costNo);
}
......@@ -2,8 +2,12 @@ package com.blt.other.other_cost.dao;
import com.blt.other.other_database.model.CostTofinanceDomain;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface CostTofinanceDao {
......@@ -14,4 +18,11 @@ public interface CostTofinanceDao {
* @return
*/
Integer insert(CostTofinanceDomain costTofinanceDomain);
/**
* 手动查费用单重新提交
*/
@Select("SELECT cost_no FROM cost WHERE cost_no in \n" +
"('F006565','F007080','F008044','F008045','F008046','F008277','SF008984')")
List<String> listErrorFee();
}
......@@ -97,4 +97,6 @@ public interface CostService {
CostDomain getLastCost();
List<CostDto> getLinkLendCost(Integer createuserid);
Integer getCostStatusByNo(String costNo);
}
......@@ -352,6 +352,11 @@ public class CostServiceImpl implements CostService {
}
@Override
public Integer getCostStatusByNo(String costNo) {
return costDao.selectCostStatusByNo(costNo);
}
@Override
public CostDomain getCostDomainByNo(String costNo) {
CostDomain costDomain = costDao.selectByCostNo(costNo);
return costDomain;
......
......@@ -433,4 +433,9 @@
#{costNo}
</foreach>
</select>
<select id="selectCostStatusByNo" resultType="integer">
select cost_status from cost where cost_no=#{costNo}
</select>
</mapper>
\ No newline at end of file
package com.blt.other;
import com.blt.other.other_cost.controller.CostCheckController;
import com.blt.other.other_cost.dao.CostTofinanceDao;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.util.List;
import java.util.Map;
@RunWith(SpringRunner.class)
@SpringBootTest
public class OtherApplicationTests {
@Autowired
private CostCheckController costCheckController;
@Autowired
private CostTofinanceDao costTofinanceDao;
/**
* 泽凯财务系统错误驳回
* 手动提交
*/
@Test
public void test() {
List<String> strings = costTofinanceDao.listErrorFee();
for (String string : strings) {
costCheckController.tofinanceMethod(string);
}
}
/**
* 测试已支付单不准修改
*/
@Test
public void test2() {
HttpServletRequest request = new MockHttpServletRequest();
request.setAttribute("costNo", "F009455");
request.setAttribute("updateuserid", "2653");
Map<String, Object> pass = costCheckController.pass(request, null);
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