bug修复
This commit is contained in:
parent
4037606eed
commit
1511ea5870
@ -331,6 +331,13 @@ public class HikvisionCall {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
String time = DateUtil.formatDateTime(DateUtil.parse(eventTime));
|
||||
map.put("passTime", time);
|
||||
Integer count = workerAttendanceMapper.selectCount(new LambdaQueryWrapper<WorkerAttendance>()
|
||||
.eq(WorkerAttendance::getPersonSn, workerInfo.getPersonSn())
|
||||
.eq(WorkerAttendance::getCreateTime, time)
|
||||
);
|
||||
if (count != 0) {
|
||||
continue;
|
||||
}
|
||||
map.put("idCard", workerInfo.getIdCard());
|
||||
map.put("attendanceNumber", workerInfo.getAttendanceNumber());
|
||||
int passType = workerAttendanceServiceImpl.getPassType(ufaceDev, time);
|
||||
@ -347,13 +354,7 @@ public class HikvisionCall {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Integer count = workerAttendanceMapper.selectCount(new LambdaQueryWrapper<WorkerAttendance>()
|
||||
.eq(WorkerAttendance::getPersonSn, workerInfo.getPersonSn())
|
||||
.eq(WorkerAttendance::getCreateTime, time)
|
||||
);
|
||||
if (count == 0) {
|
||||
workerAttendanceService.saveExternalPassRecord(map);
|
||||
}
|
||||
workerAttendanceService.saveExternalPassRecord(map);
|
||||
}
|
||||
param.put("pageNo", param.getIntValue("pageNo") + 1);
|
||||
}
|
||||
@ -431,6 +432,13 @@ public class HikvisionCall {
|
||||
log.info("海康车辆相机设备不存在:CameraId:{}", roadwaySyscode);
|
||||
continue;
|
||||
}
|
||||
Integer count = carPassRecordMapper.selectCount(new LambdaQueryWrapper<CarPassRecord>()
|
||||
.eq(CarPassRecord::getCarNumber, plateNo)
|
||||
.eq(CarPassRecord::getPassTime, time)
|
||||
);
|
||||
if (count != 0) {
|
||||
continue;
|
||||
}
|
||||
CarPassRecord entity = new CarPassRecord();
|
||||
entity.setCarNumber(plateNo);
|
||||
entity.setType(getPassType(carCamera.getPassType()));
|
||||
@ -459,13 +467,7 @@ public class HikvisionCall {
|
||||
} else {
|
||||
entity.setIsOpen(0);
|
||||
}
|
||||
Integer count = carPassRecordMapper.selectCount(new LambdaQueryWrapper<CarPassRecord>()
|
||||
.eq(CarPassRecord::getCarNumber, plateNo)
|
||||
.eq(CarPassRecord::getPassTime, time)
|
||||
);
|
||||
if (count == 0) {
|
||||
carPassRecordMapper.insert(entity);
|
||||
}
|
||||
carPassRecordMapper.insert(entity);
|
||||
}
|
||||
param.put("pageNo", param.getIntValue("pageNo") + 1);
|
||||
}
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.OrganizationJob;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IOrganizationJobService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
@ -22,11 +24,11 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 组织岗位
|
||||
* @author: pds
|
||||
* @date: 2021-05-21
|
||||
* @date: 2021-05-21
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@ -34,70 +36,90 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@Api(tags = "组织岗位")
|
||||
public class OrganizationJobController {
|
||||
@Autowired
|
||||
private IOrganizationJobService organizationJobService;
|
||||
@Autowired
|
||||
private IOrganizationJobService organizationJobService;
|
||||
|
||||
|
||||
@ApiOperation(value = "列表查询组织岗位信息", notes = "列表查询组织岗位信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "sn", value = "公司sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/selectList")
|
||||
public Result<List<OrganizationJob>> selectList(@RequestBody Map<String, Object> map) {
|
||||
QueryWrapper<OrganizationJob> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(OrganizationJob::getSn, MapUtils.getString(map,"sn"));
|
||||
List<OrganizationJob> pageList = organizationJobService.list(queryWrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
/**
|
||||
* 添加
|
||||
* @param organizationJob
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询组织岗位信息", notes = "列表查询组织岗位信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "sn", value = "公司sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/selectList")
|
||||
public Result<List<OrganizationJob>> selectList(@RequestBody Map<String, Object> map) {
|
||||
QueryWrapper<OrganizationJob> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(OrganizationJob::getSn, MapUtils.getString(map, "sn"));
|
||||
List<OrganizationJob> pageList = organizationJobService.list(queryWrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页列表查询组织岗位信息", notes = "分页列表查询组织岗位信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "sn", value = "公司sn", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = "/selectPage")
|
||||
public Result<Page<OrganizationJob>> selectPage(@RequestBody Map<String, Object> map) {
|
||||
QueryWrapper<OrganizationJob> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(OrganizationJob::getSn, MapUtils.getString(map, "sn"));
|
||||
Page page = PageUtil.getPage(map);
|
||||
Page<OrganizationJob> pageList = organizationJobService.page(page, queryWrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param organizationJob
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织岗位", operType = "添加组织岗位信息", operDesc = "添加组织岗位信息")
|
||||
@ApiOperation(value = "添加组织岗位信息", notes = "添加组织岗位信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<OrganizationJob> add(@RequestBody OrganizationJob organizationJob) {
|
||||
public Result<OrganizationJob> add(@RequestBody OrganizationJob organizationJob) {
|
||||
organizationJobService.addOrganizationJob(organizationJob);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param organizationJob
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织岗位",operType = "编辑组织岗位信息",operDesc = "编辑组织岗位信息")
|
||||
@ApiOperation(value = "编辑组织岗位信息", notes = "编辑组织岗位信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<OrganizationJob> edit(@RequestBody OrganizationJob organizationJob) {
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param organizationJob
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织岗位", operType = "编辑组织岗位信息", operDesc = "编辑组织岗位信息")
|
||||
@ApiOperation(value = "编辑组织岗位信息", notes = "编辑组织岗位信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<OrganizationJob> edit(@RequestBody OrganizationJob organizationJob) {
|
||||
organizationJobService.editOrganizationJob(organizationJob);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织岗位",operType = "删除组织岗位信息",operDesc = "删除组织岗位信息")
|
||||
@ApiOperation(value = "删除组织岗位信息", notes = "删除组织岗位信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "组织岗位ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<OrganizationJob> delete(@RequestBody Map<String,Object> map) {
|
||||
Result<OrganizationJob> result = new Result<OrganizationJob>();
|
||||
OrganizationJob organizationJob = organizationJobService.getById(MapUtils.getString(map,"id"));
|
||||
if(organizationJob==null) {
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "组织岗位", operType = "删除组织岗位信息", operDesc = "删除组织岗位信息")
|
||||
@ApiOperation(value = "删除组织岗位信息", notes = "删除组织岗位信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "组织岗位ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<OrganizationJob> delete(@RequestBody Map<String, Object> map) {
|
||||
Result<OrganizationJob> result = new Result<OrganizationJob>();
|
||||
OrganizationJob organizationJob = organizationJobService.getById(MapUtils.getString(map, "id"));
|
||||
if (organizationJob == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
}else {
|
||||
boolean ok = organizationJobService.removeById(MapUtils.getString(map,"id"));
|
||||
if(ok) {
|
||||
} else {
|
||||
boolean ok = organizationJobService.removeById(MapUtils.getString(map, "id"));
|
||||
if (ok) {
|
||||
result.successMsg(MessageUtil.get("deleteSucess"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
@ -144,6 +145,17 @@ public class SystemUserController {
|
||||
return Result.success(systemUserService.getSystemUserBySn(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据企业或项目SN查找账号分页列表", notes = "根据企业或项目SN查找账号分页列表", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "sn", required = true, value = "企业或项目SN", paramType = "body"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = "/getSystemUserBySnPage")
|
||||
public Result<Page<SystemUser>> getSystemUserBySnPage(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(systemUserService.getSystemUserBySnPage(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查找项目子账号列表", notes = "查找项目子账号列表", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", required = true, value = "项目SN", paramType = "body"),
|
||||
@ -230,6 +242,16 @@ public class SystemUserController {
|
||||
return Result.success(systemUserService.getTenantListBySn(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据项目SN查找新用户(租户)分页列表", notes = "根据项目SN查找新用户(租户)分页列表", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", required = true, value = "项目SN", paramType = "body"),
|
||||
})
|
||||
@PostMapping(value = "/getTenantPageBySn")
|
||||
public Result<Page<SystemUser>> getTenantPageBySn(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(systemUserService.getTenantPageBySn(map));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "星纵验证账号", notes = "星纵验证账号", httpMethod = "POST")
|
||||
@PostMapping(value = "/xz/checkAccount")
|
||||
public Result checkAccount(@RequestBody SystemUser systemUser) {
|
||||
|
||||
@ -81,7 +81,8 @@ public class OperationLog implements Serializable {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "操作时间")
|
||||
private java.util.Date operCreateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String projectSn;
|
||||
@TableField(exist = false)
|
||||
private String account;
|
||||
@TableField(exist = false)
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.basicdata.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wflow.bean.do_.DeptDo;
|
||||
import com.wflow.bean.do_.UserDeptDo;
|
||||
@ -28,7 +29,7 @@ import java.util.Set;
|
||||
@Mapper
|
||||
public interface SystemUserMapper extends BaseMapper<SystemUser> {
|
||||
|
||||
List<SystemUser> getSystemUserBySn(Map<String, Object> map);
|
||||
List<SystemUser> getSystemUserBySn(@Param("p") Map<String, Object> map);
|
||||
|
||||
SystemUser findByUsername(@Param("account") String account);
|
||||
|
||||
@ -58,7 +59,7 @@ public interface SystemUserMapper extends BaseMapper<SystemUser> {
|
||||
|
||||
List<String> getOrgSnListByUserId(HashMap<String, Object> paramMap);
|
||||
|
||||
List<SystemUser> getTenantListBySn(Map<String, Object> map);
|
||||
List<SystemUser> getTenantListBySn(@Param("map") Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 查询该部门下的所有用户
|
||||
@ -93,4 +94,8 @@ public interface SystemUserMapper extends BaseMapper<SystemUser> {
|
||||
"<foreach item='item' index='index' collection='list' open='(' separator=',' close=')'>#{item}</foreach>",
|
||||
"</script>"})
|
||||
List<UserDeptDo> getUserDepInfosBatch(@Param("list") Collection<String> udIds);
|
||||
|
||||
Page<SystemUser> getSystemUserBySn(@Param("p") Map<String, Object> map, Page<SystemUser> page);
|
||||
|
||||
Page<SystemUser> getTenantListBySn(@Param("map") Map<String, Object> map, Page page);
|
||||
}
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
<select id="getSystemUserBySn" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser" parameterType="map">
|
||||
SELECT a.*, jb.job_name
|
||||
from system_user a
|
||||
LEFT JOIN organization_job jb ON a.job_id = jb.id
|
||||
WHERE a.sn = #{sn}
|
||||
and a.account_type in (1, 2, 3, 4, 5, 7)
|
||||
LEFT JOIN organization_job jb ON a.job_id = jb.id
|
||||
WHERE a.sn = #{p.sn}
|
||||
and a.account_type in (1, 2, 3, 4, 5, 7)
|
||||
</select>
|
||||
<select id="getProjectChilderSystemUserList" resultType="com.zhgd.xmgl.modules.basicdata.entity.SystemUser"
|
||||
parameterType="map">
|
||||
@ -204,7 +204,7 @@
|
||||
join xz_system_user_to_company_project p on p.user_id=a.user_id
|
||||
LEFT JOIN organization_job jb ON a.job_id = jb.id
|
||||
left join xz_registry xr on xr.account=a.account
|
||||
WHERE p.sn = #{projectSn} and a.account_type=10 and p.type = 2
|
||||
WHERE p.sn = #{map.projectSn} and a.account_type=10 and p.type = 2
|
||||
order by registryTime desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.basicdata.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.entity.sj.JwtPayloadUserInfo;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.dto.LoginInfoByTokenDto;
|
||||
@ -78,6 +79,8 @@ public interface ISystemUserService extends IService<SystemUser> {
|
||||
|
||||
List<SystemUser> getTenantListBySn(Map<String, Object> map);
|
||||
|
||||
Page<SystemUser> getTenantPageBySn(Map<String, Object> map);
|
||||
|
||||
void checkAccount(SystemUser systemUser);
|
||||
|
||||
void getEmailCodeByAccount(HashMap<String, Object> hashMap);
|
||||
@ -85,4 +88,6 @@ public interface ISystemUserService extends IService<SystemUser> {
|
||||
HashMap<String, Object> resetPwValidCode(HashMap<String, Object> paramMap);
|
||||
|
||||
void resetPwByEmail(HashMap<String, Object> paramMap);
|
||||
|
||||
Page<SystemUser> getSystemUserBySnPage(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -1182,6 +1182,12 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
return baseMapper.getTenantListBySn(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SystemUser> getTenantPageBySn(Map<String, Object> map) {
|
||||
Page page = PageUtil.getPage(map);
|
||||
return baseMapper.getTenantListBySn(map, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkAccount(SystemUser systemUser) {
|
||||
checkCode(systemUser);
|
||||
@ -1252,6 +1258,12 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<SystemUser> getSystemUserBySnPage(Map<String, Object> map) {
|
||||
Page<SystemUser> page = PageUtil.getPage(map);
|
||||
return systemUserMapper.getSystemUserBySn(map, page);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String timestamp = "1711613997695";
|
||||
String pw = "123";
|
||||
|
||||
@ -8,6 +8,7 @@ import com.zhgd.xmgl.modules.project.entity.qo.ProgressTaskAlarmQO;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.ProgressItemOverdueListVo;
|
||||
import com.zhgd.xmgl.modules.project.mapper.ProgressTaskAlarmMapper;
|
||||
import com.zhgd.xmgl.modules.project.service.ProgressTaskAlarmService;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
package com.zhgd.xmgl.modules.xz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.modules.xz.entity.XzSupplierQualification;
|
||||
import com.zhgd.xmgl.modules.xz.service.IXzSupplierQualificationService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
@ -33,119 +36,139 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@Api(tags = "星纵-供应商-企业资质")
|
||||
public class XzSupplierQualificationController {
|
||||
@Autowired
|
||||
private IXzSupplierQualificationService xzSupplierQualificationService;
|
||||
@Autowired
|
||||
private IXzSupplierQualificationService xzSupplierQualificationService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询星纵-供应商-企业资质信息", notes = "列表查询星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询星纵-供应商-企业资质信息", notes = "列表查询星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", paramType = "body", required = true, dataType = "String")
|
||||
@PostMapping(value = "/list")
|
||||
public Result<List<XzSupplierQualification>> selectXzSupplierBadRecordList(@RequestBody Map<String, Object> map) {
|
||||
Result<List<XzSupplierQualification>> result = new Result<List<XzSupplierQualification>>();
|
||||
QueryWrapper<XzSupplierQualification> queryWrapper = new QueryWrapper<>();
|
||||
public Result<List<XzSupplierQualification>> selectXzSupplierBadRecordList(@RequestBody Map<String, Object> map) {
|
||||
Result<List<XzSupplierQualification>> result = new Result<List<XzSupplierQualification>>();
|
||||
QueryWrapper<XzSupplierQualification> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(XzSupplierQualification::getUserId, MapUtils.getString(map, "userId"));
|
||||
List<XzSupplierQualification> pageList = xzSupplierQualificationService.list(queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
queryWrapper.lambda().orderByDesc(XzSupplierQualification::getCreateTime);
|
||||
List<XzSupplierQualification> pageList = xzSupplierQualificationService.list(queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param xzSupplierQualification
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "供应商管理", operType = "添加星纵-供应商-企业资质", operDesc = "添加星纵-供应商-企业资质")
|
||||
@ApiOperation(value = "添加星纵-供应商-企业资质信息", notes = "添加星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<XzSupplierQualification> add(@RequestBody XzSupplierQualification xzSupplierQualification) {
|
||||
Result<XzSupplierQualification> result = new Result<XzSupplierQualification>();
|
||||
try {
|
||||
xzSupplierQualificationService.save(xzSupplierQualification);
|
||||
result.successMsg(MessageUtil.get("addSucess"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info(e.getMessage());
|
||||
result.error500(MessageUtil.get("failErr"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ApiOperation(value = "分页列表查询星纵-供应商-企业资质信息", notes = "分页列表查询星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户id", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@PostMapping(value = "/page")
|
||||
public Result<Page<XzSupplierQualification>> selectXzSupplierBadRecordPage(@RequestBody Map<String, Object> map) {
|
||||
Result<Page<XzSupplierQualification>> result = new Result<Page<XzSupplierQualification>>();
|
||||
QueryWrapper<XzSupplierQualification> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(XzSupplierQualification::getUserId, MapUtils.getString(map, "userId"));
|
||||
queryWrapper.lambda().orderByDesc(XzSupplierQualification::getCreateTime);
|
||||
Page page = PageUtil.getPage(map);
|
||||
Page<XzSupplierQualification> pageList = xzSupplierQualificationService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param xzSupplierQualification
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "供应商管理", operType = "编辑星纵-供应商-企业资质", operDesc = "编辑星纵-供应商-企业资质")
|
||||
@ApiOperation(value = "编辑星纵-供应商-企业资质信息", notes = "编辑星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<XzSupplierQualification> edit(@RequestBody XzSupplierQualification xzSupplierQualification) {
|
||||
Result<XzSupplierQualification> result = new Result<XzSupplierQualification>();
|
||||
XzSupplierQualification xzSupplierQualificationEntity = xzSupplierQualificationService.getById(xzSupplierQualification.getId());
|
||||
if (xzSupplierQualificationEntity == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
boolean ok = xzSupplierQualificationService.updateById(xzSupplierQualification);
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param xzSupplierQualification
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "供应商管理", operType = "添加星纵-供应商-企业资质", operDesc = "添加星纵-供应商-企业资质")
|
||||
@ApiOperation(value = "添加星纵-供应商-企业资质信息", notes = "添加星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<XzSupplierQualification> add(@RequestBody XzSupplierQualification xzSupplierQualification) {
|
||||
Result<XzSupplierQualification> result = new Result<XzSupplierQualification>();
|
||||
try {
|
||||
xzSupplierQualificationService.save(xzSupplierQualification);
|
||||
result.successMsg(MessageUtil.get("addSucess"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info(e.getMessage());
|
||||
result.error500(MessageUtil.get("failErr"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
result.successMsg(MessageUtil.get("editSucess"));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param xzSupplierQualification
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "供应商管理", operType = "编辑星纵-供应商-企业资质", operDesc = "编辑星纵-供应商-企业资质")
|
||||
@ApiOperation(value = "编辑星纵-供应商-企业资质信息", notes = "编辑星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<XzSupplierQualification> edit(@RequestBody XzSupplierQualification xzSupplierQualification) {
|
||||
Result<XzSupplierQualification> result = new Result<XzSupplierQualification>();
|
||||
XzSupplierQualification xzSupplierQualificationEntity = xzSupplierQualificationService.getById(xzSupplierQualification.getId());
|
||||
if (xzSupplierQualificationEntity == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
boolean ok = xzSupplierQualificationService.updateById(xzSupplierQualification);
|
||||
|
||||
return result;
|
||||
}
|
||||
if (ok) {
|
||||
result.successMsg(MessageUtil.get("editSucess"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "供应商管理", operType = "删除星纵-供应商-企业资质", operDesc = "删除星纵-供应商-企业资质")
|
||||
@ApiOperation(value = "删除星纵-供应商-企业资质信息", notes = "删除星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "星纵-供应商-企业资质ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<XzSupplierQualification> delete(@RequestBody Map<String, Object> map) {
|
||||
Result<XzSupplierQualification> result = new Result<XzSupplierQualification>();
|
||||
XzSupplierQualification xzSupplierQualification = xzSupplierQualificationService.getById(MapUtils.getString(map, "id"));
|
||||
if (xzSupplierQualification == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
boolean ok = xzSupplierQualificationService.removeById(MapUtils.getString(map, "id"));
|
||||
if (ok) {
|
||||
result.successMsg(MessageUtil.get("deleteSucess"));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "供应商管理", operType = "删除星纵-供应商-企业资质", operDesc = "删除星纵-供应商-企业资质")
|
||||
@ApiOperation(value = "删除星纵-供应商-企业资质信息", notes = "删除星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "星纵-供应商-企业资质ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<XzSupplierQualification> delete(@RequestBody Map<String, Object> map) {
|
||||
Result<XzSupplierQualification> result = new Result<XzSupplierQualification>();
|
||||
XzSupplierQualification xzSupplierQualification = xzSupplierQualificationService.getById(MapUtils.getString(map, "id"));
|
||||
if (xzSupplierQualification == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
boolean ok = xzSupplierQualificationService.removeById(MapUtils.getString(map, "id"));
|
||||
if (ok) {
|
||||
result.successMsg(MessageUtil.get("deleteSucess"));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询星纵-供应商-企业资质信息", notes = "通过id查询星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "星纵-供应商-企业资质ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result<XzSupplierQualification> queryById(@RequestBody Map<String, Object> map) {
|
||||
Result<XzSupplierQualification> result = new Result<XzSupplierQualification>();
|
||||
XzSupplierQualification xzSupplierQualification = xzSupplierQualificationService.getById(MapUtils.getString(map, "id"));
|
||||
if (xzSupplierQualification == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
result.setResult(xzSupplierQualification);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询星纵-供应商-企业资质信息", notes = "通过id查询星纵-供应商-企业资质信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "星纵-供应商-企业资质ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result<XzSupplierQualification> queryById(@RequestBody Map<String, Object> map) {
|
||||
Result<XzSupplierQualification> result = new Result<XzSupplierQualification>();
|
||||
XzSupplierQualification xzSupplierQualification = xzSupplierQualificationService.getById(MapUtils.getString(map, "id"));
|
||||
if (xzSupplierQualification == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
result.setResult(xzSupplierQualification);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,10 +3,12 @@ package com.zhgd.xmgl.modules.xz.entity;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -60,5 +62,18 @@ public class XzSupplierQualification implements Serializable {
|
||||
private java.lang.String remarks;
|
||||
@ApiModelProperty(value = "源文件名称")
|
||||
private java.lang.String originFileName;
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
}
|
||||
|
||||
@ -61,4 +61,18 @@ public class XzSupplierQualificationRecord implements Serializable {
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private java.lang.String remarks;
|
||||
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private java.util.Date updateTime;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@ -175,4 +176,52 @@ public class XzSupplierRecord implements Serializable {
|
||||
@Excel(name = "营业执照图片地址", width = 15)
|
||||
@ApiModelProperty(value = "营业执照图片地址")
|
||||
private java.lang.String businessLicenseUrl;
|
||||
|
||||
/**
|
||||
* xz_supplier_type表外键
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "企业类型Id")
|
||||
private java.lang.Long xzSupplierTypeId;
|
||||
|
||||
/**
|
||||
* xz_supplier_type表外键
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "父级企业ID")
|
||||
private java.lang.Long pid;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sortNum;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "企业类型名称")
|
||||
private java.lang.String xzSupplierTypeName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "类型,1项目,2企业")
|
||||
private java.lang.Integer type;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "项目负责人")
|
||||
private java.lang.String projectDirectorName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "项目负责人电话")
|
||||
private java.lang.String projectDirectorPhone;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "是否是项目部公司,1否,2是")
|
||||
private java.lang.Integer departmentType;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String companyTypeName;
|
||||
@TableField(exist = false)
|
||||
private String xzUserToSupplierId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private java.lang.Long userId;
|
||||
|
||||
}
|
||||
|
||||
@ -9,6 +9,8 @@ import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-项目组织机构
|
||||
* @author: pds
|
||||
@ -20,7 +22,9 @@ public interface XzProjectOrgMapper extends BaseMapper<XzProjectOrg> {
|
||||
|
||||
void deleteChildren(String id);
|
||||
|
||||
void updateAncestors(@Param("oldAncestor") String oldAncestor, @Param("newAncestor") String newAncestor, @Param("projectSn") String projectSn);
|
||||
void updateAncestors(@Param("oldAncestor") String oldAncestor, @Param("newAncestor") String newAncestor, @Param("projectSn") String projectSn, @Param("id") Long id);
|
||||
|
||||
List<XzProjectOrg> getChildren(Long id);
|
||||
|
||||
/**
|
||||
* 查询某部门下的子部门列表
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
<update id="updateAncestors">
|
||||
UPDATE xz_project_org
|
||||
SET ancestors=REPLACE(ancestors, #{oldAncestor}, #{newAncestor})
|
||||
WHERE ancestors LIKE N'${oldAncestor}%' and project_sn = #{projectSn}
|
||||
WHERE ancestors LIKE N'${oldAncestor},${id}%' and project_sn = #{projectSn}
|
||||
</update>
|
||||
|
||||
<select id="getChildren" resultType="com.zhgd.xmgl.modules.xz.entity.XzProjectOrg">
|
||||
select * from xz_project_org
|
||||
where find_in_set(#{id}, ancestors)
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -88,40 +88,47 @@ public class XzProjectOrgServiceImpl extends ServiceImpl<XzProjectOrgMapper, XzP
|
||||
if (oldPo == null) {
|
||||
throw new OpenAlertException("部门不存在");
|
||||
}
|
||||
List<XzProjectOrg> cOrgs = xzProjectOrgMapper.selectList(new LambdaQueryWrapper<XzProjectOrg>()
|
||||
.eq(XzProjectOrg::getParentId, xzProjectOrg.getId())
|
||||
.eq(XzProjectOrg::getProjectSn, xzProjectOrg.getProjectSn())
|
||||
.eq(XzProjectOrg::getStatus, 0)
|
||||
);
|
||||
if (CollUtil.isNotEmpty(cOrgs)) {
|
||||
throw new OpenAlertException("该部门有下级部门未停用,不能停用");
|
||||
if (Objects.equals(xzProjectOrg.getStatus(), 1)) {
|
||||
List<XzProjectOrg> cOrgs = xzProjectOrgMapper.selectList(new LambdaQueryWrapper<XzProjectOrg>()
|
||||
.eq(XzProjectOrg::getParentId, xzProjectOrg.getId())
|
||||
.eq(XzProjectOrg::getProjectSn, xzProjectOrg.getProjectSn())
|
||||
.eq(XzProjectOrg::getStatus, 0)
|
||||
);
|
||||
if (CollUtil.isNotEmpty(cOrgs)) {
|
||||
throw new OpenAlertException("该部门有下级部门未停用,不能停用");
|
||||
}
|
||||
}
|
||||
if (!Objects.equals(oldPo.getParentId(), xzProjectOrg.getParentId())) {
|
||||
XzProjectOrg pOrg = xzProjectOrgMapper.selectById(xzProjectOrg.getParentId());
|
||||
if (Objects.equals(xzProjectOrg.getStatus(), 0)) {
|
||||
if (pOrg != null) {
|
||||
if (Objects.equals(pOrg.getStatus(), 1)) {
|
||||
throw new OpenAlertException("该上级部门状态为停用,无法修改");
|
||||
}
|
||||
if (Objects.equals(xzProjectOrg.getId(), xzProjectOrg.getParentId())) {
|
||||
throw new OpenAlertException("不能将部门移动到其自身");
|
||||
}
|
||||
List<XzProjectOrg> children = baseMapper.getChildren(xzProjectOrg.getId());
|
||||
for (XzProjectOrg child : children) {
|
||||
if (child.getId().equals(xzProjectOrg.getParentId())) {
|
||||
throw new OpenAlertException("不能将部门移动到其自身下级");
|
||||
}
|
||||
}
|
||||
|
||||
XzProjectOrg pOrg = xzProjectOrgMapper.selectById(xzProjectOrg.getParentId());
|
||||
// 修改子部门
|
||||
boolean top = xzProjectOrg.getParentId() == null || xzProjectOrg.getParentId() == 0;
|
||||
if (top) {
|
||||
xzProjectOrg.setParentId(0L);
|
||||
xzProjectOrg.setAncestors("0");
|
||||
} else {
|
||||
if (pOrg != null) {
|
||||
xzProjectOrg.setAncestors(pOrg.getAncestors() + "," + pOrg.getId());
|
||||
} else {
|
||||
xzProjectOrg.setAncestors("0");
|
||||
if (pOrg == null) {
|
||||
throw new OpenAlertException("上级部门不存在");
|
||||
}
|
||||
if (Objects.equals(xzProjectOrg.getStatus(), 0) && Objects.equals(pOrg.getStatus(), 1)) {
|
||||
throw new OpenAlertException("该上级部门状态为停用,无法修改");
|
||||
}
|
||||
xzProjectOrg.setAncestors(pOrg.getAncestors() + "," + pOrg.getId());
|
||||
}
|
||||
baseMapper.updateAncestors(oldPo.getAncestors(), xzProjectOrg.getAncestors(), xzProjectOrg.getProjectSn(), xzProjectOrg.getId());
|
||||
baseMapper.updateById(xzProjectOrg);
|
||||
} else {
|
||||
xzProjectOrg.setAncestors(null);
|
||||
baseMapper.updateById(xzProjectOrg);
|
||||
baseMapper.updateAncestors(oldPo.getAncestors(), xzProjectOrg.getAncestors(), xzProjectOrg.getProjectSn());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user