去掉套餐用户绑定功能逻辑
This commit is contained in:
@@ -42,8 +42,6 @@ public class PrcPriceSet extends BaseEntity
|
||||
private List<PrcPriceSetDetail> details;
|
||||
private List<PrcPriceSetVersion> versions;
|
||||
private List<PrcCustomerPriceSet> customers;
|
||||
/** viewers explicitly bound to this package */
|
||||
private List<PrcPriceSetUser> viewers;
|
||||
/** async save task id (not persisted) */
|
||||
private String saveTaskId;
|
||||
/** Y: ignored on save; library pull only via /detail/pullFromLibrary */
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.bms.price.domain;
|
||||
|
||||
import com.bms.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/** 套餐可查看人绑定:prc_price_set_user */
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PrcPriceSetUser extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long psuId;
|
||||
private Long priceSetId;
|
||||
private Long userId;
|
||||
/** login account */
|
||||
private String userName;
|
||||
/** display only, not a table column */
|
||||
private String nickName;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.bms.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.price.domain.PrcPriceSetUser;
|
||||
|
||||
public interface PrcPriceSetUserMapper
|
||||
{
|
||||
PrcPriceSetUser selectPrcPriceSetUserById(Long psuId);
|
||||
|
||||
List<PrcPriceSetUser> selectPrcPriceSetUserList(PrcPriceSetUser query);
|
||||
|
||||
int insertPrcPriceSetUser(PrcPriceSetUser row);
|
||||
|
||||
int deletePrcPriceSetUserByIds(Long[] psuIds);
|
||||
|
||||
int deleteByPriceSetId(Long priceSetId);
|
||||
|
||||
int countBySetAndUser(@Param("priceSetId") Long priceSetId, @Param("userId") Long userId);
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import com.bms.price.domain.PrcPriceSet;
|
||||
import com.bms.price.domain.PrcPriceSetCheckItem;
|
||||
import com.bms.price.domain.PrcPriceSetDetail;
|
||||
import com.bms.price.domain.PrcPriceSetSaveTask;
|
||||
import com.bms.price.domain.PrcPriceSetUser;
|
||||
|
||||
/**
|
||||
* 价格套餐 服务层
|
||||
@@ -92,12 +91,6 @@ public interface IPrcPriceSetService
|
||||
|
||||
public int deleteCustomerByIds(Long[] customerPricesetIds);
|
||||
|
||||
public List<PrcPriceSetUser> selectViewerList(PrcPriceSetUser query);
|
||||
|
||||
public int insertViewer(PrcPriceSetUser row);
|
||||
|
||||
public int deleteViewerByIds(Long[] psuIds);
|
||||
|
||||
/** chain expire_time = next version effective_time, then refresh 0/3/1/2 */
|
||||
public int refreshAllVersionStatus();
|
||||
|
||||
|
||||
+2
-62
@@ -30,7 +30,6 @@ import com.bms.price.domain.BmsProductCountry;
|
||||
import com.bms.price.domain.PrcCustomerPriceSet;
|
||||
import com.bms.price.domain.PrcPriceExcelFile;
|
||||
import com.bms.price.domain.PrcPriceSet;
|
||||
import com.bms.price.domain.PrcPriceSetUser;
|
||||
import com.bms.price.domain.PrcPriceSetCheckItem;
|
||||
import com.bms.price.domain.PrcPriceSetDetail;
|
||||
import com.bms.price.domain.PrcPriceSetProduct;
|
||||
@@ -44,12 +43,9 @@ import com.bms.price.mapper.PrcCustomerPriceSetMapper;
|
||||
import com.bms.price.mapper.PrcPriceSetDetailMapper;
|
||||
import com.bms.price.mapper.PrcPriceSetMapper;
|
||||
import com.bms.price.mapper.PrcPriceSetProductMapper;
|
||||
import com.bms.price.mapper.PrcPriceSetUserMapper;
|
||||
import com.bms.price.mapper.PrcPriceSetVersionMapper;
|
||||
import com.bms.price.mapper.PrcSurchargeMapper;
|
||||
import com.bms.price.mapper.PrcSurchargeRelMapper;
|
||||
import com.bms.common.core.domain.entity.SysUser;
|
||||
import com.bms.system.mapper.SysUserMapper;
|
||||
import com.bms.price.service.IBmsProductService;
|
||||
import com.bms.price.search.IBillSearchStore;
|
||||
import com.bms.price.search.PriceChangeEsLog;
|
||||
@@ -105,12 +101,6 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService
|
||||
@Autowired
|
||||
private PrcCustomerPriceSetMapper customerMapper;
|
||||
|
||||
@Autowired
|
||||
private PrcPriceSetUserMapper priceSetUserMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Autowired
|
||||
private BmsProductCountryMapper productCountryMapper;
|
||||
|
||||
@@ -149,18 +139,14 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService
|
||||
}
|
||||
|
||||
/**
|
||||
* Price-set list data scope: bound customer's sales user (same as customer list),
|
||||
* package creator, or explicit viewer bind. Super admin skips filter in DataScopeAspect.
|
||||
* Price-set list data scope: bound customer's sales user (same as customer list)
|
||||
* or package creator. Super admin skips filter in DataScopeAspect.
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "su", deptField = "dept_id", userAlias = "su", userField = "user_id",
|
||||
permission = "price:set:list")
|
||||
public List<PrcPriceSet> selectPrcPriceSetList(PrcPriceSet set)
|
||||
{
|
||||
if (set != null)
|
||||
{
|
||||
set.getParams().put("viewerUserId", SecurityUtils.getUserId());
|
||||
}
|
||||
List<PrcPriceSet> list = setMapper.selectPrcPriceSetList(set);
|
||||
for (PrcPriceSet item : list)
|
||||
{
|
||||
@@ -2468,49 +2454,6 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService
|
||||
return customerMapper.deletePrcCustomerPriceSetByIds(customerPricesetIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcPriceSetUser> selectViewerList(PrcPriceSetUser query)
|
||||
{
|
||||
return priceSetUserMapper.selectPrcPriceSetUserList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertViewer(PrcPriceSetUser row)
|
||||
{
|
||||
if (row == null || row.getPriceSetId() == null || row.getUserId() == null)
|
||||
{
|
||||
throw new ServiceException("price set user bind requires priceSetId and userId");
|
||||
}
|
||||
requireSet(row.getPriceSetId());
|
||||
if (priceSetUserMapper.countBySetAndUser(row.getPriceSetId(), row.getUserId()) > 0)
|
||||
{
|
||||
throw new ServiceException("user already bound to this price set");
|
||||
}
|
||||
SysUser user = sysUserMapper.selectUserById(row.getUserId());
|
||||
if (user == null)
|
||||
{
|
||||
throw new ServiceException("user not found");
|
||||
}
|
||||
row.setUserName(user.getUserName());
|
||||
if (StringUtils.isEmpty(row.getCreateBy()))
|
||||
{
|
||||
row.setCreateBy(SecurityUtils.getUsername());
|
||||
}
|
||||
return priceSetUserMapper.insertPrcPriceSetUser(row);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteViewerByIds(Long[] psuIds)
|
||||
{
|
||||
if (psuIds == null || psuIds.length == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return priceSetUserMapper.deletePrcPriceSetUserByIds(psuIds);
|
||||
}
|
||||
|
||||
private void replaceChildren(PrcPriceSet set)
|
||||
{
|
||||
saveOrUpdateVersion(set);
|
||||
@@ -3277,9 +3220,6 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService
|
||||
PrcCustomerPriceSet cquery = new PrcCustomerPriceSet();
|
||||
cquery.setPriceSetId(priceSetId);
|
||||
set.setCustomers(customerMapper.selectPrcCustomerPriceSetList(cquery));
|
||||
PrcPriceSetUser uquery = new PrcPriceSetUser();
|
||||
uquery.setPriceSetId(priceSetId);
|
||||
set.setViewers(priceSetUserMapper.selectPrcPriceSetUserList(uquery));
|
||||
}
|
||||
|
||||
private void fillVersionChildren(PrcPriceSetVersion version)
|
||||
|
||||
Reference in New Issue
Block a user