Commit 27ba25f8 by zhiwj

提交门店

parent 09bd7ca5
......@@ -61,4 +61,6 @@ public interface TabStoreExtendMapper {
int countStoreExtendStoreField(@Param("storeField") Integer storeField, @Param("storeFieldSelectId") Integer storeFieldSelectId);
int countExtendByValue(@Param("storeFieldId") Integer storeFieldId, @Param("value") String value, @Param("storeExtendId") Integer storeExtendId);
void delete(@Param("enterpriseId") Integer enterpriseId, @Param("storeInfoId") Integer storeInfoId);
}
\ No newline at end of file
package com.gic.store.service.impl;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.error.ErrorCode;
......@@ -21,6 +11,15 @@ import com.gic.store.entity.TabStoreField;
import com.gic.store.service.StoreExtendService;
import com.gic.store.service.StoreFieldService;
import com.gic.store.utils.field.FieldBase;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
* @author zhiwj
......@@ -39,6 +38,9 @@ public class StoreExtendServiceImpl implements StoreExtendService {
@Transactional(rollbackFor = Exception.class)
public void saveOrUpdate(Integer enterpriseId, Integer storeInfoId, List<StoreExtendDTO> storeExtendList) {
if (CollectionUtils.isNotEmpty(storeExtendList)) {
this.tabStoreExtendMapper.delete(enterpriseId, storeInfoId);
List<TabStoreExtend> tabStoreExtendList = EntityUtil.changeEntityListByOrika(TabStoreExtend.class, storeExtendList);
for (TabStoreExtend tabStoreExtend : tabStoreExtendList) {
TabStoreField field = storeFieldService.getStoreFieldById(tabStoreExtend.getStoreFieldId());
......@@ -56,12 +58,12 @@ public class StoreExtendServiceImpl implements StoreExtendService {
tabStoreExtend.setEnterpriseId(enterpriseId);
tabStoreExtend.setStoreInfoId(storeInfoId);
if (tabStoreExtend.getStoreExtendId() == null) {
tabStoreExtend.setCreateTime(new Date());
tabStoreExtendMapper.insertSelective(tabStoreExtend);
} else {
tabStoreExtendMapper.updateByPrimaryKeySelective(tabStoreExtend);
}
// if (tabStoreExtend.getStoreExtendId() == null) {
tabStoreExtend.setCreateTime(new Date());
tabStoreExtendMapper.insertSelective(tabStoreExtend);
// } else {
// tabStoreExtendMapper.updateByPrimaryKeySelective(tabStoreExtend);
// }
}
}
}
......
......@@ -165,4 +165,7 @@
and store_extend_id &lt;&gt; #{storeExtendId}
</if>
</select>
<delete id="delete">
delete from tab_store_extend where enterprise_id = #{enterpriseId} and store_info_id = #{storeInfoId}
</delete>
</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