Commit db550865 by zhiwj

Merge branch 'developer' into 'master'

Developer

See merge request !34
parents 23c21dd9 70bc4626
......@@ -201,6 +201,11 @@
<artifactId>gic-weimob-api</artifactId>
<version>${gic-weimob-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>widget-screening-api</artifactId>
<version>${widget-screening-api}</version>
</dependency>
</dependencies>
<build>
......
......@@ -69,5 +69,5 @@ public interface TabAppletServiceConfigMapper {
void updateTime(@Param("appId") String appId, @Param("type") int type, @Param("updateTime") Date date);
void delByConfigIdList(@Param("ids") List<Long> configIdList, @Param("enterpriseId") Integer enterpriseId);
void delByConfigIdList(@Param("ids") List<Long> configIdList, @Param("enterpriseId") Integer enterpriseId, @Param("type") int type);
}
\ No newline at end of file
......@@ -53,7 +53,7 @@ public class AppletServiceConfigServiceImpl implements AppletServiceConfigServic
// 先删除configId不在入参里的 如果入参是空的 就全部删除
List<Long> configIdList = Optional.ofNullable(responseResult).orElse(Collections.emptyList())
.stream().map(AppletsConfigSimpleOutputDTO::getAppletConfigId).collect(Collectors.toList());
tabAppletServiceConfigMapper.delByConfigIdList(configIdList, enterpriseId);
tabAppletServiceConfigMapper.delByConfigIdList(configIdList, enterpriseId, AppletServiceConfigEnum.APPLET.getCode());
List<TabAppletServiceConfig> configList = Optional.ofNullable(responseResult).orElse(Collections.emptyList()).stream()
.filter(e -> tabAppletServiceConfigMapper.getByConfigId(enterpriseId, e.getAppletConfigId()) == null)
......@@ -77,7 +77,7 @@ public class AppletServiceConfigServiceImpl implements AppletServiceConfigServic
public void syncServiceConfig(List<ServiceConfigSimpleOutputDTO> responseResult, Integer enterpriseId) {
List<Long> configIdList = Optional.ofNullable(responseResult).orElse(Collections.emptyList())
.stream().map(ServiceConfigSimpleOutputDTO::getServiceConfigId).collect(Collectors.toList());
tabAppletServiceConfigMapper.delByConfigIdList(configIdList, enterpriseId);
tabAppletServiceConfigMapper.delByConfigIdList(configIdList, enterpriseId, AppletServiceConfigEnum.SERVICE_CONFIG.getCode());
List<TabAppletServiceConfig> configList = Optional.ofNullable(responseResult).orElse(Collections.emptyList()).stream()
.filter(e -> tabAppletServiceConfigMapper.getByConfigId(enterpriseId, e.getServiceConfigId()) == null)
......
......@@ -12,6 +12,7 @@ import com.gic.enterprise.service.EnterpriseInitApiService;
import com.gic.enterprise.service.EnterpriseInitService;
import com.gic.enterprise.service.EnterpriseService;
import com.gic.member.api.service.MemberInitApiService;
import com.gic.widget.screening.api.service.EsScreeningEnterpriseInitService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -33,6 +34,8 @@ public class EnterpriseInitApiServiceImpl implements EnterpriseInitApiService{
private EnterpriseService enterpriseService;
@Autowired
private MemberInitApiService memberInitApiService;
@Autowired
private EsScreeningEnterpriseInitService esScreeningEnterpriseInitService;
private ServiceResponse<Void> initByConfigCode(String configCode, Integer enterpriseId) {
......@@ -94,6 +97,14 @@ public class EnterpriseInitApiServiceImpl implements EnterpriseInitApiService{
@Override
public ServiceResponse<Void> completeGoodsIndex(Integer enterpriseId) {
TabEnterprise enterprise = enterpriseService.getEnterpriseById(enterpriseId);
if (enterprise == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商户ID有误");
}
ServiceResponse<Void> result = esScreeningEnterpriseInitService.initGoodsES(enterpriseId, enterprise.getEnterpriseName());
if (!result.isSuccess()) {
return ServiceResponse.failure(result.getCode(), result.getMessage());
}
return initByConfigCode(EnterpriseInitCodeEnum.COMPLETE_GOODS_INDEX.getCode(), enterpriseId);
}
......
......@@ -145,4 +145,5 @@
<dubbo:reference interface="com.gic.weimob.api.service.WeimobMerchantService" id="weimobMerchantService" timeout="6000"/>
<dubbo:reference interface="com.gic.open.api.service.EnterpriseLicenseApiService" id="enterpriseLicenseApiService" timeout="6000" />
<dubbo:reference interface="com.gic.widget.screening.api.service.EsScreeningEnterpriseInitService" id="esScreeningEnterpriseInitService" timeout="6000" />
</beans>
......@@ -211,7 +211,7 @@
</update>
<!-- delByConfigIdList-->
<update id="delByConfigIdList">
update tab_applet_service_config set status = 0 where enterprise_id = #{enterpriseId}
update tab_applet_service_config set status = 0 where enterprise_id = #{enterpriseId} and type = #{type}
<if test="null != ids and ids.size > 0">
and config_id not in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
......
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