Explorar o código

销售 添加用户功能 基本信息 购买服务信息 购买竞品信息

xgb hai 2 meses
pai
achega
25f6247474

+ 132 - 0
fs-company-app/src/main/java/com/fs/app/controller/FsUserInfoController.java

@@ -0,0 +1,132 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.his.domain.FsUser;
+import com.fs.his.domain.FsUserInfo;
+import com.fs.his.service.IFsUserInfoService;
+import com.fs.his.service.IFsUserService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.ApiOperation;
+import lombok.val;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 用户信息Controller
+ * 
+ * @author fs
+ * @date 2025-08-25
+ */
+@RestController
+@RequestMapping("/app/fs/userinfo")
+public class FsUserInfoController extends AppBaseController
+{
+    @Autowired
+    private IFsUserInfoService fsUserInfoService;
+
+    @Autowired
+    private IFsUserService fsUserService;
+
+    /**
+     * 查询用户信息列表
+     */
+    @Login
+    @GetMapping("/list")
+    @ApiOperation("获取用户列表信息")
+    public R list(@RequestParam("companyUserId") Long companyUserId,
+                              @RequestParam(required = false, defaultValue = "1") Integer pageNum,
+                              @RequestParam(required = false, defaultValue = "10") Integer pageSize)
+    {
+        if(companyUserId==null){
+            companyUserId = getCompanyUserId();
+        }
+        PageHelper.startPage(pageNum, pageSize);
+        List<FsUserInfo> list = fsUserInfoService.selectFsUserInfoList(companyUserId);
+        return R.ok().put("data", new PageInfo<>(list));
+    }
+
+
+
+    /**
+     * 获取用户信息详细信息
+     */
+    @Login
+    @GetMapping(value = "/info")
+    @ApiOperation("获取用户详情信息")
+    public R getInfo(@RequestParam("userId") Long userId)
+    {
+        FsUserInfo fsUserInfo = fsUserInfoService.selectFsUserInfoById(userId);
+        return R.ok().put("data",fsUserInfo);
+    }
+
+    /**
+     * 新增用户信息
+     */
+    @Login
+    @PostMapping("/add")
+    @ApiOperation("新增用户信息")
+    @Transactional
+    public R add(@RequestBody FsUserInfo fsUserInfo)
+    {
+        // 获取companyUserId
+        Long companyUserId = getCompanyUserId();
+        if(companyUserId!=null){
+            fsUserInfo.setCompanyUserId(companyUserId);
+        }
+
+        FsUser fsUser = new FsUser();
+        fsUser.setCompanyUserId(companyUserId);
+        // 后期需要登记 登记后更新的时候需要一起修改
+//        fsUser.setPhone(fsUserInfo.getPhone());
+//        fsUser.setUsername(fsUserInfo.getUsername());
+        // 登记fsUser表
+        if(fsUserService.insertFsUser(fsUser)<=0){
+            return R.error("用户信息登记原表失败");
+        }
+        // 登记同一个userId
+        fsUserInfo.setUserId(fsUser.getUserId());
+        // 登记fsUserInfo表
+        if(fsUserInfoService.insertFsUserInfo(fsUserInfo)<=0){
+            return R.error("用户信息登记失败");
+        }
+        return R.ok();
+    }
+
+    /**
+     * 修改用户信息
+     */
+    @Login
+    @PostMapping("/update")
+    @ApiOperation("修改用户信息")
+    public R edit(@RequestBody FsUserInfo fsUserInfo)
+    {
+        if(fsUserInfoService.updateFsUserInfo(fsUserInfo)<=0){
+            return R.error("用户信息修改失败");
+        }
+        return R.ok();
+    }
+
+    /**
+     * 删除用户信息
+     */
+    @Login
+	@GetMapping("/delete")
+    @ApiOperation("删除用户信息")
+    @Transactional
+    public R remove(@RequestParam("userId") Long userId)
+    {
+        // 更新fsUser表状态
+        if(fsUserService.deleteFsUserByUserId(userId)<=0){
+            return R.error("用户信息删除原表失败");
+        }
+        return R.ok();
+    }
+}

+ 96 - 0
fs-company-app/src/main/java/com/fs/app/controller/FsUserPayCompetitorsRecordController.java

@@ -0,0 +1,96 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.common.core.domain.R;
+import com.fs.his.domain.FsUserPayCompetitorsRecord;
+import com.fs.his.service.IFsUserPayCompetitorsRecordService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 用户购买竞品信息记录Controller
+ *
+ * @author fs
+ * @date 2025-08-26
+ */
+@RestController
+@RequestMapping("/app/fs/rival/products")
+public class FsUserPayCompetitorsRecordController extends AppBaseController {
+    @Autowired
+    private IFsUserPayCompetitorsRecordService fsUserPayCompetitorsRecordService;
+
+    /**
+     * 查询用户购买竞品信息记录列表
+     */
+    @Login
+    @GetMapping("/list")
+    @ApiOperation("获取用户购买竞品信息记录列表")
+    public R list(FsUserPayCompetitorsRecord fsUserPayCompetitorsRecord,
+                  @RequestParam(required = false, defaultValue = "1") Integer pageNum,
+                  @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
+        // 校验userId不能为空
+        if (fsUserPayCompetitorsRecord.getUserId() == null) {
+            return R.error("用户ID不能为空");
+        }
+
+        PageHelper.startPage(pageNum, pageSize);
+        List<FsUserPayCompetitorsRecord> list = fsUserPayCompetitorsRecordService.selectFsUserPayCompetitorsRecordList(fsUserPayCompetitorsRecord);
+        return R.ok().put("data", new PageInfo<>(list));
+    }
+
+
+    /**
+     * 获取用户购买竞品信息记录详细信息
+     */
+    @Login
+    @GetMapping(value = "/info")
+    @ApiOperation("获取用户购买竞品信息记录详细信息")
+    public R getInfo(@RequestParam("id") Long id) {
+        FsUserPayCompetitorsRecord record = fsUserPayCompetitorsRecordService.selectFsUserPayCompetitorsRecordById(id);
+        return R.ok().put("data", record);
+    }
+
+    /**
+     * 新增用户购买竞品信息记录
+     */
+    @Login
+    @PostMapping("/add")
+    @ApiOperation("新增用户购买竞品信息记录")
+    public R add(@RequestBody FsUserPayCompetitorsRecord fsUserPayCompetitorsRecord) {
+        if (fsUserPayCompetitorsRecordService.insertFsUserPayCompetitorsRecord(fsUserPayCompetitorsRecord) <= 0) {
+            return R.error("用户购买竞品信息记录登记失败");
+        }
+        return R.ok();
+    }
+
+    /**
+     * 修改用户购买竞品信息记录
+     */
+    @Login
+    @PostMapping("/update")
+    @ApiOperation("修改用户购买竞品信息记录")
+    public R edit(@RequestBody FsUserPayCompetitorsRecord fsUserPayCompetitorsRecord) {
+        if (fsUserPayCompetitorsRecordService.updateFsUserPayCompetitorsRecord(fsUserPayCompetitorsRecord) <= 0) {
+            return R.error("用户购买竞品信息记录修改失败");
+        }
+        return R.ok();
+    }
+
+    /**
+     * 删除用户购买竞品信息记录
+     */
+    @Login
+    @GetMapping("/delete")
+    @ApiOperation("删除用户购买竞品信息记录")
+    public R remove(@RequestParam("id") Long id) {
+        if (fsUserPayCompetitorsRecordService.deleteFsUserPayCompetitorsRecordById(id) <= 0) {
+            return R.error("用户购买竞品信息记录删除失败");
+        }
+        return R.ok();
+    }
+}

+ 96 - 0
fs-company-app/src/main/java/com/fs/app/controller/FsUserPayRecordController.java

@@ -0,0 +1,96 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.common.core.domain.R;
+import com.fs.his.domain.FsUserPayRecord;
+import com.fs.his.service.IFsUserPayRecordService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 用户购买服务信息记录Controller
+ *
+ * @author fs
+ * @date 2025-08-26
+ */
+@RestController
+@RequestMapping("/app/fs/pay/products")
+public class FsUserPayRecordController extends AppBaseController {
+    @Autowired
+    private IFsUserPayRecordService fsUserPayRecordService;
+
+    /**
+     * 查询用户购买服务信息记录列表
+     */
+    @Login
+    @GetMapping("/list")
+    @ApiOperation("获取用户购买服务信息记录列表")
+    public R list(FsUserPayRecord fsUserPayRecord,
+                  @RequestParam(required = false, defaultValue = "1") Integer pageNum,
+                  @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
+
+        if (fsUserPayRecord.getUserId() == null) {
+            return R.error("用户ID不能为空");
+        }
+
+        PageHelper.startPage(pageNum, pageSize);
+        List<FsUserPayRecord> list = fsUserPayRecordService.selectFsUserPayRecordList(fsUserPayRecord);
+        return R.ok().put("data", new PageInfo<>(list));
+    }
+
+
+    /**
+     * 获取用户购买服务信息记录详细信息
+     */
+    @Login
+    @GetMapping(value = "/info")
+    @ApiOperation("获取用户购买服务信息记录详细信息")
+    public R getInfo(@RequestParam("id") Long id) {
+        FsUserPayRecord fsUserPayRecord = fsUserPayRecordService.selectFsUserPayRecordById(id);
+        return R.ok().put("data", fsUserPayRecord);
+    }
+
+    /**
+     * 新增用户购买服务信息记录
+     */
+    @Login
+    @PostMapping("/add")
+    @ApiOperation("新增用户购买服务信息记录")
+    public R add(@RequestBody FsUserPayRecord fsUserPayRecord) {
+        if (fsUserPayRecordService.insertFsUserPayRecord(fsUserPayRecord) <= 0) {
+            return R.error("用户购买服务信息记录登记失败");
+        }
+        return R.ok();
+    }
+
+    /**
+     * 修改用户购买服务信息记录
+     */
+    @Login
+    @PostMapping("/update")
+    @ApiOperation("修改用户购买服务信息记录")
+    public R edit(@RequestBody FsUserPayRecord fsUserPayRecord) {
+        if (fsUserPayRecordService.updateFsUserPayRecord(fsUserPayRecord) <= 0) {
+            return R.error("用户购买服务信息记录修改失败");
+        }
+        return R.ok();
+    }
+
+    /**
+     * 删除用户购买服务信息记录
+     */
+    @Login
+    @GetMapping("/delete")
+    @ApiOperation("删除用户购买服务信息记录")
+    public R remove(@RequestParam("id") Long id) {
+        if (fsUserPayRecordService.deleteFsUserPayRecordById(id) <= 0) {
+            return R.error("用户购买服务信息记录删除失败");
+        }
+        return R.ok();
+    }
+}