Ver Fonte

from控制页面列表
group控制所在位置
data控制具体内容

yangyb há 1 mês atrás
pai
commit
5cbf5f600c

+ 56 - 0
mall-api/src/main/java/com/txz/mall/dto/SystemFormTempDTO.java

@@ -0,0 +1,56 @@
+/*
+ *
+ * SystemFormTempDTO.java
+ * Copyright(C) 2017-2020 fendo公司
+ * @date 2025-07-11
+ */
+package com.txz.mall.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class SystemFormTempDTO implements Serializable {
+    /**
+     * m_system_form_temp
+     */
+    private static final long serialVersionUID = 1L;
+    /**
+     * 表单模板id
+     */
+    private Long id;
+    /**
+     * 表单名称
+     */
+    private String name;
+    /**
+     * 表单简介
+     */
+    private String info;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    /**
+     * 创建人id
+     */
+    private Long createUserId;
+    /**
+     * 更新人id
+     */
+    private Long updateUserId;
+    /**
+     * 是否删除
+     */
+    private Byte isDelete;
+    /**
+     * 表单内容
+     */
+    private String content;
+}

+ 27 - 0
mall-interface/src/main/java/com/txz/mall/service/SystemFormTempServiceClient.java

@@ -0,0 +1,27 @@
+package com.txz.mall.service;
+
+
+import com.txz.mall.dto.*;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
+
+@FeignClient("mall")
+public interface SystemFormTempServiceClient {
+
+	@RequestMapping( value = {"/system/form/temp/add"}, method = {RequestMethod.POST} )
+    public Result add(@RequestBody SystemFormTempDPO systemFormTemp,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/system/form/temp/delete"}, method = {RequestMethod.POST} )
+	public Result delete(@RequestParam("id") Integer id,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/system/form/temp/update"}, method = {RequestMethod.POST} )
+	public Result update(@RequestBody SystemFormTempDPO systemFormTemp,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/system/form/temp/detail"}, method = {RequestMethod.POST} )
+	public Result<SystemFormTempDPO> detail(@RequestParam("id") Integer id,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/system/form/temp/list"}, method = {RequestMethod.POST} )
+	public Result<List<SystemFormTempDPO>> list(@RequestBody SystemFormTempDPO systemFormTemp, @RequestParam("page") Integer page, @RequestParam("size") Integer size,@RequestParam("userId") Long userId);
+}

+ 137 - 0
mall-service/src/main/java/com/txz/mall/controller/SystemFormTempController.java

@@ -0,0 +1,137 @@
+package com.txz.mall.controller;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.txz.mall.core.Result;
+import com.txz.mall.core.ResultCode;
+import com.txz.mall.model.SystemFormTemp;
+import com.txz.mall.service.SystemFormTempService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.*;
+import tk.mybatis.mapper.entity.Condition;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by CodeGenerator on 2025/07/11.
+ */
+@Api(tags = "[后台]systemFormTemp管理")
+@RestController
+@RequestMapping("/system/form/temp")
+public class SystemFormTempController {
+
+    private static Logger log = LoggerFactory.getLogger(SystemFormTempController.class);
+
+    @Resource
+    private SystemFormTempService systemFormTempService;
+
+    @PostMapping("/add")
+    @ApiOperation(value = "systemFormTemp新增", httpMethod = "POST")
+    public Result add(@RequestBody SystemFormTemp systemFormTemp, Long userId) {
+        if (systemFormTemp == null) {
+            return Result.fail(ResultCode.OBJECT_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        try {
+            systemFormTemp.setCreateTime(new Date());
+            systemFormTemp.setCreateUserId(userId);
+            systemFormTempService.save(systemFormTemp);
+        } catch (Exception e) {
+            log.error("新增对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success();
+    }
+
+    @PostMapping("/delete")
+    @ApiOperation(value = "systemFormTemp删除", httpMethod = "POST")
+    public Result delete(@RequestParam Long id, Long userId) {
+        if (id == null) {
+            return Result.fail(ResultCode.ID_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        try {
+            SystemFormTemp systemFormTemp = new SystemFormTemp();
+            systemFormTemp.setId(id);
+            systemFormTemp.setIsDelete(1);
+            systemFormTempService.update(systemFormTemp);
+        } catch (Exception e) {
+            log.error("删除对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success();
+    }
+
+    @PostMapping("/update")
+    @ApiOperation(value = "systemFormTemp更新", httpMethod = "POST")
+    public Result update(@RequestBody SystemFormTemp systemFormTemp, Long userId) {
+        if (systemFormTemp == null) {
+            return Result.fail(ResultCode.OBJECT_IS_NULL);
+        }
+        if (systemFormTemp.getId() == null) {
+            return Result.fail(ResultCode.ID_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        try {
+            systemFormTemp.setUpdateTime(new Date());
+            systemFormTemp.setUpdateUserId(userId);
+            systemFormTempService.update(systemFormTemp);
+        } catch (Exception e) {
+            log.error("更新对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success();
+    }
+
+    @PostMapping("/detail")
+    @ApiOperation(value = "systemFormTemp获取详情", httpMethod = "POST")
+    public Result<SystemFormTemp> detail(@RequestParam Long id, Long userId) {
+        if (id == null) {
+            return Result.fail(ResultCode.ID_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        SystemFormTemp systemFormTemp = null;
+        try {
+            systemFormTemp = systemFormTempService.findById(id);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success(systemFormTemp);
+    }
+
+    @PostMapping("/list")
+    @ApiOperation(value = "systemFormTemp获取列表", httpMethod = "POST")
+    public Result<List<SystemFormTemp>> list(@RequestBody SystemFormTemp systemFormTemp, @RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size, Long userId) {
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        PageHelper.startPage(page, size);
+
+        Condition condition = new Condition(systemFormTemp.getClass());
+//        Criteria criteria = condition.createCriteria();
+//        criteria.andEqualTo("name", city.getName());
+        PageInfo pageInfo = null;
+        try {
+            List<SystemFormTemp> list = systemFormTempService.findByCondition(condition);
+            pageInfo = new PageInfo(list);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success(pageInfo);
+    }
+}

+ 7 - 0
mall-service/src/main/java/com/txz/mall/dao/SystemFormTempMapper.java

@@ -0,0 +1,7 @@
+package com.txz.mall.dao;
+
+import com.txz.mall.core.Mapper;
+import com.txz.mall.model.SystemFormTemp;
+
+public interface SystemFormTempMapper extends Mapper<SystemFormTemp> {
+}

+ 64 - 0
mall-service/src/main/java/com/txz/mall/model/SystemFormTemp.java

@@ -0,0 +1,64 @@
+package com.txz.mall.model;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Data
+@Table(name = "m_system_form_temp")
+public class SystemFormTemp {
+    /**
+     * 表单模板id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * 表单名称
+     */
+    private String name;
+
+    /**
+     * 表单简介
+     */
+    private String info;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建人id
+     */
+    @Column(name = "create_user_id")
+    private Long createUserId;
+
+    /**
+     * 更新人id
+     */
+    @Column(name = "update_user_id")
+    private Long updateUserId;
+
+    /**
+     * 是否删除
+     */
+    @Column(name = "is_delete")
+    private Integer isDelete;
+
+    /**
+     * 表单内容
+     */
+    private String content;
+
+
+}

+ 12 - 0
mall-service/src/main/java/com/txz/mall/service/SystemFormTempService.java

@@ -0,0 +1,12 @@
+package com.txz.mall.service;
+
+import com.txz.mall.core.Service;
+import com.txz.mall.model.SystemFormTemp;
+
+
+/**
+ * Created by CodeGenerator on 2025/07/11.
+ */
+public interface SystemFormTempService extends Service<SystemFormTemp> {
+
+}

+ 22 - 0
mall-service/src/main/java/com/txz/mall/service/impl/SystemFormTempServiceImpl.java

@@ -0,0 +1,22 @@
+package com.txz.mall.service.impl;
+
+import com.txz.mall.core.AbstractService;
+import com.txz.mall.dao.SystemFormTempMapper;
+import com.txz.mall.model.SystemFormTemp;
+import com.txz.mall.service.SystemFormTempService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+
+
+/**
+ * Created by CodeGenerator on 2025/07/11.
+ */
+@Service
+@Transactional
+public class SystemFormTempServiceImpl extends AbstractService<SystemFormTemp> implements SystemFormTempService {
+    @Resource
+    private SystemFormTempMapper mSystemFormTempMapper;
+
+}

+ 18 - 0
mall-service/src/main/resources/mapper/SystemFormTempMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.txz.mall.dao.SystemFormTempMapper">
+    <resultMap id="BaseResultMap" type="com.txz.mall.model.SystemFormTemp">
+        <!--
+          WARNING - @mbg.generated
+        -->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="name" jdbcType="VARCHAR" property="name"/>
+        <result column="info" jdbcType="VARCHAR" property="info"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
+        <result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
+        <result column="is_delete" jdbcType="INTEGER" property="isDelete"/>
+        <result column="content" jdbcType="VARCHAR" property="content"/>
+    </resultMap>
+</mapper>