|
@@ -19,6 +19,7 @@ import com.ruoyi.finance.service.ITFeeService;
|
|
|
import com.ruoyi.warehouseBusiness.domain.*;
|
|
|
import com.ruoyi.warehouseBusiness.mapper.BillnoDelMapper;
|
|
|
import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
|
|
|
+import com.ruoyi.warehouseBusiness.mapper.TWarehousebillsfeesMapper;
|
|
|
import com.ruoyi.warehouseBusiness.service.impl.BillnoSerialServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -54,6 +55,9 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
@Autowired
|
|
|
private TWarehouseBillsMapper tWarehouseBillsMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TWarehousebillsfeesMapper tWarehousebillsfeesMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询财务数据主
|
|
|
*
|
|
@@ -145,6 +149,11 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
return tFeeMapper.selectTFeeList(tFee);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> selectTFeeList1(TFee tFee) {
|
|
|
+ return tFeeMapper.selectTFeeList1(tFee);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 新增财务数据主
|
|
|
*
|
|
@@ -251,4 +260,60 @@ public class TFeeServiceImpl implements ITFeeService {
|
|
|
map.put("tWareHouseFees", tWareHouseFees);
|
|
|
return tFeeMapper.warehouseBillsFeesList(map);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult confirm(String tfee, String tfeeDo, LoginUser loginUser, String fBilltype) {
|
|
|
+ // 更新 主表、从表
|
|
|
+ TFee tFee = JSONArray.parseObject(tfee, TFee.class);
|
|
|
+ tFee.setUpdateBy(loginUser.getUser().getUserName());
|
|
|
+ tFee.setUpdateTime(new Date());
|
|
|
+ tFeeMapper.updateTFee(tFee);
|
|
|
+ // 删除从表
|
|
|
+ tFeeDoMapper.deleteByFPid(tFee.getfId());
|
|
|
+ // 财务从表
|
|
|
+ if (StringUtils.isNotNull(tfeeDo)) {
|
|
|
+ JSONArray jsonDrArray = JSONArray.parseArray(tfeeDo);
|
|
|
+ List<TFeeDo> tFeeDoList = JSONObject.parseArray(jsonDrArray.toJSONString(), TFeeDo.class);
|
|
|
+ for (TFeeDo tFeeDo : tFeeDoList) {
|
|
|
+ tFeeDo.setfPid(tFee.getfId());
|
|
|
+ tFeeDo.setCreateBy(loginUser.getUser().getUserName());
|
|
|
+ tFeeDo.setCreateTime(new Date());
|
|
|
+ tFeeDoMapper.insertTFeeDo(tFeeDo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 更新费用明细
|
|
|
+ updateBillsFees(tFee.getfId(),fBilltype);
|
|
|
+
|
|
|
+ // 审批流程
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void updateBillsFees(Long fid,String billsType){
|
|
|
+ // 查询从表数据
|
|
|
+ TFee tFee=tFeeMapper.selectTFeeById(fid);
|
|
|
+ TFeeDo tFeeDo = new TFeeDo();
|
|
|
+ tFeeDo.setfPid(fid);
|
|
|
+ List<TFeeDo> tFeeDoList= tFeeDoMapper.selectTFeeDoList(tFeeDo);
|
|
|
+ // 更新费用明细
|
|
|
+ for (TFeeDo tFeeDo1 : tFeeDoList ){
|
|
|
+ // 查询仓库费用明细表数据
|
|
|
+ TWarehousebillsfees tWarehousebillsfees=new TWarehousebillsfees();
|
|
|
+ tWarehousebillsfees.setfId(tFeeDo1.getfSrcid());
|
|
|
+ if(billsType.equals("DZ")){
|
|
|
+ tWarehousebillsfees.setfStatementNo(tFee.getfBillno());
|
|
|
+ tWarehousebillsfees.setfAccamountDate(tFee.getfAccbilldate());
|
|
|
+ } else {
|
|
|
+ tWarehousebillsfees.setfStlamountNo(tFee.getfBillno());
|
|
|
+ // tWarehousebillsfees.setfStlamount();
|
|
|
+ tWarehousebillsfees.setfStlamountDate(tFee.getfAccbilldate());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|