Commit 32b049b9 by zhiwj

门店完善状态

parent 7750cd19
......@@ -75,6 +75,8 @@ public class StoreDTO implements Serializable {
*/
private Integer status;
private Integer completeStatus;
/**
* erp门店状态
*/
......@@ -111,6 +113,7 @@ public class StoreDTO implements Serializable {
private String provinces;
private Integer createType;
public Integer getStoreId() {
return storeId;
}
......@@ -334,4 +337,12 @@ public class StoreDTO implements Serializable {
public void setCreateType(Integer createType) {
this.createType = createType;
}
public Integer getCompleteStatus() {
return completeStatus;
}
public void setCompleteStatus(Integer completeStatus) {
this.completeStatus = completeStatus;
}
}
......@@ -82,6 +82,11 @@ public class TabStore {
private Integer overflowStatus;
/**
* 完善标识(0:未完善,1:已完善)
*/
private Integer completeStatus;
/**
* 门店启用状态;1启用 2不启用
*/
private Integer status;
......@@ -236,6 +241,14 @@ public class TabStore {
this.overflowStatus = overflowStatus;
}
public Integer getCompleteStatus() {
return completeStatus;
}
public void setCompleteStatus(Integer completeStatus) {
this.completeStatus = completeStatus;
}
public Integer getStatus() {
return status;
}
......
......@@ -52,4 +52,6 @@ public interface StoreService {
Integer countByStoreCode(Integer enterpriseId, String storeCode, Integer storeId);
Page listStore(StoreDTO storeDTO, Integer pageNum, Integer pageSize);
Integer checkCompleteStatus(StoreDTO storeDTO);
}
package com.gic.store.service.impl;
import com.gic.commons.util.GlobalInfo;
import com.gic.store.dao.mapper.TabStoreMapper;
import com.gic.store.dto.StoreDTO;
import com.gic.store.entity.TabStore;
import com.gic.store.service.StoreService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -38,7 +41,9 @@ public class StoreServiceImpl implements StoreService {
tabStore.setProvinces(copy.getProvinces());
tabStore.setLongitude(copy.getLongitude());
tabStore.setLatitude(copy.getLatitude());
tabStore.setCompleteStatus(copy.getCompleteStatus());
// TODO 这里要判断一下总量
tabStore.setOverflowStatus(0);
tabStore.setStatus(copy.getStatus());
......@@ -73,7 +78,7 @@ public class StoreServiceImpl implements StoreService {
tabStore.setErpStatus(copy.getErpStatus());
tabStore.setStoreType(copy.getStoreType());
tabStore.setStoreGroupId(copy.getStoreGroupId());
tabStore.setUpdateTime(copy.getUpdateTime());
tabStore.setCompleteStatus(copy.getCompleteStatus());
return tabStoreMapper.updateByPrimaryKeySelective(tabStore);
}
......@@ -114,4 +119,25 @@ public class StoreServiceImpl implements StoreService {
PageHelper.startPage(pageNum, pageSize);
return tabStoreMapper.listStore(storeDTO);
}
@Override
public Integer checkCompleteStatus(StoreDTO storeDTO) {
return StringUtils.isNotBlank(storeDTO.getStoreName()) &&
storeDTO.getRegionId() != null &&
StringUtils.isNotBlank(storeDTO.getStoreCode()) &&
CollectionUtils.isNotEmpty(storeDTO.getPhotoList()) &&
storeDTO.getStoreType() != null &&
storeDTO.getErpStatus() != null &&
StringUtils.isNotBlank(storeDTO.getConactsPhone()) &&
CollectionUtils.isNotEmpty(storeDTO.getBusinessTimeList()) &&
storeDTO.getStoreGroupId() != null &&
StringUtils.isNotBlank(storeDTO.getBrandIds()) &&
StringUtils.isNotBlank(storeDTO.getProvinces()) &&
StringUtils.isNotBlank(storeDTO.getLongitude()) &&
StringUtils.isNotBlank(storeDTO.getLatitude()) &&
StringUtils.isNotBlank(storeDTO.getAddress())
? GlobalInfo.DATA_STATUS_NORMAL
: GlobalInfo.DATA_STATUS_DELETE
;
}
}
......@@ -49,7 +49,8 @@ public class StoreApiServiceImpl implements StoreApiService {
if (count > 0) {
return ServiceResponse.failure(ErrorCode.ERR_6.getCode(), "关联主键参数已经存在");
}
Integer completeStatus = storeService.checkCompleteStatus(storeDTO);
storeDTO.setCompleteStatus(completeStatus);
// 门店自身信息
if (storeDTO.getStoreId() == null) {
Integer id = storeService.save(storeDTO);
......
......@@ -87,7 +87,6 @@ public class StoreBrandApiServiceImpl implements StoreBrandApiService {
@Override
public ServiceResponse<List<Integer>> deleteByIds(Integer enterpriseId, String ids) {
//TODO 要查询门店中是否使用门店品牌
List<Integer> notDelList = new ArrayList<>();
if (StringUtils.isNotBlank(ids)) {
String[] idArr = ids.split(GlobalInfo.FLAG_COMMA);
......
......@@ -17,6 +17,7 @@
<result column="longitude" jdbcType="VARCHAR" property="longitude" />
<result column="latitude" jdbcType="VARCHAR" property="latitude" />
<result column="overflow_status" jdbcType="INTEGER" property="overflowStatus" />
<result column="complete_status" jdbcType="INTEGER" property="completeStatus" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="erp_status" jdbcType="INTEGER" property="erpStatus" />
<result column="store_type" jdbcType="INTEGER" property="storeType" />
......@@ -28,7 +29,8 @@
<sql id="Base_Column_List">
store_id, enterprise_id, store_name, store_code, region_id, conacts_phone, address,
brand_ids, province_id, city_id, area_id, provinces, longitude, latitude, overflow_status,
status, erp_status, store_type, store_group_id, create_type, create_time, update_time
complete_status, status, erp_status, store_type, store_group_id, create_type, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -41,30 +43,24 @@
where store_id = #{storeId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.store.entity.TabStore">
<selectKey keyProperty="storeId" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_store (store_id, enterprise_id, store_name,
store_code, region_id, conacts_phone,
address, brand_ids, province_id,
city_id, area_id, provinces,
longitude, latitude, overflow_status,
status, erp_status, store_type,
store_group_id, create_type, create_time,
update_time)
complete_status, status, erp_status,
store_type, store_group_id, create_type,
create_time, update_time)
values (#{storeId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{storeName,jdbcType=VARCHAR},
#{storeCode,jdbcType=VARCHAR}, #{regionId,jdbcType=INTEGER}, #{conactsPhone,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR}, #{brandIds,jdbcType=VARCHAR}, #{provinceId,jdbcType=VARCHAR},
#{cityId,jdbcType=VARCHAR}, #{areaId,jdbcType=VARCHAR}, #{provinces,jdbcType=VARCHAR},
#{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, #{overflowStatus,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{erpStatus,jdbcType=INTEGER}, #{storeType,jdbcType=INTEGER},
#{storeGroupId,jdbcType=INTEGER}, #{createType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
#{completeStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{erpStatus,jdbcType=INTEGER},
#{storeType,jdbcType=INTEGER}, #{storeGroupId,jdbcType=INTEGER}, #{createType,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.store.entity.TabStore">
<selectKey keyProperty="storeId" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_store
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="storeId != null">
......@@ -112,6 +108,9 @@
<if test="overflowStatus != null">
overflow_status,
</if>
<if test="completeStatus != null">
complete_status,
</if>
<if test="status != null">
status,
</if>
......@@ -180,6 +179,9 @@
<if test="overflowStatus != null">
#{overflowStatus,jdbcType=INTEGER},
</if>
<if test="completeStatus != null">
#{completeStatus,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
......@@ -248,6 +250,9 @@
<if test="overflowStatus != null">
overflow_status = #{overflowStatus,jdbcType=INTEGER},
</if>
<if test="completeStatus != null">
complete_status = #{completeStatus,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
......@@ -288,6 +293,7 @@
longitude = #{longitude,jdbcType=VARCHAR},
latitude = #{latitude,jdbcType=VARCHAR},
overflow_status = #{overflowStatus,jdbcType=INTEGER},
complete_status = #{completeStatus,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
erp_status = #{erpStatus,jdbcType=INTEGER},
store_type = #{storeType,jdbcType=INTEGER},
......@@ -311,7 +317,7 @@
and store_code = #{storeCode}
</if>
<if test="storeId != null">
and store_id &lt;&gt; #{storeId}
and store_id &lt;&gt; #{storeId}
</if>
</where>
</select>
......@@ -327,7 +333,6 @@
<select id="listStore" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_store
from tab_store
</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