|
@@ -15,7 +15,6 @@ import java.util.Objects;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.pj.api.client.admin.AdminInterface;
|
|
|
-import com.pj.api.client.level_two_server.LevelTwoServerInterface;
|
|
|
import com.pj.api.dto.AppUserDto;
|
|
|
import com.pj.api.dto.MessageDto;
|
|
|
import com.pj.api.dto.PurchaserDto;
|
|
@@ -59,9 +58,6 @@ public class TbPurchaserService extends ServiceImpl<TbPurchaserMapper, TbPurchas
|
|
|
@Autowired
|
|
|
private MethodPurchaserService methodPurchaserService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private LevelTwoServerInterface levelTwoServerInterface;
|
|
|
-
|
|
|
|
|
|
/** 增 */
|
|
|
void add(TbPurchaser t){
|
|
@@ -111,45 +107,32 @@ public class TbPurchaserService extends ServiceImpl<TbPurchaserMapper, TbPurchas
|
|
|
|
|
|
/**
|
|
|
* 收购商审核
|
|
|
- * @param purchaserParam
|
|
|
+ * @param purchaserId 二级市场商户表主键
|
|
|
* @param flag true=审核通过 false=审核失败
|
|
|
* @param reason 审核备注
|
|
|
* @return
|
|
|
*/
|
|
|
- public int audit(PurchaserParam purchaserParam,Boolean flag,String reason){
|
|
|
+ public boolean audit(Long purchaserId,Boolean flag,String reason){
|
|
|
//审核不通过
|
|
|
if(!flag){
|
|
|
//发送通知给收购商
|
|
|
MessageDto dto = new MessageDto();
|
|
|
dto.setUrl("/pages/market/one/merchant/order/list");
|
|
|
- dto.setUserId(purchaserParam.getLoginUserId());
|
|
|
+ dto.setUserId(purchaserId);
|
|
|
dto.setContents("您发起的收购商认证审核不通过,原因是: " + reason);
|
|
|
adminInterface.messageSave(dto);
|
|
|
}
|
|
|
- //审核通过,开始创建
|
|
|
- TbPurchaser purchaser = new TbPurchaser();
|
|
|
- //数据拷贝
|
|
|
- BeanUtils.copyProperties(purchaserParam,purchaser);
|
|
|
- purchaser.setName(purchaserParam.getName());
|
|
|
- purchaser.setDutyParagraph(purchaserParam.getDutyParagraph());
|
|
|
- purchaser.setLegalPerson(purchaserParam.getCorporateName());
|
|
|
- purchaser.setIdCard(purchaserParam.getCorporateIdCard());
|
|
|
- purchaser.setContact(purchaserParam.getLinkPhone());
|
|
|
- //公共属性设置
|
|
|
- purchaser.setCreateBy(StpUserUtil.getLoginIdAsString());
|
|
|
- purchaser.setCreateName(StpUserUtil.getLoginName());
|
|
|
- purchaser.setCreateTime(new Date());
|
|
|
- purchaser.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
|
|
|
- int insert = tbPurchaserMapper.insert(purchaser);
|
|
|
- if(insert != 1)throw new ServiceException("审核失败!");
|
|
|
+ //审核通过
|
|
|
+ TbPurchaser tbPurchaser = tbPurchaserMapper.selectById(purchaserId);
|
|
|
+ if(tbPurchaser == null)throw new ServiceException("收购商信息异常。");
|
|
|
//审核同构且完成数据插入则进行关联
|
|
|
- AppUserDto appUser = adminInterface.getAppUserById(purchaserParam.getLoginUserId());
|
|
|
- if(appUser == null)throw new ServiceException("审核过程异常!");
|
|
|
- PurchaserDto purchaserDto = levelTwoServerInterface.getByPhoneAndIdCard(purchaser.getContact(), purchaser.getIdCard());
|
|
|
+ AppUserDto appUser = adminInterface.getByPhoneAndUserType(tbPurchaser.getContact(), 3);
|
|
|
//设置关联属性
|
|
|
- appUser.setFkId(String.valueOf(purchaserDto.getId()));
|
|
|
+ appUser.setFkId(String.valueOf(tbPurchaser.getId()));
|
|
|
appUser.setAuth(1 + ""); // 1=审核通过
|
|
|
- return 3;
|
|
|
+ //保存
|
|
|
+ Boolean aBoolean = adminInterface.saveAppUserInfo(appUser);
|
|
|
+ return aBoolean;
|
|
|
}
|
|
|
|
|
|
/** 是否锁住收购商 */
|
|
@@ -311,13 +294,5 @@ public class TbPurchaserService extends ServiceImpl<TbPurchaserMapper, TbPurchas
|
|
|
return purchaserDto;
|
|
|
}
|
|
|
|
|
|
- /** 远程调用: 根据手机号和身份证号查询二级市场商户 */
|
|
|
- public PurchaserDto getByPhoneAndIdCard(String phone,String idCard){
|
|
|
- List<TbPurchaser> purchasers = tbPurchaserMapper.selectList(new LambdaQueryWrapper<TbPurchaser>().eq(TbPurchaser::getContact, phone).eq(TbPurchaser::getIdCard, idCard).eq(TbPurchaser::getDeleteStatus, DeleteStatus.DELETE_STATUS_ON.getCode()));
|
|
|
- if(purchasers.size() == 0)throw new ServiceException("服务器繁忙~");
|
|
|
- //数据拷贝
|
|
|
- PurchaserDto purchaserDto = new PurchaserDto();
|
|
|
- BeanUtils.copyProperties(purchasers.get(0),purchaserDto);
|
|
|
- return purchaserDto;
|
|
|
- }
|
|
|
+
|
|
|
}
|