|
@@ -6,6 +6,7 @@ import com.aliyun.dingtalkcontact_1_0.models.SearchUserResponse;
|
|
|
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -2698,6 +2699,71 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
return respMsg;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg addUserIsMachine(String ids, HttpServletRequest request) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ String token = request.getHeader("TOKEN");
|
|
|
+ User user = userMapper.selectById(token);
|
|
|
+ if (user.getCompanyId()!=4811){
|
|
|
+ msg.setError("该公司无需添加机械费用下发人员");
|
|
|
+ return msg;
|
|
|
+ }else {
|
|
|
+ if (StringUtils.isEmpty(ids)){
|
|
|
+ msg.setError("请选择机械费用下发人员");
|
|
|
+ return msg;
|
|
|
+ }else {
|
|
|
+ String[] idArray = ids.split(",");
|
|
|
+ List<String> idList = Arrays.stream(idArray).map(String::trim).collect(Collectors.toList());
|
|
|
+ int update = userMapper.update(null, new UpdateWrapper<User>().set("is_machine_cost", 2).in("id", idList));
|
|
|
+ if (update>0){
|
|
|
+ return msg;
|
|
|
+ }else {
|
|
|
+ msg.setError("修改失败");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg removeUserIsMachine(String id, HttpServletRequest request) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ String token = request.getHeader("TOKEN");
|
|
|
+ User user = userMapper.selectById(token);
|
|
|
+ if (user.getCompanyId()!=4811){
|
|
|
+ msg.setError("该公司无需删除机械费用下发人员");
|
|
|
+ return msg;
|
|
|
+ }else {
|
|
|
+ if (StringUtils.isEmpty(id)){
|
|
|
+ msg.setError("请选择机械费用下发人员");
|
|
|
+ return msg;
|
|
|
+ }else {
|
|
|
+ int update = userMapper.update(null, new UpdateWrapper<User>().set("is_machine_cost", 1).eq("id", id));
|
|
|
+ if (update>0){
|
|
|
+ return msg;
|
|
|
+ }else {
|
|
|
+ msg.setError("修改失败");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg getUserIsMachineList(HttpServletRequest request) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ String token = request.getHeader("TOKEN");
|
|
|
+ User user = userMapper.selectById(token);
|
|
|
+ if (user.getCompanyId()!=4811){
|
|
|
+ msg.setData(new ArrayList<User>());
|
|
|
+ return msg;
|
|
|
+ }else {
|
|
|
+ List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()).eq("is_machine_cost", 2));
|
|
|
+ msg.setData(userList);
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public HttpRespMsg getUserListByRole(HttpServletRequest request,String tableName) {
|
|
|
HttpRespMsg httpRespMsg=new HttpRespMsg();
|