md
This commit is contained in:
parent
15b94b10ed
commit
9fa1cf8830
@ -18,6 +18,8 @@ import javax.validation.Valid;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.xdadan.erp.oms.common.annotation.filter.jackson.JacksonFilter;
|
import com.xdadan.erp.oms.common.annotation.filter.jackson.JacksonFilter;
|
||||||
import com.xdadan.erp.oms.common.utils.DateUtils;
|
import com.xdadan.erp.oms.common.utils.DateUtils;
|
||||||
|
import com.xdadan.erp.oms.common.utils.HTTPHelperV3;
|
||||||
|
import com.xdadan.erp.oms.domain.enumtype.EmisBizErrorType;
|
||||||
import com.xdadan.erp.oms.domain.exception.EmisBizError;
|
import com.xdadan.erp.oms.domain.exception.EmisBizError;
|
||||||
import com.xdadan.erp.oms.domain.vo.*;
|
import com.xdadan.erp.oms.domain.vo.*;
|
||||||
import com.xdadan.erp.oms.domain.wms.WmsWarehouse;
|
import com.xdadan.erp.oms.domain.wms.WmsWarehouse;
|
||||||
@ -215,8 +217,19 @@ public class Oms2cWaybillController extends BaseController
|
|||||||
@PostMapping("/bindSalesmen")
|
@PostMapping("/bindSalesmen")
|
||||||
public AjaxResult bindSalesmen(String empCode)
|
public AjaxResult bindSalesmen(String empCode)
|
||||||
{
|
{
|
||||||
emisWaybillService.bindSalesmen(empCode);
|
|
||||||
return AjaxResult.success("绑定成功");
|
try {
|
||||||
|
emisWaybillService.bindSalesmen(empCode);
|
||||||
|
return AjaxResult.success("绑定成功");
|
||||||
|
}catch (Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
// 返回子定义异常
|
||||||
|
if(ex instanceof EmisBizError){
|
||||||
|
return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode());
|
||||||
|
}
|
||||||
|
return AjaxResult.error("服务器异常,联系客服");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,8 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
|
|||||||
*/
|
*/
|
||||||
public int insertBindSalesmen(@Param("customerCode") String customerCode,@Param("empCode") String empCode);
|
public int insertBindSalesmen(@Param("customerCode") String customerCode,@Param("empCode") String empCode);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查是否绑定
|
* 检查是否绑定
|
||||||
* @param customerCode
|
* @param customerCode
|
||||||
@ -58,6 +60,13 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
|
|||||||
*/
|
*/
|
||||||
public int checkIsBindSalesmen(@Param("customerCode") String customerCode,@Param("empCode") String empCode);
|
public int checkIsBindSalesmen(@Param("customerCode") String customerCode,@Param("empCode") String empCode);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查业务员是否存在
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int checkEmpIsExist(@Param("empCode") String empCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消绑定
|
* 取消绑定
|
||||||
* @param customerCode
|
* @param customerCode
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.xdadan.erp.oms.domain.EmisWaybill;
|
import com.xdadan.erp.oms.domain.EmisWaybill;
|
||||||
|
import com.xdadan.erp.oms.domain.exception.EmisBizError;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName EmisWaybillService
|
* @ClassName EmisWaybillService
|
||||||
@ -33,7 +34,7 @@ public interface IEmisWaybillService
|
|||||||
public List<Map> selectUserBindSalesmenList(String searchValue);
|
public List<Map> selectUserBindSalesmenList(String searchValue);
|
||||||
|
|
||||||
|
|
||||||
public int bindSalesmen(String empCode);
|
public int bindSalesmen(String empCode) throws EmisBizError;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,13 @@ public class EmisWaybillServiceImpl implements IEmisWaybillService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int bindSalesmen(String empCode){
|
public int bindSalesmen(String empCode) throws EmisBizError {
|
||||||
|
|
||||||
|
int eCnt=emisWaybillMapper.checkEmpIsExist(empCode);
|
||||||
|
if(eCnt==0){
|
||||||
|
throw new EmisBizError(EmisBizErrorType.NOT_EXISTS,"业务员不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
String customerCode=SecurityUtils.getLoginUser().getUser().getCustomerCode();
|
String customerCode=SecurityUtils.getLoginUser().getUser().getCustomerCode();
|
||||||
int cnt=emisWaybillMapper.checkIsBindSalesmen(customerCode,empCode);
|
int cnt=emisWaybillMapper.checkIsBindSalesmen(customerCode,empCode);
|
||||||
|
|||||||
@ -559,6 +559,11 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="checkEmpIsExist" resultType="int">
|
||||||
|
select count(1) from sys_user where del_flag='0' and emp_code=#{empCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="checkIsBindSalesmen" resultType="int">
|
<select id="checkIsBindSalesmen" resultType="int">
|
||||||
select count(1) from sys_oms_user_bind_emp where customer_code=#{customerCode} and emp_code=#{empCode}
|
select count(1) from sys_oms_user_bind_emp where customer_code=#{customerCode} and emp_code=#{empCode}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user