加入组织申请
parent
7f7b5b3a49
commit
99f9bc710f
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njzscloud.dispose.cst.customer.pojo.entity.CustomerEntity;
|
import com.njzscloud.dispose.cst.customer.pojo.entity.CustomerEntity;
|
||||||
|
import com.njzscloud.dispose.cst.customer.pojo.result.SearchCustomerResult;
|
||||||
import com.njzscloud.dispose.cst.org.pojo.entity.OrgEntity;
|
import com.njzscloud.dispose.cst.org.pojo.entity.OrgEntity;
|
||||||
import com.njzscloud.dispose.cst.org.pojo.result.OrgResult;
|
import com.njzscloud.dispose.cst.org.pojo.result.OrgResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
@ -25,4 +26,5 @@ public interface OrgMapper extends BaseMapper<OrgEntity> {
|
||||||
|
|
||||||
List<CustomerEntity> queryList(@Param("ew") QueryWrapper<CustomerEntity> ew);
|
List<CustomerEntity> queryList(@Param("ew") QueryWrapper<CustomerEntity> ew);
|
||||||
|
|
||||||
|
SearchCustomerResult getCustomer(@Param("customerId") Long customerId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.njzscloud.common.core.ex.Exceptions;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.customer.pojo.entity.CustomerEntity;
|
import com.njzscloud.dispose.cst.customer.pojo.entity.CustomerEntity;
|
||||||
|
import com.njzscloud.dispose.cst.customer.pojo.result.SearchCustomerResult;
|
||||||
import com.njzscloud.dispose.cst.org.constant.ApplyStatus;
|
import com.njzscloud.dispose.cst.org.constant.ApplyStatus;
|
||||||
import com.njzscloud.dispose.cst.org.mapper.OrgMapper;
|
import com.njzscloud.dispose.cst.org.mapper.OrgMapper;
|
||||||
import com.njzscloud.dispose.cst.org.pojo.entity.OrgApplyEntity;
|
import com.njzscloud.dispose.cst.org.pojo.entity.OrgApplyEntity;
|
||||||
|
|
@ -112,6 +113,9 @@ public class OrgService extends ServiceImpl<OrgMapper, OrgEntity> implements ISe
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void apply(Long customerId, Long orgId) {
|
public void apply(Long customerId, Long orgId) {
|
||||||
|
SearchCustomerResult customerResult = baseMapper.getCustomer(customerId);
|
||||||
|
Assert.isFalse(customerResult.getManager(), () -> Exceptions.exception("企业/组织管理员不能加入其他公司"));
|
||||||
|
Assert.isNull(customerResult.getOrgId(), () -> Exceptions.exception("已加入其他企业/组织请先退出"));
|
||||||
boolean exists = orgApplyService.exists(Wrappers.lambdaQuery(OrgApplyEntity.class)
|
boolean exists = orgApplyService.exists(Wrappers.lambdaQuery(OrgApplyEntity.class)
|
||||||
.in(OrgApplyEntity::getApplyStatus, ApplyStatus.ShenQingZhong, ApplyStatus.TongYi)
|
.in(OrgApplyEntity::getApplyStatus, ApplyStatus.ShenQingZhong, ApplyStatus.TongYi)
|
||||||
.eq(OrgApplyEntity::getCustomerId, customerId)
|
.eq(OrgApplyEntity::getCustomerId, customerId)
|
||||||
|
|
|
||||||
|
|
@ -51,21 +51,6 @@ public class GoodsEntity extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为成品;0-->否、1-->是
|
|
||||||
*/
|
|
||||||
private Boolean fg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为半成品;0-->否、1-->是
|
|
||||||
*/
|
|
||||||
private Boolean sfg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为原料;0-->否、1-->是
|
|
||||||
*/
|
|
||||||
private Boolean rg;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -52,21 +52,6 @@ public class AddGoodsParam {
|
||||||
*/
|
*/
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为成品;0-->否、1-->是
|
|
||||||
*/
|
|
||||||
private Boolean fg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为半成品;0-->否、1-->是
|
|
||||||
*/
|
|
||||||
private Boolean sfg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为原料;0-->否、1-->是
|
|
||||||
*/
|
|
||||||
private Boolean rg;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -56,21 +56,6 @@ public class ModifyGoodsParam {
|
||||||
*/
|
*/
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为成品;0-->否、1-->是
|
|
||||||
*/
|
|
||||||
private Boolean fg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为半成品;0-->否、1-->是
|
|
||||||
*/
|
|
||||||
private Boolean sfg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为原料;0-->否、1-->是
|
|
||||||
*/
|
|
||||||
private Boolean rg;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -76,4 +76,9 @@
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getCustomer" resultType="com.njzscloud.dispose.cst.customer.pojo.result.SearchCustomerResult">
|
||||||
|
SELECT *
|
||||||
|
FROM cst_customer
|
||||||
|
WHERE id = #{customerId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue