Browse Source

增加辅助资料 计量单位、收支类别

chenw 7 years ago
parent
commit
273b9c643b

+ 58 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Fundinouttype.java

@@ -0,0 +1,58 @@
+package com.usoftchina.saas.document.entities;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Fundinouttype extends CommonBaseEntity implements Serializable {
+    private String ft_name;
+
+    private String ft_kind;
+
+    private Integer ft_recordid;
+
+    private String ft_recorder;
+
+    private Date ft_date;
+
+    public String getFt_name() {
+        return ft_name;
+    }
+
+    public void setFt_name(String ft_name) {
+        this.ft_name = ft_name == null ? null : ft_name.trim();
+    }
+
+    public String getFt_kind() {
+        return ft_kind;
+    }
+
+    public void setFt_kind(String ft_kind) {
+        this.ft_kind = ft_kind == null ? null : ft_kind.trim();
+    }
+
+    public Integer getFt_recordid() {
+        return ft_recordid;
+    }
+
+    public void setFt_recordid(Integer ft_recordid) {
+        this.ft_recordid = ft_recordid;
+    }
+
+    public String getFt_recorder() {
+        return ft_recorder;
+    }
+
+    public void setFt_recorder(String ft_recorder) {
+        this.ft_recorder = ft_recorder == null ? null : ft_recorder.trim();
+    }
+
+    public Date getFt_date() {
+        return ft_date;
+    }
+
+    public void setFt_date(Date ft_date) {
+        this.ft_date = ft_date;
+    }
+}

+ 48 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Productunit.java

@@ -0,0 +1,48 @@
+package com.usoftchina.saas.document.entities;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Productunit extends CommonBaseEntity implements Serializable {
+    private String pu_name;
+
+    private Integer pu_recordid;
+
+    private String pu_recorder;
+
+    private Date pu_date;
+
+    public String getPu_name() {
+        return pu_name;
+    }
+
+    public void setPu_name(String pu_name) {
+        this.pu_name = pu_name == null ? null : pu_name.trim();
+    }
+
+    public Integer getPu_recordid() {
+        return pu_recordid;
+    }
+
+    public void setPu_recordid(Integer pu_recordid) {
+        this.pu_recordid = pu_recordid;
+    }
+
+    public String getPu_recorder() {
+        return pu_recorder;
+    }
+
+    public void setPu_recorder(String pu_recorder) {
+        this.pu_recorder = pu_recorder == null ? null : pu_recorder.trim();
+    }
+
+    public Date getPu_date() {
+        return pu_date;
+    }
+
+    public void setPu_date(Date pu_date) {
+        this.pu_date = pu_date;
+    }
+}

+ 35 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/FundinouttypeController.java

@@ -0,0 +1,35 @@
+package com.usoftchina.saas.document.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.document.entities.Fundinouttype;
+import com.usoftchina.saas.document.service.FundinouttypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/fundinoutType")
+public class FundinouttypeController {
+
+    @Autowired
+    private FundinouttypeService fundinouttypeService;
+
+    @PostMapping("/save")
+    public Result save(@RequestBody Fundinouttype fundinouttype){
+        fundinouttypeService.save(fundinouttype);
+        return Result.success();
+    }
+
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        fundinouttypeService.removeByPrimaryKey(id);
+        return Result.success();
+    }
+
+    @GetMapping("/getAll")
+    public Result getAll(){
+        List<Fundinouttype> fundinouttypeList = fundinouttypeService.findAll();
+        return Result.success(fundinouttypeList);
+    }
+}

+ 37 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductunitController.java

@@ -0,0 +1,37 @@
+package com.usoftchina.saas.document.controller;
+
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.document.entities.Productunit;
+import com.usoftchina.saas.document.service.ProductunitService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/productUnit")
+public class ProductunitController {
+
+    @Autowired
+    private ProductunitService productunitService;
+
+    @PostMapping("/save")
+    public Result save(@RequestBody Productunit productunit){
+        productunitService.save(productunit);
+        return Result.success();
+    }
+
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        productunitService.removeByPrimaryKey(id);
+        return Result.success();
+    }
+
+    @GetMapping("/getAll")
+    public Result getAll(){
+        List<Productunit> productunitList = productunitService.findAll();
+        return Result.success(productunitList);
+    }
+
+}

+ 19 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/FundinouttypeMapper.java

@@ -0,0 +1,19 @@
+package com.usoftchina.saas.document.mapper;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.document.entities.Fundinouttype;
+
+public interface FundinouttypeMapper extends CommonBaseMapper<Fundinouttype> {
+    int deleteByPrimaryKey(Long ft_id);
+
+    int insert(Fundinouttype record);
+
+    int insertSelective(Fundinouttype record);
+
+    Fundinouttype selectByPrimaryKey(Long ft_id);
+
+    int updateByPrimaryKeySelective(Fundinouttype record);
+
+    int updateByPrimaryKey(Fundinouttype record);
+}

+ 18 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductunitMapper.java

@@ -0,0 +1,18 @@
+package com.usoftchina.saas.document.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.document.entities.Productunit;
+
+public interface ProductunitMapper extends CommonBaseMapper<Productunit> {
+    int deleteByPrimaryKey(Long pu_id);
+
+    int insert(Productunit record);
+
+    int insertSelective(Productunit record);
+
+    Productunit selectByPrimaryKey(Long pu_id);
+
+    int updateByPrimaryKeySelective(Productunit record);
+
+    int updateByPrimaryKey(Productunit record);
+}

+ 9 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/FundinouttypeService.java

@@ -0,0 +1,9 @@
+package com.usoftchina.saas.document.service;
+
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.document.entities.Fundinouttype;
+import com.usoftchina.saas.document.mapper.FundinouttypeMapper;
+
+public interface FundinouttypeService extends CommonBaseService<FundinouttypeMapper, Fundinouttype> {
+
+}

+ 9 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductunitService.java

@@ -0,0 +1,9 @@
+package com.usoftchina.saas.document.service;
+
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.document.entities.Productunit;
+import com.usoftchina.saas.document.mapper.ProductunitMapper;
+
+public interface ProductunitService extends CommonBaseService<ProductunitMapper, Productunit> {
+
+}

+ 42 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java

@@ -0,0 +1,42 @@
+package com.usoftchina.saas.document.service.impl;
+
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.document.entities.Fundinouttype;
+import com.usoftchina.saas.document.mapper.FundinouttypeMapper;
+import com.usoftchina.saas.document.service.FundinouttypeService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<FundinouttypeMapper, Fundinouttype> implements FundinouttypeService {
+
+    /**
+     * 保存/更新
+     * @param fundinouttype
+     * @return
+     */
+    @Override
+    public boolean save(Fundinouttype fundinouttype){
+        fundinouttype.setCompanyId(BaseContextHolder.getCompanyId());
+        if(fundinouttype.getId() == 0){
+            getMapper().insertSelective(fundinouttype);
+        }else{
+            getMapper().updateByPrimaryKeySelective(fundinouttype);
+        }
+        return true;
+    }
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean removeByPrimaryKey(Long id){
+        getMapper().deleteByPrimaryKey(id);
+        return true;
+    }
+
+}

+ 38 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java

@@ -0,0 +1,38 @@
+package com.usoftchina.saas.document.service.impl;
+
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.document.entities.Productunit;
+import com.usoftchina.saas.document.mapper.ProductunitMapper;
+import com.usoftchina.saas.document.service.ProductunitService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMapper, Productunit> implements ProductunitService {
+
+    @Override
+    public boolean save(Productunit productunit){
+        productunit.setCompanyId(BaseContextHolder.getCompanyId());
+        if(productunit.getId() == 0){
+            getMapper().insertSelective(productunit);
+        }else{
+            getMapper().updateByPrimaryKeySelective(productunit);
+        }
+        return true;
+    }
+
+    @Override
+    public boolean removeByPrimaryKey(Long id){
+        getMapper().deleteByPrimaryKey(id);
+        return true;
+    }
+
+    @Override
+    public List<Productunit> findAll(){
+        List<Productunit> productunitList = getMapper().selectAll();
+        return productunitList;
+    }
+
+}

+ 139 - 0
applications/document/document-server/src/main/resources/mapper/FundinouttypeMapper.xml

@@ -0,0 +1,139 @@
+<?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.usoftchina.saas.document.mapper.FundinouttypeMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Fundinouttype" >
+    <id column="ft_id" property="id" jdbcType="INTEGER" />
+    <result column="ft_name" property="ft_name" jdbcType="VARCHAR" />
+    <result column="ft_kind" property="ft_kind" jdbcType="VARCHAR" />
+    <result column="ft_recordid" property="ft_recordid" jdbcType="INTEGER" />
+    <result column="ft_recorder" property="ft_recorder" jdbcType="VARCHAR" />
+    <result column="ft_date" property="ft_date" jdbcType="TIMESTAMP" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    ft_id, ft_name, ft_kind, ft_recordid, ft_recorder, ft_date, companyId, updaterId, 
+    updateTime
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    select 
+    <include refid="Base_Column_List" />
+    from fundinouttype
+    where ft_id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from fundinouttype
+    where ft_id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Fundinouttype" >
+    insert into fundinouttype (ft_name, ft_kind,
+      ft_recordid, ft_recorder, ft_date, 
+      companyId, updaterId, updateTime
+      )
+    values (#{ft_name,jdbcType=VARCHAR}, #{ft_kind,jdbcType=VARCHAR},
+      #{ft_recordid,jdbcType=INTEGER}, #{ft_recorder,jdbcType=VARCHAR}, #{ft_date,jdbcType=TIMESTAMP}, 
+      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Fundinouttype" >
+    insert into fundinouttype
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="ft_name != null" >
+        ft_name,
+      </if>
+      <if test="ft_kind != null" >
+        ft_kind,
+      </if>
+      <if test="ft_recordid != null" >
+        ft_recordid,
+      </if>
+      <if test="ft_recorder != null" >
+        ft_recorder,
+      </if>
+      <if test="ft_date != null" >
+        ft_date,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="ft_name != null" >
+        #{ft_name,jdbcType=VARCHAR},
+      </if>
+      <if test="ft_kind != null" >
+        #{ft_kind,jdbcType=VARCHAR},
+      </if>
+      <if test="ft_recordid != null" >
+        #{ft_recordid,jdbcType=INTEGER},
+      </if>
+      <if test="ft_recorder != null" >
+        #{ft_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="ft_date != null" >
+        #{ft_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Fundinouttype" >
+    update fundinouttype
+    <set >
+      <if test="ft_name != null" >
+        ft_name = #{ft_name,jdbcType=VARCHAR},
+      </if>
+      <if test="ft_kind != null" >
+        ft_kind = #{ft_kind,jdbcType=VARCHAR},
+      </if>
+      <if test="ft_recordid != null" >
+        ft_recordid = #{ft_recordid,jdbcType=INTEGER},
+      </if>
+      <if test="ft_recorder != null" >
+        ft_recorder = #{ft_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="ft_date != null" >
+        ft_date = #{ft_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where ft_id = #{id}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Fundinouttype" >
+    update fundinouttype
+    set ft_name = #{ft_name,jdbcType=VARCHAR},
+      ft_kind = #{ft_kind,jdbcType=VARCHAR},
+      ft_recordid = #{ft_recordid,jdbcType=INTEGER},
+      ft_recorder = #{ft_recorder,jdbcType=VARCHAR},
+      ft_date = #{ft_date,jdbcType=TIMESTAMP},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP}
+    where ft_id = #{id,jdbcType=INTEGER}
+  </update>
+  <select id="selectAll" resultMap="BaseResultMap">
+    SELECT * FROM FUNDINOUTTYPE
+  </select>
+</mapper>

+ 125 - 0
applications/document/document-server/src/main/resources/mapper/ProductunitMapper.xml

@@ -0,0 +1,125 @@
+<?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.usoftchina.saas.document.mapper.ProductunitMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Productunit" >
+    <id column="pu_id" property="id" jdbcType="INTEGER" />
+    <result column="pu_name" property="pu_name" jdbcType="VARCHAR" />
+    <result column="pu_recordid" property="pu_recordid" jdbcType="INTEGER" />
+    <result column="pu_recorder" property="pu_recorder" jdbcType="VARCHAR" />
+    <result column="pu_date" property="pu_date" jdbcType="TIMESTAMP" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    pu_id, pu_name, pu_recordid, pu_recorder, pu_date, companyId, updaterId, updateTime
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    select 
+    <include refid="Base_Column_List" />
+    from productunit
+    where pu_id = #{id}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from productunit
+    where pu_id = #{id}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Productunit" >
+    insert into productunit (pu_name, pu_recordid,
+      pu_recorder, pu_date, companyId, 
+      updaterId, updateTime)
+    values (#{pu_name,jdbcType=VARCHAR}, #{pu_recordid,jdbcType=INTEGER},
+      #{pu_recorder,jdbcType=VARCHAR}, #{pu_date,jdbcType=TIMESTAMP}, #{companyId,jdbcType=INTEGER}, 
+      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Productunit" >
+    insert into productunit
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="pu_name != null" >
+        pu_name,
+      </if>
+      <if test="pu_recordid != null" >
+        pu_recordid,
+      </if>
+      <if test="pu_recorder != null" >
+        pu_recorder,
+      </if>
+      <if test="pu_date != null" >
+        pu_date,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="pu_name != null" >
+        #{pu_name,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_recordid != null" >
+        #{pu_recordid,jdbcType=INTEGER},
+      </if>
+      <if test="pu_recorder != null" >
+        #{pu_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_date != null" >
+        #{pu_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Productunit" >
+    update productunit
+    <set >
+      <if test="pu_name != null" >
+        pu_name = #{pu_name,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_recordid != null" >
+        pu_recordid = #{pu_recordid,jdbcType=INTEGER},
+      </if>
+      <if test="pu_recorder != null" >
+        pu_recorder = #{pu_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="pu_date != null" >
+        pu_date = #{pu_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where pu_id = #{id}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Productunit" >
+    update productunit
+    set pu_name = #{pu_name,jdbcType=VARCHAR},
+      pu_recordid = #{pu_recordid,jdbcType=INTEGER},
+      pu_recorder = #{pu_recorder,jdbcType=VARCHAR},
+      pu_date = #{pu_date,jdbcType=TIMESTAMP},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP}
+    where pu_id = #{id}
+  </update>
+  <select id="selectAll" resultMap="BaseResultMap">
+    SELECT * FROM PRODUCTUNIT
+  </select>
+</mapper>