Commit 50a96bef by 陶光胜

门店品牌变更

parent b961c872
package com.gic.store.service;
import com.gic.api.base.commons.ServiceResponse;
public interface UnionStoreChangeApiService {
/**
* save
* @Title: save
* @Description: 保存商户下联合商户资源组授权范围变化日志
* @author taogs
* @param ownEnterpriseId
* @param unionEnterpriseId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> save(Integer ownEnterpriseId, Integer unionEnterpriseId);
}
package com.gic.store.dao.mapper;
import com.gic.store.entity.TabUnionStoreChangeLog;
import org.apache.ibatis.annotations.Param;
public interface TabUnionStoreChangeLogMapper {
/**
* 根据主键删除
*
* @param id 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer id);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabUnionStoreChangeLog record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabUnionStoreChangeLog record);
/**
* 根据主键查询
*
* @param id 主键
* @return 实体对象
*/
TabUnionStoreChangeLog selectByPrimaryKey(Integer id);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabUnionStoreChangeLog record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabUnionStoreChangeLog record);
/**
* selectByEnterpriseId
* @Title: selectByEnterpriseId
* @Description: 查询联合商户门店授权范围是否变更
* @author taogs
* @param ownEnterpriseId
* @param unionEnterpriseId
* @return com.gic.store.entity.TabUnionStoreChangeLog
* @throws
*/
TabUnionStoreChangeLog selectByEnterpriseId(@Param("ownEnterpriseId") Integer ownEnterpriseId, @Param("unionEnterpriseId") Integer unionEnterpriseId);
}
\ No newline at end of file
package com.gic.store.entity;
import java.util.Date;
/**
* tab_union_store_change_log
*/
public class TabUnionStoreChangeLog {
/**
*
*/
private Integer id;
/**
*
*/
private Integer ownerEnterpriseId;
/**
*
*/
private Integer unionEnterpriseId;
/**
* 改联合商户的授权范围是否发生变化;1是 0否
*/
private Integer change;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private Integer deleteFlag;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getOwnerEnterpriseId() {
return ownerEnterpriseId;
}
public void setOwnerEnterpriseId(Integer ownerEnterpriseId) {
this.ownerEnterpriseId = ownerEnterpriseId;
}
public Integer getUnionEnterpriseId() {
return unionEnterpriseId;
}
public void setUnionEnterpriseId(Integer unionEnterpriseId) {
this.unionEnterpriseId = unionEnterpriseId;
}
public Integer getChange() {
return change;
}
public void setChange(Integer change) {
this.change = change;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
}
\ No newline at end of file
package com.gic.store.service;
/**
*
* @ClassName: UnionStoreChangeService
* @Description:
* @author taogs
* @date 2021/2/9 11:11
*/
public interface UnionStoreChangeService {
/**
* save
* @Title: save
* @Description: 保存联合商户授权范围变更的日志
* @author taogs
* @param ownEnterpriseId
* @param unionEnterpriseId
* @return void
* @throws
*/
void save(Integer ownEnterpriseId, Integer unionEnterpriseId);
}
......@@ -1519,7 +1519,9 @@ public class StoreApiServiceImpl implements StoreApiService {
Integer enterpriseId = json.getInteger("enterpriseId");
Integer storeId = json.getInteger("storeId");
Integer logId = json.getInteger("logId");
if(logId == null){
logId = this.storeIndexLogService.saveStoreIndexLog(enterpriseId, storeId);
}
boolean isAdd = true;
DynamicSearchDTO dynamicSearchDTO = new DynamicSearchDTO();
JSONObject search = QueryConditionAssemblyUtil.createSimpleQueryNode("id", OperateEnum.OPERATE_EQ, enterpriseId + "_" + storeId);
......
package com.gic.store.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.service.UnionStoreChangeApiService;
import com.gic.store.service.UnionStoreChangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
* @ClassName: UnionStoreChangeApiServiceImpl
* @Description: 联合商户授权门店资源范围变更日志记录
* @author taogs
* @date 2021/2/9 11:07
*/
@Service("unionStoreChangeApiService")
public class UnionStoreChangeApiServiceImpl implements UnionStoreChangeApiService {
@Autowired
private UnionStoreChangeService unionStoreChangeService;
@Override
public ServiceResponse<Void> save(Integer ownEnterpriseId, Integer unionEnterpriseId) {
this.unionStoreChangeService.save(ownEnterpriseId, unionEnterpriseId);
return ServiceResponse.success();
}
}
package com.gic.store.service.outer.impl;
import com.gic.store.dao.mapper.TabUnionStoreChangeLogMapper;
import com.gic.store.entity.TabUnionStoreChangeLog;
import com.gic.store.service.UnionStoreChangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service("unionStoreChangeService")
public class UnionStoreChangeServiceImpl implements UnionStoreChangeService {
@Autowired
private TabUnionStoreChangeLogMapper tabUnionStoreChangeLogMapper;
@Override
public void save(Integer ownEnterpriseId, Integer unionEnterpriseId) {
TabUnionStoreChangeLog log = tabUnionStoreChangeLogMapper.selectByEnterpriseId(ownEnterpriseId, unionEnterpriseId);
if(log == null){
log = new TabUnionStoreChangeLog();
log.setChange(1);
log.setCreateTime(new Date());
log.setDeleteFlag(0);
log.setOwnerEnterpriseId(ownEnterpriseId);
log.setUnionEnterpriseId(unionEnterpriseId);
log.setUpdateTime(new Date());
tabUnionStoreChangeLogMapper.insertSelective(log);
} else {
if(log.getChange() == 0){
log.setChange(1);
tabUnionStoreChangeLogMapper.updateByPrimaryKeySelective(log);
}
}
}
}
......@@ -65,6 +65,7 @@
<dubbo:service interface="com.gic.store.service.DictApiService" ref="dictApiService" timeout="6000" />
<dubbo:service interface="com.gic.store.service.StoreTransferApiService" ref="storeTransferApiService" timeout="6000" />
<dubbo:service interface="com.gic.store.service.StoreWidgetLogApiService" ref="storeWidgetLogApiService" timeout="6000" />
<dubbo:service interface="com.gic.store.service.UnionStoreChangeApiService" ref="unionStoreChangeApiService" timeout="6000" />
<dubbo:reference interface="com.gic.weimob.api.service.WeimobStoreSiteApiService" id="weimobStoreSiteApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.enterprise.service.WmStoreSyncLogApiService" id="wmStoreSyncLogApiService" timeout="6000"/>
......
<?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.gic.store.dao.mapper.TabUnionStoreChangeLogMapper">
<resultMap id="BaseResultMap" type="com.gic.store.entity.TabUnionStoreChangeLog">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="owner_enterprise_id" jdbcType="INTEGER" property="ownerEnterpriseId" />
<result column="union_enterprise_id" jdbcType="INTEGER" property="unionEnterpriseId" />
<result column="change" jdbcType="INTEGER" property="change" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
</resultMap>
<sql id="Base_Column_List">
id, owner_enterprise_id, union_enterprise_id, change, create_time, update_time, delete_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_union_store_change_log
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_union_store_change_log
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.store.entity.TabUnionStoreChangeLog">
insert into tab_union_store_change_log (id, owner_enterprise_id, union_enterprise_id,
change, create_time, update_time,
delete_flag)
values (#{id,jdbcType=INTEGER}, #{ownerEnterpriseId,jdbcType=INTEGER}, #{unionEnterpriseId,jdbcType=INTEGER},
#{change,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{deleteFlag,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.store.entity.TabUnionStoreChangeLog">
insert into tab_union_store_change_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="ownerEnterpriseId != null">
owner_enterprise_id,
</if>
<if test="unionEnterpriseId != null">
union_enterprise_id,
</if>
<if test="change != null">
change,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="ownerEnterpriseId != null">
#{ownerEnterpriseId,jdbcType=INTEGER},
</if>
<if test="unionEnterpriseId != null">
#{unionEnterpriseId,jdbcType=INTEGER},
</if>
<if test="change != null">
#{change,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.store.entity.TabUnionStoreChangeLog">
update tab_union_store_change_log
<set>
<if test="ownerEnterpriseId != null">
owner_enterprise_id = #{ownerEnterpriseId,jdbcType=INTEGER},
</if>
<if test="unionEnterpriseId != null">
union_enterprise_id = #{unionEnterpriseId,jdbcType=INTEGER},
</if>
<if test="change != null">
change = #{change,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.store.entity.TabUnionStoreChangeLog">
update tab_union_store_change_log
set owner_enterprise_id = #{ownerEnterpriseId,jdbcType=INTEGER},
union_enterprise_id = #{unionEnterpriseId,jdbcType=INTEGER},
change = #{change,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByEnterpriseId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_union_store_change_log
where owner_enterprise_id = #{ownEnterpriseId,jdbcType=INTEGER} and union_enterprise_id = #{unionEnterpriseId, jdbcType=INTEGER} and delete_flag = 0
</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