|
@@ -29,6 +29,7 @@ import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
@@ -234,11 +235,17 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService {
|
|
}
|
|
}
|
|
// 删除从表
|
|
// 删除从表
|
|
fTmsaccbillsitemsMapper.deleteByFPid(fPid);
|
|
fTmsaccbillsitemsMapper.deleteByFPid(fPid);
|
|
|
|
+ // 本次对账金额合计
|
|
|
|
+ BigDecimal amt = new BigDecimal(0);
|
|
|
|
+ // 应对账金额合计
|
|
|
|
+ BigDecimal amtDr = new BigDecimal(0);
|
|
// 财务从表
|
|
// 财务从表
|
|
if (StringUtils.isNotNull(tfeeDo)) {
|
|
if (StringUtils.isNotNull(tfeeDo)) {
|
|
JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo);
|
|
JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo);
|
|
List<FTmsaccbillsitems> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), FTmsaccbillsitems.class);
|
|
List<FTmsaccbillsitems> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), FTmsaccbillsitems.class);
|
|
for (FTmsaccbillsitems tFeeDo : tFeeDoList) {
|
|
for (FTmsaccbillsitems tFeeDo : tFeeDoList) {
|
|
|
|
+ amt = amt.add(tFeeDo.getFAmt());
|
|
|
|
+ amtDr = amtDr.add(tFeeDo.getFAmtdr());
|
|
tFeeDo.setFPid(fPid);
|
|
tFeeDo.setFPid(fPid);
|
|
tFeeDo.setFStatus("2");
|
|
tFeeDo.setFStatus("2");
|
|
tFeeDo.setCreateTime(new Date());
|
|
tFeeDo.setCreateTime(new Date());
|
|
@@ -246,6 +253,10 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService {
|
|
fTmsaccbillsitemsMapper.insertFTmsaccbillsitems(tFeeDo);
|
|
fTmsaccbillsitemsMapper.insertFTmsaccbillsitems(tFeeDo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ fTmsaccbills.setfAmtcr(amt);
|
|
|
|
+ fTmsaccbills.setfAmtdr(amtDr);
|
|
|
|
+ System.out.println("更新金额:" + fTmsaccbills.toString());
|
|
|
|
+ fTmsaccbillsMapper.updateFTmsaccbills(fTmsaccbills);
|
|
map.put("tFee", fTmsaccbillsMapper.selectFTmsaccbillsById(fPid));
|
|
map.put("tFee", fTmsaccbillsMapper.selectFTmsaccbillsById(fPid));
|
|
return AjaxResult.success("成功", map);
|
|
return AjaxResult.success("成功", map);
|
|
}
|
|
}
|
|
@@ -312,7 +323,13 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService {
|
|
// 财务从表
|
|
// 财务从表
|
|
JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo);
|
|
JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo);
|
|
List<FTmsaccbillsitems> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), FTmsaccbillsitems.class);
|
|
List<FTmsaccbillsitems> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), FTmsaccbillsitems.class);
|
|
|
|
+ // 本次对账金额合计
|
|
|
|
+ BigDecimal amt = new BigDecimal(0);
|
|
|
|
+ // 应对账金额合计
|
|
|
|
+ BigDecimal amtDr = new BigDecimal(0);
|
|
for (FTmsaccbillsitems tFeeDo : tFeeDoList) {
|
|
for (FTmsaccbillsitems tFeeDo : tFeeDoList) {
|
|
|
|
+ amt = amt.add(tFeeDo.getFAmt());
|
|
|
|
+ amtDr = amtDr.add(tFeeDo.getFAmtdr());
|
|
tFeeDo.setCreateTime(new Date());
|
|
tFeeDo.setCreateTime(new Date());
|
|
tFeeDo.setFPid(fTmsaccbills.getId());
|
|
tFeeDo.setFPid(fTmsaccbills.getId());
|
|
tFeeDo.setCreateBy(user.getUserName());
|
|
tFeeDo.setCreateBy(user.getUserName());
|
|
@@ -324,6 +341,9 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService {
|
|
return AjaxResult.error("更新费用明细失败");
|
|
return AjaxResult.error("更新费用明细失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ fTmsaccbills.setfAmtcr(amt);
|
|
|
|
+ fTmsaccbills.setfAmtdr(amtDr);
|
|
|
|
+ fTmsaccbillsMapper.updateFTmsaccbills(fTmsaccbills);
|
|
AjaxResult ajaxResult = tfeeFollow(fTmsaccbills.getId(), 6L);
|
|
AjaxResult ajaxResult = tfeeFollow(fTmsaccbills.getId(), 6L);
|
|
String code = ajaxResult.get("code").toString();
|
|
String code = ajaxResult.get("code").toString();
|
|
if ("500".equals(code)) {
|
|
if ("500".equals(code)) {
|
|
@@ -336,8 +356,10 @@ public class FTmsaccbillsServiceImpl implements IFTmsaccbillsService {
|
|
public int updateBillsFees(Long fid, FTmsaccbillsitems tFeeDo, String billsType) {
|
|
public int updateBillsFees(Long fid, FTmsaccbillsitems tFeeDo, String billsType) {
|
|
// 查询从表数据
|
|
// 查询从表数据
|
|
FTmsaccbills tFee = fTmsaccbillsMapper.selectFTmsaccbillsById(fid);
|
|
FTmsaccbills tFee = fTmsaccbillsMapper.selectFTmsaccbillsById(fid);
|
|
- if ("SFDZ".equals(billsType) || "JSFF".equals(billsType) || "JSSF".equals(billsType)) {
|
|
|
|
|
|
+ if ("SFDZ".equals(billsType)) {
|
|
billsType = "DZ";
|
|
billsType = "DZ";
|
|
|
|
+ } else if ("JSFF".equals(billsType) || "JSSF".equals(billsType)) {
|
|
|
|
+ billsType = "DC";
|
|
}
|
|
}
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("tFee", tFee);
|
|
map.put("tFee", tFee);
|