Explorar el Código

[CODE]: 付费模块

maxianghua hace 4 años
padre
commit
ac8778bb74

+ 105 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/finance/TPaymentController.java

@@ -0,0 +1,105 @@
+package com.ruoyi.web.controller.warehouse.finance;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.annotation.RepeatSubmit;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.finance.domain.TFee;
+import com.ruoyi.finance.domain.TWareHouseFees;
+import com.ruoyi.finance.service.ITFeeService;
+import com.ruoyi.framework.web.service.TokenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 财务付费数据主Controller
+ *
+ * @author ruoyi
+ * @date 2021-01-18
+ */
+@RestController
+@RequestMapping("/finance/payment")
+public class TPaymentController extends BaseController {
+    @Autowired
+    private ITFeeService tFeeService;
+
+    /**
+     * 查询财务数据主列表
+     */
+    @PreAuthorize("@ss.hasPermi('finance:payment:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TFee tFee) {
+        tFee.setfBilltype("FF");
+        startPage();
+        List<TFee> list = tFeeService.selectTFeeList(tFee);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出财务数据主列表
+     */
+    @PreAuthorize("@ss.hasPermi('finance:payment:export')")
+    @Log(title = "财务数据主", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TFee tFee) {
+        List<TFee> list = tFeeService.selectTFeeList(tFee);
+        ExcelUtil<TFee> util = new ExcelUtil<TFee>(TFee.class);
+        return util.exportExcel(list, "fee");
+    }
+
+    /**
+     * 获取财务数据主详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('finance:payment:query')")
+    @GetMapping(value = "/{fId}")
+    public AjaxResult getInfo(@PathVariable("fId") Long fId) {
+        return AjaxResult.success(tFeeService.selectTFeeById(fId));
+    }
+
+    /**
+     * 新增财务数据主
+     */
+    @PreAuthorize("@ss.hasPermi('finance:payment:add')")
+    @Log(title = "财务数据主", businessType = BusinessType.INSERT)
+    @PostMapping(value = "/add")
+    @RepeatSubmit
+    public AjaxResult add(@RequestParam("tFee") String tFee,
+                          @RequestParam("tFeeDo") String tFeeDo ) {
+        String billsType = "FF";
+        // 获取当前的用户
+        LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
+        return tFeeService.insertTFeeTFeeDo(tFee,tFeeDo,loginUser,billsType);
+    }
+
+    /**
+     * 修改财务数据主
+     */
+    @PreAuthorize("@ss.hasPermi('finance:payment:edit')")
+    @Log(title = "财务数据主", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TFee tFee) {
+        return toAjax(tFeeService.updateTFee(tFee));
+    }
+
+    /**
+     * 删除财务数据主
+     */
+    @PreAuthorize("@ss.hasPermi('finance:payment:remove')")
+    @Log(title = "财务数据主", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{fIds}")
+    public AjaxResult remove(@PathVariable Long[] fIds) {
+        return toAjax(tFeeService.deleteTFeeByIds(fIds));
+    }
+
+
+}

+ 3 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -85,6 +85,8 @@ public class TFeeServiceImpl implements ITFeeService {
                 feesId.add(fees.getfFeeid());
                 // 查询主表
                 TWarehouseBills tWarehousebills = tWarehouseBillsMapper.selectTWarehousebillsById(fees.getfSrcpid());
+                // 费用名称
+                TFees tFees= tFeesMapper.selectTFeesById(fees.getfFeeid());
                 map1.put("fId",fees.getfId());
                 map1.put("fSrcid",fees.getfSrcid());
                 map1.put("fSrcpid",fees.getfSrcpid());
@@ -93,6 +95,7 @@ public class TFeeServiceImpl implements ITFeeService {
                 map1.put("fProductName",tWarehousebills.getfProductName());
                 map1.put("fBsdate",tWarehousebills.getfBsdate());
                 map1.put("fFeeid",fees.getfFeeid());
+                map1.put("fFeeName",tFees.getfName());
                 map1.put("fSrcdc",fees.getfSrcdc());
                 map1.put("fAmt",fees.getfAmt());
                 if(tWarehousebills.getfBilltype().equals("SJRK")){