Commit 3cb6cdb9 by huangZW

111

parent 31226bbe
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class AuditDTO implements Serializable {
private Integer auditId;
private Integer auditType;
private String commitName;
private Integer commitStaffId;
private String commitStaffName;
private String commitStaffImg;
private String commitStoreId;
private String changeField;
private Date commitTime;
private String enterpriseId;
private String auditName;
private Integer auditStatus;
private String auditReason;
private String oldValue;
private String newValue;
private static final long serialVersionUID = 1L;
public Integer getAuditId() {
return auditId;
}
public void setAuditId(Integer auditId) {
this.auditId = auditId;
}
public Integer getAuditType() {
return auditType;
}
public void setAuditType(Integer auditType) {
this.auditType = auditType;
}
public String getCommitName() {
return commitName;
}
public void setCommitName(String commitName) {
this.commitName = commitName == null ? null : commitName.trim();
}
public Integer getCommitStaffId() {
return commitStaffId;
}
public void setCommitStaffId(Integer commitStaffId) {
this.commitStaffId = commitStaffId;
}
public String getCommitStaffName() {
return commitStaffName;
}
public void setCommitStaffName(String commitStaffName) {
this.commitStaffName = commitStaffName == null ? null : commitStaffName.trim();
}
public String getCommitStaffImg() {
return commitStaffImg;
}
public void setCommitStaffImg(String commitStaffImg) {
this.commitStaffImg = commitStaffImg == null ? null : commitStaffImg.trim();
}
public String getCommitStoreId() {
return commitStoreId;
}
public void setCommitStoreId(String commitStoreId) {
this.commitStoreId = commitStoreId == null ? null : commitStoreId.trim();
}
public String getChangeField() {
return changeField;
}
public void setChangeField(String changeField) {
this.changeField = changeField == null ? null : changeField.trim();
}
public Date getCommitTime() {
return commitTime;
}
public void setCommitTime(Date commitTime) {
this.commitTime = commitTime;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId == null ? null : enterpriseId.trim();
}
public String getAuditName() {
return auditName;
}
public void setAuditName(String auditName) {
this.auditName = auditName == null ? null : auditName.trim();
}
public Integer getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(Integer auditStatus) {
this.auditStatus = auditStatus;
}
public String getAuditReason() {
return auditReason;
}
public void setAuditReason(String auditReason) {
this.auditReason = auditReason == null ? null : auditReason.trim();
}
public String getOldValue() {
return oldValue;
}
public void setOldValue(String oldValue) {
this.oldValue = oldValue == null ? null : oldValue.trim();
}
public String getNewValue() {
return newValue;
}
public void setNewValue(String newValue) {
this.newValue = newValue == null ? null : newValue.trim();
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.service;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.AuditDTO;
/**
* Created by tgs on 2020/2/9.
*/
public interface AuditApiService {
Page<AuditDTO> page(Integer auditType, String search,String enterpriseId,BasePageInfo pageInfo);
}
package com.gic.haoban.manage.service.dao.mapper;
import java.util.List;
import com.gic.haoban.manage.api.dto.AuditDTO;
import com.gic.haoban.manage.service.entity.TabHaobanAudit;
import com.github.pagehelper.Page;
public interface AuditMapper {
int deleteByPrimaryKey(Integer auditId);
......@@ -13,7 +17,8 @@ public interface AuditMapper {
int updateByPrimaryKeySelective(TabHaobanAudit record);
int updateByPrimaryKeyWithBLOBs(TabHaobanAudit record);
int updateByPrimaryKey(TabHaobanAudit record);
Page<TabHaobanAudit> page(Integer auditType, List<String> storeIds,List<String>staffIds, String enterpriseId );
}
\ No newline at end of file
......@@ -20,6 +20,10 @@ public class TabHaobanAudit implements Serializable {
private String changeField;
private String oldValue;
private String newValue;
private Date commitTime;
private String enterpriseId;
......@@ -30,10 +34,6 @@ public class TabHaobanAudit implements Serializable {
private String auditReason;
private String oldValue;
private String newValue;
private static final long serialVersionUID = 1L;
public Integer getAuditId() {
......@@ -100,6 +100,22 @@ public class TabHaobanAudit implements Serializable {
this.changeField = changeField == null ? null : changeField.trim();
}
public String getOldValue() {
return oldValue;
}
public void setOldValue(String oldValue) {
this.oldValue = oldValue == null ? null : oldValue.trim();
}
public String getNewValue() {
return newValue;
}
public void setNewValue(String newValue) {
this.newValue = newValue == null ? null : newValue.trim();
}
public Date getCommitTime() {
return commitTime;
}
......@@ -139,20 +155,4 @@ public class TabHaobanAudit implements Serializable {
public void setAuditReason(String auditReason) {
this.auditReason = auditReason == null ? null : auditReason.trim();
}
public String getOldValue() {
return oldValue;
}
public void setOldValue(String oldValue) {
this.oldValue = oldValue == null ? null : oldValue.trim();
}
public String getNewValue() {
return newValue;
}
public void setNewValue(String newValue) {
this.newValue = newValue == null ? null : newValue.trim();
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.service.out.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.AuditDTO;
import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.service.dao.mapper.AuditMapper;
import com.gic.haoban.manage.service.entity.TabHaobanAudit;
import com.github.pagehelper.PageHelper;
/**
* Created by tgs on 2020/2/9.
*/
public class AuditApiServiceImpl implements AuditApiService{
@Autowired
private AuditMapper auditMapper;
@Override
public Page<AuditDTO> page(Integer auditType, String search,
String enterpriseId, BasePageInfo pageInfo) {
//TODO 通过search模糊查找storeIds,和staffIds
List<String> storeIds = new ArrayList<>();
List<String> staffIds = new ArrayList<>();
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
com.github.pagehelper.Page<TabHaobanAudit> page = auditMapper.page(auditType, storeIds, staffIds, enterpriseId);
return PageUtil.changePageHelperToCurrentPage( page,AuditDTO.class);
}
}
......@@ -18,7 +18,7 @@ import com.github.pagehelper.PageHelper;
/**
* Created by tgs on 2020/2/9.
*/
public class DictServiceImpl implements DictApiService{
public class DictApiServiceImpl implements DictApiService{
@Autowired
private DictMapper dictMapper;
@Override
......
......@@ -35,6 +35,7 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.ApplicationSettingApiService" ref="applicationSettingApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.AuditSettingApiService" ref="auditSettingApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.DictApiService" ref="dictApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.AuditApiService" ref="auditApiServiceImpl" timeout="10000"/>
<dubbo:reference interface="com.gic.enterprise.api.service.DepartmentService" id="gicDepartmentService"/>
......
......@@ -10,29 +10,22 @@
<result column="commit_staff_img" property="commitStaffImg" jdbcType="VARCHAR" />
<result column="commit_store_id" property="commitStoreId" jdbcType="VARCHAR" />
<result column="change_field" property="changeField" jdbcType="VARCHAR" />
<result column="old_value" property="oldValue" jdbcType="VARCHAR" />
<result column="new_value" property="newValue" jdbcType="VARCHAR" />
<result column="commit_time" property="commitTime" jdbcType="TIMESTAMP" />
<result column="enterprise_id" property="enterpriseId" jdbcType="VARCHAR" />
<result column="audit_name" property="auditName" jdbcType="VARCHAR" />
<result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
<result column="audit_reason" property="auditReason" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.gic.haoban.manage.service.entity.TabHaobanAudit" extends="BaseResultMap" >
<result column="old_value" property="oldValue" jdbcType="LONGVARCHAR" />
<result column="new_value" property="newValue" jdbcType="LONGVARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
audit_id, audit_type, commit_name, commit_staff_id, commit_staff_name, commit_staff_img,
commit_store_id, change_field, commit_time, enterprise_id, audit_name, audit_status,
audit_reason
</sql>
<sql id="Blob_Column_List" >
old_value, new_value
commit_store_id, change_field, old_value, new_value, commit_time, enterprise_id,
audit_name, audit_status, audit_reason
</sql>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from tab_haoban_audit
where audit_id = #{auditId,jdbcType=INTEGER}
</select>
......@@ -43,15 +36,15 @@
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
insert into tab_haoban_audit (audit_id, audit_type, commit_name,
commit_staff_id, commit_staff_name, commit_staff_img,
commit_store_id, change_field, commit_time,
enterprise_id, audit_name, audit_status,
audit_reason, old_value, new_value
commit_store_id, change_field, old_value,
new_value, commit_time, enterprise_id,
audit_name, audit_status, audit_reason
)
values (#{auditId,jdbcType=INTEGER}, #{auditType,jdbcType=INTEGER}, #{commitName,jdbcType=VARCHAR},
#{commitStaffId,jdbcType=INTEGER}, #{commitStaffName,jdbcType=VARCHAR}, #{commitStaffImg,jdbcType=VARCHAR},
#{commitStoreId,jdbcType=VARCHAR}, #{changeField,jdbcType=VARCHAR}, #{commitTime,jdbcType=TIMESTAMP},
#{enterpriseId,jdbcType=VARCHAR}, #{auditName,jdbcType=VARCHAR}, #{auditStatus,jdbcType=INTEGER},
#{auditReason,jdbcType=VARCHAR}, #{oldValue,jdbcType=LONGVARCHAR}, #{newValue,jdbcType=LONGVARCHAR}
#{commitStoreId,jdbcType=VARCHAR}, #{changeField,jdbcType=VARCHAR}, #{oldValue,jdbcType=VARCHAR},
#{newValue,jdbcType=VARCHAR}, #{commitTime,jdbcType=TIMESTAMP}, #{enterpriseId,jdbcType=VARCHAR},
#{auditName,jdbcType=VARCHAR}, #{auditStatus,jdbcType=INTEGER}, #{auditReason,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
......@@ -81,6 +74,12 @@
<if test="changeField != null" >
change_field,
</if>
<if test="oldValue != null" >
old_value,
</if>
<if test="newValue != null" >
new_value,
</if>
<if test="commitTime != null" >
commit_time,
</if>
......@@ -96,12 +95,6 @@
<if test="auditReason != null" >
audit_reason,
</if>
<if test="oldValue != null" >
old_value,
</if>
<if test="newValue != null" >
new_value,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="auditId != null" >
......@@ -128,6 +121,12 @@
<if test="changeField != null" >
#{changeField,jdbcType=VARCHAR},
</if>
<if test="oldValue != null" >
#{oldValue,jdbcType=VARCHAR},
</if>
<if test="newValue != null" >
#{newValue,jdbcType=VARCHAR},
</if>
<if test="commitTime != null" >
#{commitTime,jdbcType=TIMESTAMP},
</if>
......@@ -143,12 +142,6 @@
<if test="auditReason != null" >
#{auditReason,jdbcType=VARCHAR},
</if>
<if test="oldValue != null" >
#{oldValue,jdbcType=LONGVARCHAR},
</if>
<if test="newValue != null" >
#{newValue,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
......@@ -175,6 +168,12 @@
<if test="changeField != null" >
change_field = #{changeField,jdbcType=VARCHAR},
</if>
<if test="oldValue != null" >
old_value = #{oldValue,jdbcType=VARCHAR},
</if>
<if test="newValue != null" >
new_value = #{newValue,jdbcType=VARCHAR},
</if>
<if test="commitTime != null" >
commit_time = #{commitTime,jdbcType=TIMESTAMP},
</if>
......@@ -190,33 +189,9 @@
<if test="auditReason != null" >
audit_reason = #{auditReason,jdbcType=VARCHAR},
</if>
<if test="oldValue != null" >
old_value = #{oldValue,jdbcType=LONGVARCHAR},
</if>
<if test="newValue != null" >
new_value = #{newValue,jdbcType=LONGVARCHAR},
</if>
</set>
where audit_id = #{auditId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
update tab_haoban_audit
set audit_type = #{auditType,jdbcType=INTEGER},
commit_name = #{commitName,jdbcType=VARCHAR},
commit_staff_id = #{commitStaffId,jdbcType=INTEGER},
commit_staff_name = #{commitStaffName,jdbcType=VARCHAR},
commit_staff_img = #{commitStaffImg,jdbcType=VARCHAR},
commit_store_id = #{commitStoreId,jdbcType=VARCHAR},
change_field = #{changeField,jdbcType=VARCHAR},
commit_time = #{commitTime,jdbcType=TIMESTAMP},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
audit_name = #{auditName,jdbcType=VARCHAR},
audit_status = #{auditStatus,jdbcType=INTEGER},
audit_reason = #{auditReason,jdbcType=VARCHAR},
old_value = #{oldValue,jdbcType=LONGVARCHAR},
new_value = #{newValue,jdbcType=LONGVARCHAR}
where audit_id = #{auditId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
update tab_haoban_audit
set audit_type = #{auditType,jdbcType=INTEGER},
......@@ -226,6 +201,8 @@
commit_staff_img = #{commitStaffImg,jdbcType=VARCHAR},
commit_store_id = #{commitStoreId,jdbcType=VARCHAR},
change_field = #{changeField,jdbcType=VARCHAR},
old_value = #{oldValue,jdbcType=VARCHAR},
new_value = #{newValue,jdbcType=VARCHAR},
commit_time = #{commitTime,jdbcType=TIMESTAMP},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
audit_name = #{auditName,jdbcType=VARCHAR},
......@@ -233,4 +210,35 @@
audit_reason = #{auditReason,jdbcType=VARCHAR}
where audit_id = #{auditId,jdbcType=INTEGER}
</update>
<sql id="storeSql">
<if test="null != storeIds and storeIds.size gt 0">
and commit_store_id in
<foreach collection="storeIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</sql>
<sql id="staffSql">
<if test="null != staffIds and staffIds.size gt 0">
and commit_staff_id in
<foreach collection="staffIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</sql>
<select id="page" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_audit
where 1=1
<if test = "audit_type != null">
and audit_type = #{auditType,jdbcType=INTEGER}
</if>
<if test = "audit_status != null">
and audit_status = #{auditStatus,jdbcType=INTEGER}
</if>
<include refid="storeSql"/>
<include refid="staffSql"/>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment