mirror of https://github.com/jeecgboot/jeecg-boot
Limit client sku association to active clients
parent
6c79152c89
commit
d51d68abb9
|
@ -20,6 +20,7 @@ public interface ClientMapper extends BaseMapper<Client> {
|
|||
String getClientEntity(@Param("id") String id);
|
||||
Map<String, String> getClientsEntity(@Param("ids") List<String> ids);
|
||||
String getClientIdByCode(@Param("code") String code);
|
||||
String getActiveClientIdByCode(@Param("code") String code);
|
||||
List<Client> getClientByType(@Param("type") String type);
|
||||
Client getClientByCode(@Param("code") String internalCode);
|
||||
Client getClientFromOrder(@Param("orderId")String orderId);
|
||||
|
|
|
@ -24,6 +24,11 @@
|
|||
FROM client
|
||||
WHERE internal_code = #{code}
|
||||
</select>
|
||||
<select id="getActiveClientByCode" parameterType="java.lang.String" resultType="org.jeecg.modules.business.entity.Client">
|
||||
SELECT *
|
||||
FROM client
|
||||
WHERE internal_code = #{code} AND active = 1
|
||||
</select>
|
||||
<select id="getClientByType" resultType="org.jeecg.modules.business.entity.Client">
|
||||
SELECT c.*
|
||||
FROM client c
|
||||
|
|
|
@ -41,6 +41,7 @@ public interface IClientService extends IService<Client> {
|
|||
public String getClientEntity(String id);
|
||||
public Map<String, String> getClientsEntity(List<String> ids);
|
||||
public String getClientIdByCode(String code);
|
||||
public String getActiveClientIdByCode(String code);
|
||||
/**
|
||||
* Get current user's client information
|
||||
* @return client or null if current user's role is not client
|
||||
|
|
|
@ -161,6 +161,10 @@ public class ClientServiceImpl extends ServiceImpl<ClientMapper, Client> impleme
|
|||
public String getClientIdByCode(String code) {
|
||||
return clientMapper.getClientIdByCode(code);
|
||||
}
|
||||
@Override
|
||||
public String getActiveClientIdByCode(String code) {
|
||||
return clientMapper.getActiveClientIdByCode(code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void anonymizePersonalData(int directClientAnonymizationPeriod) {
|
||||
|
|
|
@ -49,7 +49,7 @@ public class ClientSkuServiceImpl extends ServiceImpl<ClientSkuMapper, ClientSku
|
|||
continue;
|
||||
}
|
||||
String internalCode = erpCode.substring(index+1);
|
||||
String clientId = clientService.getClientIdByCode(internalCode);
|
||||
String clientId = clientService.getActiveClientIdByCode(internalCode);
|
||||
if (clientId != null) {
|
||||
log.info("Associating sku \"{}\" with client \"{}\" : \"{}\". ", sku.getErpCode(), internalCode, clientId);
|
||||
addClientSku(clientId, sku.getId());
|
||||
|
|
|
@ -410,7 +410,7 @@ public class SkuListMabangServiceImpl extends ServiceImpl<SkuListMabangMapper, S
|
|||
s.setZhName(skuData.getNameCN());
|
||||
}
|
||||
}
|
||||
if(skuData.getStockPicture().equals("") || skuData.getStockPicture() == null) {
|
||||
if(skuData.getStockPicture() == null || skuData.getStockPicture().isEmpty()) {
|
||||
s.setImageSource(skuData.getSalePicture());
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue