dengyj преди 4 години
родител
ревизия
8a6313e38c

+ 1 - 1
src/main/java/com/steerinfo/baseinfo/appversionmsg/controller/AppVersionMsgController.java

@@ -71,7 +71,7 @@ public class AppVersionMsgController extends BaseRESTfulController {
     @ApiImplicitParam(name = "appVersionMsg", value = "详细实体appVersionMsg", required = true, dataType = "AppVersionMsg")
     //@RequiresPermissions("appversionmsg:create")
     @PostMapping(value = "/")
-    public RESTfulResult add(@ModelAttribute AppVersionMsg model){
+    public RESTfulResult add(@RequestBody AppVersionMsg model){
         model.setVersionId(appVersionMsgMapper.getNewId());
         UserPayload payload = UserPayload.getCurrUser();
         model.setCreateId(payload.getUserCode());

+ 133 - 0
src/main/java/com/steerinfo/baseinfo/meterbaseprint/controller/MeterBasePrintController.java

@@ -0,0 +1,133 @@
+package com.steerinfo.baseinfo.meterbaseprint.controller;
+
+import com.steerinfo.baseinfo.meterbaseprint.model.MeterBasePrint;
+import com.steerinfo.baseinfo.meterbaseprint.service.IMeterBasePrintService;
+import com.steerinfo.framework.controller.BaseRESTfulController;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageList;
+import com.steerinfo.framework.utils.collection.ListUtils;
+import com.steerinfo.meterwork.except.MarkerMetException;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import oracle.jdbc.proxy.annotation.Post;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * MeterBasePrint RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-07-09 10:12
+ * 类描述
+ * 修订历史:
+ * 日期:2022-07-09
+ * 作者:generator
+ * 参考:
+ * 描述:MeterBasePrint RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/meterbaseprints")
+public class MeterBasePrintController extends BaseRESTfulController {
+
+    @Autowired
+    IMeterBasePrintService meterBasePrintService;
+
+    @ApiOperation(value="获取列表", notes="分页查询")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("meterbaseprint:view")
+    @GetMapping(value = "/")
+    public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<MeterBasePrint> list = meterBasePrintService.queryForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+
+    @ApiOperation(value="获取列表", notes="分页模糊查询")
+    @ApiImplicitParams({
+        @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+        @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
+    })
+    //@RequiresPermissions("meterbaseprint:view")
+    @GetMapping(value = "/like/")
+    public RESTfulResult listLike(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
+        PageList<MeterBasePrint> list = meterBasePrintService.queryLikeForPage(parmas, pageNum, pageSize);
+        return success(list);
+    }
+    
+    @ApiOperation(value="创建", notes="根据MeterBasePrint对象创建")
+    @ApiImplicitParam(name = "meterBasePrint", value = "详细实体meterBasePrint", required = true, dataType = "MeterBasePrint")
+    //@RequiresPermissions("meterbaseprint:create")
+    @PostMapping(value = "/")
+    public RESTfulResult add(@RequestBody MeterBasePrint model){
+        model.setPrintDate(new Date());
+        MeterBasePrint meterBasePrint = meterBasePrintService.add(model);
+        return success(meterBasePrint);
+    }
+
+    @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("meterbaseprint:view")
+    @GetMapping(value = "/{id}")
+    public RESTfulResult get(@PathVariable String id){
+        MeterBasePrint meterBasePrint = meterBasePrintService.getById(id);
+        return success(meterBasePrint);
+    }
+
+    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的meterBasePrint信息来更新详细信息")
+    @ApiImplicitParams({
+        @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
+        @ApiImplicitParam(name = "meterBasePrint", value = "详细实体meterBasePrint", required = true, dataType = "MeterBasePrint")
+    })
+    //@RequiresPermissions("meterbaseprint:update")
+    @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult update(@PathVariable String id, @RequestBody MeterBasePrint model){
+        model.setId(id);
+        MeterBasePrint meterBasePrint = meterBasePrintService.modify(model);
+        return success(meterBasePrint);
+    }
+
+    @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
+    //@RequiresPermissions("meterbaseprint:delete")
+    @DeleteMapping(value = "/{id}")//String
+    public RESTfulResult delete(@PathVariable String id){
+    	List<String> list = Arrays.asList(id.split(","));
+    	if(ListUtils.isNotEmpty(list)) {
+	    	List<String> ids = ListUtils.convertList(list);
+			  meterBasePrintService.delete(ids);
+    	}
+      return success();
+    }
+
+    @ApiOperation(value="更新详细信息", notes="根据传过来的meterBasePrint信息来更新详细信息")
+    //@RequiresPermissions("meterbaseprint:update")
+    @PostMapping(value = "/updateModel", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult updateModel(@RequestBody MeterBasePrint model){
+        model.setId(model.getPrintId());
+        model.setPrintDate(new Date());
+        MeterBasePrint meterBasePrint = meterBasePrintService.modify(model);
+        return success(meterBasePrint);
+    }
+
+    @ApiOperation(value = "获取打印次数信息", notes = "获取打印次数信息")
+    //@RequiresPermissions("meterworkrailwayactual:view")
+    @GetMapping(value = "/noPage/")
+    public RESTfulResult noPage(@RequestParam HashMap params) {
+        try {
+            RESTfulResult rm  = meterBasePrintService.noPage(params);
+            return rm;
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new MarkerMetException(500, "操作异常!!");
+        }
+    }
+}

+ 9 - 0
src/main/java/com/steerinfo/baseinfo/meterbaseprint/mapper/MeterBasePrintMapper.java

@@ -0,0 +1,9 @@
+package com.steerinfo.baseinfo.meterbaseprint.mapper;
+
+import com.steerinfo.baseinfo.meterbaseprint.model.MeterBasePrint;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface MeterBasePrintMapper extends IBaseMapper<MeterBasePrint, String> {
+}

+ 188 - 0
src/main/java/com/steerinfo/baseinfo/meterbaseprint/mapper/MeterBasePrintMapper.xml

@@ -0,0 +1,188 @@
+<?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.steerinfo.baseinfo.meterbaseprint.mapper.MeterBasePrintMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.baseinfo.meterbaseprint.model.MeterBasePrint">
+    <id column="PRINT_ID" jdbcType="VARCHAR" property="printId" />
+    <result column="ACTUAL_NO" jdbcType="VARCHAR" property="actualNo" />
+    <result column="PRINT_DATE" jdbcType="TIMESTAMP" property="printDate" />
+    <result column="PRINT_NUM" jdbcType="VARCHAR" property="printNum" />
+  </resultMap>
+  <sql id="columns">
+    PRINT_ID, ACTUAL_NO, PRINT_DATE, PRINT_NUM
+  </sql>
+  <sql id="columns_alias">
+    t.PRINT_ID, t.ACTUAL_NO, t.PRINT_DATE, t.PRINT_NUM
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM METER_BASE_PRINT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM METER_BASE_PRINT t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="printId != null and printId != ''">
+        and PRINT_ID = #{printId}
+      </if>
+      <if test="actualNo != null and actualNo != ''">
+        and ACTUAL_NO = #{actualNo}
+      </if>
+      <if test="printDate != null">
+        and TO_CHAR(PRINT_DATE,'yyyy-MM-dd') = #{printDate}
+      </if>
+      <if test="printNum != null and printNum != ''">
+        and PRINT_NUM = #{printNum}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="printId != null and printId != ''">
+        and PRINT_ID LIKE '%${printId}%'
+      </if>
+      <if test="actualNo != null and actualNo != ''">
+        and ACTUAL_NO LIKE '%${actualNo}%'
+      </if>
+      <if test="printDate != null">
+        and TO_CHAR(PRINT_DATE,'yyyy-MM-dd') = #{printDate}
+      </if>
+      <if test="printNum != null and printNum != ''">
+        and PRINT_NUM LIKE '%${printNum}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from METER_BASE_PRINT
+    where PRINT_ID = #{printId,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from METER_BASE_PRINT
+    where 1!=1 
+      <if test="actualNo != null and actualNo != ''">
+        or ACTUAL_NO = #{actualNo}
+      </if>
+      <if test="printDate != null">
+        or TO_CHAR(PRINT_DATE,'yyyy-MM-dd') = '#{printDate}'
+      </if>
+      <if test="printNum != null and printNum != ''">
+        or PRINT_NUM = #{printNum}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.baseinfo.meterbaseprint.model.MeterBasePrint">
+    insert into METER_BASE_PRINT (PRINT_ID, ACTUAL_NO, PRINT_DATE, 
+      PRINT_NUM)
+    values (#{printId,jdbcType=VARCHAR}, #{actualNo,jdbcType=VARCHAR}, #{printDate,jdbcType=TIMESTAMP}, 
+      #{printNum,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbaseprint.model.MeterBasePrint">
+    insert into METER_BASE_PRINT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="printId != null">
+        PRINT_ID,
+      </if>
+      <if test="actualNo != null">
+        ACTUAL_NO,
+      </if>
+      <if test="printDate != null">
+        PRINT_DATE,
+      </if>
+      <if test="printNum != null">
+        PRINT_NUM,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="printId != null">
+        #{printId,jdbcType=VARCHAR},
+      </if>
+      <if test="actualNo != null">
+        #{actualNo,jdbcType=VARCHAR},
+      </if>
+      <if test="printDate != null">
+        #{printDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="printNum != null">
+        #{printNum,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbaseprint.model.MeterBasePrint">
+    update METER_BASE_PRINT
+    set ACTUAL_NO = #{actualNo,jdbcType=VARCHAR},
+      PRINT_DATE = #{printDate,jdbcType=TIMESTAMP},
+      PRINT_NUM = #{printNum,jdbcType=VARCHAR}
+    where PRINT_ID = #{printId,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbaseprint.model.MeterBasePrint">
+    update METER_BASE_PRINT
+    <set>
+      <if test="actualNo != null">
+        ACTUAL_NO = #{actualNo,jdbcType=VARCHAR},
+      </if>
+      <if test="printDate != null">
+        PRINT_DATE = #{printDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="printNum != null">
+        PRINT_NUM = #{printNum,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where PRINT_ID = #{printId,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where PRINT_ID = #{printId,jdbcType=VARCHAR}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into METER_BASE_PRINT 
+      (PRINT_ID, 
+      ACTUAL_NO, PRINT_DATE, PRINT_NUM
+      )
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.printId,jdbcType=VARCHAR}, 
+      #{item.actualNo,jdbcType=VARCHAR}, #{item.printDate,jdbcType=TIMESTAMP}, #{item.printNum,jdbcType=VARCHAR}
+       from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update METER_BASE_PRINT
+     set
+       PRINT_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PRINT_ID" close="end">
+          when #{item.printId,jdbcType=VARCHAR} then #{item.printId,jdbcType=VARCHAR}
+       </foreach>
+       ,ACTUAL_NO=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PRINT_ID" close="end">
+          when #{item.printId,jdbcType=VARCHAR} then #{item.actualNo,jdbcType=VARCHAR}
+       </foreach>
+       ,PRINT_DATE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PRINT_ID" close="end">
+          when #{item.printId,jdbcType=VARCHAR} then #{item.printDate,jdbcType=TIMESTAMP}
+       </foreach>
+       ,PRINT_NUM=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PRINT_ID" close="end">
+          when #{item.printId,jdbcType=VARCHAR} then #{item.printNum,jdbcType=VARCHAR}
+       </foreach>
+     where PRINT_ID in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.printId,jdbcType=VARCHAR}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from METER_BASE_PRINT
+    where PRINT_ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  
+</mapper>

+ 93 - 0
src/main/java/com/steerinfo/baseinfo/meterbaseprint/model/MeterBasePrint.java

@@ -0,0 +1,93 @@
+package com.steerinfo.baseinfo.meterbaseprint.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+@ApiModel(value="null")
+public class MeterBasePrint implements IBasePO<String> {
+    /**
+     * 编号(PRINT_ID,VARCHAR,50)
+     */
+    @ApiModelProperty(value="编号",required=true)
+    private String printId;
+
+    /**
+     * 净重编号(ACTUAL_NO,VARCHAR,50)
+     */
+    @ApiModelProperty(value="净重编号",required=false)
+    private String actualNo;
+
+    /**
+     * 打印日期(PRINT_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="打印日期",required=false)
+    private Date printDate;
+
+    /**
+     * 打印次数(PRINT_NUM,VARCHAR,20)
+     */
+    @ApiModelProperty(value="打印次数",required=false)
+    private String printNum;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public String getId() {
+        return this.printId;
+    }
+
+    @Override
+    public void setId(String printId) {
+        this.printId = printId == null ? null : printId.trim();
+    }
+
+    public String getPrintId() {
+        return printId;
+    }
+
+    public void setPrintId(String printId) {
+        this.printId = printId == null ? null : printId.trim();
+    }
+
+    public String getActualNo() {
+        return actualNo;
+    }
+
+    public void setActualNo(String actualNo) {
+        this.actualNo = actualNo == null ? null : actualNo.trim();
+    }
+
+    public Date getPrintDate() {
+        return printDate;
+    }
+
+    public void setPrintDate(Date printDate) {
+        this.printDate = printDate;
+    }
+
+    public String getPrintNum() {
+        return printNum;
+    }
+
+    public void setPrintNum(String printNum) {
+        this.printNum = printNum == null ? null : printNum.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", printId=").append(printId);
+        sb.append(", actualNo=").append(actualNo);
+        sb.append(", printDate=").append(printDate);
+        sb.append(", printNum=").append(printNum);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 26 - 0
src/main/java/com/steerinfo/baseinfo/meterbaseprint/service/IMeterBasePrintService.java

@@ -0,0 +1,26 @@
+package com.steerinfo.baseinfo.meterbaseprint.service;
+
+import com.steerinfo.baseinfo.meterbaseprint.model.MeterBasePrint;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.IBaseService;
+
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * MeterBasePrint服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-07-09 10:12
+ * 类描述
+ * 修订历史:
+ * 日期:2022-07-09
+ * 作者:generator
+ * 参考:
+ * 描述:MeterBasePrint服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IMeterBasePrintService extends IBaseService<MeterBasePrint, String>{
+    RESTfulResult noPage(HashMap<String, Object> param);
+
+}

+ 58 - 0
src/main/java/com/steerinfo/baseinfo/meterbaseprint/service/impl/MeterBasePrintServiceImpl.java

@@ -0,0 +1,58 @@
+package com.steerinfo.baseinfo.meterbaseprint.service.impl;
+
+import com.steerinfo.baseinfo.meterbaseprint.mapper.MeterBasePrintMapper;
+import com.steerinfo.baseinfo.meterbaseprint.model.MeterBasePrint;
+import com.steerinfo.baseinfo.meterbaseprint.service.IMeterBasePrintService;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import com.steerinfo.meterwork.meterworkrailwayactual.model.MeterWorkRailwayActual;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * MeterBasePrint服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-07-09 10:12
+ * 类描述
+ * 修订历史:
+ * 日期:2022-07-09
+ * 作者:generator
+ * 参考:
+ * 描述:MeterBasePrint服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "meterBasePrintService")
+public class MeterBasePrintServiceImpl extends BaseServiceImpl<MeterBasePrint, String> implements IMeterBasePrintService {
+
+    @Resource
+    private MeterBasePrintMapper meterBasePrintMapper;
+
+    @Override
+    protected IBaseMapper<MeterBasePrint, String> getMapper() {
+        return meterBasePrintMapper;
+    }
+
+    @Override
+    public RESTfulResult noPage(HashMap<String, Object> param) {
+        RESTfulResult rm = new RESTfulResult();
+        rm.setFailed();
+        try {
+            List<MeterBasePrint> rows = meterBasePrintMapper.selectByParameters(param);
+            rm.setSucceed();
+            rm.setCode("200");
+            rm.setData(rows);
+            rm.setMessage("操作成功,总共"+ rows.size() +"条数据!!");
+        }catch(Exception e) {
+            e.printStackTrace();
+            rm.setMessage("操作异常!!>>>" + e.getMessage());
+        }
+        return rm;
+    }
+}