Просмотр исходного кода

[招商][任务状态]

release_toaliyun_real
Burce 6 лет назад
Родитель
Сommit
283c6e0ec5
9 измененных файлов: 65 добавлений и 9 удалений
  1. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestTaskController.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestPageResult.java
  3. +3
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java
  4. +2
    -1
      mallinkService/src/main/java/com/iformall/service/WxRentContractService.java
  5. +7
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  6. +5
    -0
      mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java
  7. +29
    -1
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java
  8. +2
    -0
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestTaskServiceImpl.java
  9. +14
    -1
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml

+ 2
- 2
mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestTaskController.java Просмотреть файл

@@ -60,7 +60,7 @@ public class InvestTaskController extends InvestBaseController {
@SystemServiceLog
@PostMapping("/save")
public InvestResultData save(@RequestBody InvestTaskEntity investTask) {
return execute(investTask, p -> investTaskService.save(p));
return execute(investTask, p -> bizService.saveTask(p));
}

/**
@@ -69,7 +69,7 @@ public class InvestTaskController extends InvestBaseController {
@SystemServiceLog
@PostMapping("/update")
public InvestResultData update(@RequestBody InvestTaskEntity investTask) {
return execute(investTask, p -> investTaskService.updateById(p));
return execute(investTask, p -> bizService.updateTask(p));
}

/**


+ 1
- 1
mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestPageResult.java Просмотреть файл

@@ -33,7 +33,7 @@ public class InvestPageResult<T> {

public void setRecords(Collection<T> records) {
this.records = records;
if (total > (records.size() + current * size)) {
if (total > (records.size() + (current-1) * size)) {
hasNextPage = true;
}
}


+ 3
- 1
mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java Просмотреть файл

@@ -60,7 +60,8 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>

List<WxRentContract> selectRentContractByShopId(WxRentContract record);

List<WxRentContract> selectRentContractByShopIds(@Param("shopIds") Collection<Long> shopIds, @Param("shopIdsRegexp") String shopIdsRegexp);
List<WxRentContract> selectRentContractByShopIds(@Param("shopIds") Collection<Long> shopIds,
@Param("shopIdsRegexp") String shopIdsRegexp,@Param("tenantId") String tenantId);

int hasContractNumber(WxRentContract wxRentContract);

@@ -70,6 +71,7 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>

WxRentContract getByBill(WxBillRent billRent);

int selectContractCountByShopId(WxRentContract wxRentContract);
int getShopCountMax();

List<Map<String,Object>> queryContractByBus(WxBusiness wxBusiness);


+ 2
- 1
mallinkService/src/main/java/com/iformall/service/WxRentContractService.java Просмотреть файл

@@ -94,6 +94,7 @@ public interface WxRentContractService {

WxRentContract getByBill(WxBillRent billRent);

Map<Long,WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp);
Map<Long,WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp,String tenantId);

int selectContractCountByShopId(WxRentContract wxRentContract);
}

+ 7
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -2492,8 +2492,8 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}

@Override
public Map<Long, WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp) {
List<WxRentContract> list = wxRentContractMapper.selectRentContractByShopIds(shopIds, shopIdsRegexp);
public Map<Long, WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp,String tenantId) {
List<WxRentContract> list = wxRentContractMapper.selectRentContractByShopIds(shopIds, shopIdsRegexp,tenantId);
List<String> shopIdArr = Arrays.asList(StringUtils.split(shopIdsRegexp,"|")) ;
Map<Long, WxRentContract> allShopContract = new HashMap<>();
for (WxRentContract wxRentContract : list) {
@@ -2522,4 +2522,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
return allShopContract;
}

@Override
public int selectContractCountByShopId(WxRentContract wxRentContract) {
return wxRentContractMapper.selectContractCountByShopId(wxRentContract) ;
}
}

+ 5
- 0
mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java Просмотреть файл

@@ -3,6 +3,7 @@ package com.iformall.service.invest;
import com.iformall.domain.dto.InvestDemandDto;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.invest.InvestMessageEntity;
import com.iformall.domain.po.invest.InvestTaskEntity;
import com.iformall.domain.vo.invest.*;

import java.util.Collection;
@@ -31,6 +32,10 @@ public interface InvestBizService {

boolean updateCustomerAndDemand(InvestDemandDto customerDto) ;

boolean saveTask(InvestTaskEntity investTaskEntity) ;

boolean updateTask(InvestTaskEntity investTaskEntity) ;

InvestDemandVo findDemandById(Long id) ;

InvestTaskVo findTaskById(Long id) ;


+ 29
- 1
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java Просмотреть файл

@@ -152,7 +152,8 @@ public class InvestBizServiceImpl implements InvestBizService {
if (CollectionUtils.isNotEmpty(shops)) {
Collection<Long> shopPointIds = buildShopContractQuery(shops, EnumRentShopType.POINT);
Collection<Long> shopIds = buildShopContractQuery(shops, EnumRentShopType.SHOP);
shopContractMap = rentContractService.selectRentContractByShopIds(shopPointIds, StringUtils.join(shopIds, "|"));
shopContractMap = rentContractService.selectRentContractByShopIds(shopPointIds, StringUtils.join(shopIds, "|"),
InvestUserContext.getUser().getTenantId());
}
for (WxShop shop : shops) {
WxRentContract contract = shopContractMap.get(shop.getId());
@@ -367,6 +368,18 @@ public class InvestBizServiceImpl implements InvestBizService {
return demandService.updateById(demandEntity);
}

@Override
public boolean saveTask(InvestTaskEntity investTaskEntity) {
syncTargetStatus(investTaskEntity);
return taskService.save(investTaskEntity);
}

@Override
public boolean updateTask(InvestTaskEntity investTaskEntity) {
syncTargetStatus(investTaskEntity);
return taskService.updateById(investTaskEntity);
}

@Override
public InvestDemandVo findDemandById(Long id) {
InvestCustomerEntity customerEntity = customerService.getByIdNotNull(id);
@@ -472,6 +485,21 @@ public class InvestBizServiceImpl implements InvestBizService {
return buildFollowRecordItem(usersMap, followRecordEntity, customerEntity, brand);
}

private void syncTargetStatus(InvestTaskEntity investTaskEntity) {
WxRentContract contractQuery = new WxRentContract();
contractQuery.setTenantId(InvestUserContext.getUser().getTenantId());
contractQuery.setShopId(investTaskEntity.getTargetId());
contractQuery.setStatus(EnumRentContractStatus.INTENTION.getCode());
int count = rentContractService.selectContractCountByShopId(contractQuery);
if (count > 0) {
investTaskEntity.setStatus(EnumTaskStatus.INTENTION);
} else {
if (StringUtils.isNotEmpty(investTaskEntity.getOwner())) {
investTaskEntity.setStatus(EnumTaskStatus.NEGOTIATING);
}
}
}

private InvestFollowRecordVo buildFollowRecordItem(Map<Long, MallUserInfo> usersMap, InvestFollowRecordEntity item,
InvestCustomerEntity customerEntity, WxBrand brand) {
List<MallUserInfo> ownerInfo = getMallUserInfos(usersMap, item);


+ 2
- 0
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestTaskServiceImpl.java Просмотреть файл

@@ -30,6 +30,7 @@ public class InvestTaskServiceImpl extends InvestBaseServiceImpl<InvestTaskDao,
public boolean save(InvestTaskEntity entity) {
super.saveAction(entity, this::checkBeforeSaveOrUpdate);
saveMessage(entity);
//TODO 同步一下签约状态
return true;
}

@@ -38,6 +39,7 @@ public class InvestTaskServiceImpl extends InvestBaseServiceImpl<InvestTaskDao,
public boolean update(InvestTaskEntity entity, Wrapper<InvestTaskEntity> updateWrapper) {
super.updateActon(entity, updateWrapper, this::checkBeforeSaveOrUpdate);
saveMessage(entity);
//TODO 同步一下签约状态
return true;
}



+ 14
- 1
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml Просмотреть файл

@@ -435,7 +435,7 @@
<select id="selectRentContractByShopIds" resultType="com.iformall.domain.po.WxRentContract">
SELECT rc.id,rc.rental_start_date,rc.rental_end_date,rc.`shop_id`,rc.`rent_shop_type`,rc.`rent_info` FROM
`wx_rent_contract` rc
WHERE rc.`status` IN (2,3,4)
WHERE tenant_id = #{tenantId} AND rc.`status` IN (2,3,4) AND status!=7
AND ( (rc.`rent_shop_type`=2 AND rc.`shop_id` IN
<foreach collection="shopIds" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
@@ -444,5 +444,18 @@
OR (rc.`rent_shop_type`=1 AND rc.`rent_info` REGEXP #{shopIdsRegexp})
)
</select>

<select id="selectContractCountByShopId" parameterType="com.iformall.domain.po.WxRentContract" resultType="int">
SELECT count(*)
FROM wx_rent_contract
WHERE tenant_id = #{tenantId}
AND `status` = #{status} AND status!=7
AND (
`rent_shop_type` = 1 AND
json_contains(json_extract(rent_info, '$[*].shopId'), concat('"', #{shopId}, '"'))
OR
`rent_shop_type` = 2 AND `shop_id` = #{shopId}
)
</select>
</mapper>


Загрузка…
Отмена
Сохранить