1. 撤回
This commit is contained in:
parent
f3ad7c0862
commit
080a1272e3
|
|
@ -171,16 +171,10 @@ public class StoreTerminalVO {
|
|||
*/
|
||||
private Integer occupy;
|
||||
/**
|
||||
* 巡检状态
|
||||
* 终端状态
|
||||
*/
|
||||
@DictFormat(dictType = "terminal_status")
|
||||
private Integer terminalStatus;
|
||||
/**
|
||||
* 终端--状态
|
||||
*/
|
||||
@DictFormat(dictType = "mer_status")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 偏差(直线距离 米)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import javax.validation.constraints.NotNull;
|
|||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
|
@ -24,7 +25,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
public class DispatchQuery extends CommonParam {
|
||||
|
||||
@NotNull(message = "终端id 不能为空")
|
||||
// @NotNull(message = "终端id 不能为空")
|
||||
/** 终端id */
|
||||
private List<Long> terminalIds;
|
||||
|
||||
|
|
@ -64,5 +65,5 @@ public class DispatchQuery extends CommonParam {
|
|||
return this;
|
||||
}
|
||||
|
||||
private List<String> terminalNos;
|
||||
private List<String> terminalNos = new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,20 +162,20 @@ public class WrkInfoController {
|
|||
*/
|
||||
@PostMapping("/dispatch/app")
|
||||
@RequiresPermissions("wrk:info:dispatch")
|
||||
@SysLog(value = "批量派单/领取", businessType = BusinessType.IMPORT)
|
||||
@SysLog(value = "派单/领取", businessType = BusinessType.IMPORT)
|
||||
public AjaxResult dispatchApp(@RequestBody @Validated DispatchQuery query) {
|
||||
wrkInfoService.dispatch(query, 0);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量派单/领取
|
||||
* 批量派单/领取 todo
|
||||
*/
|
||||
@PostMapping("/dispatch")
|
||||
@RequiresPermissions("wrk:info:dispatch")
|
||||
@SysLog(value = "批量派单/领取", businessType = BusinessType.IMPORT)
|
||||
public AjaxResult dispatch(@RequestPart(value = "file", required = false) MultipartFile file,
|
||||
@RequestBody @Validated DispatchQuery query) {
|
||||
@Validated DispatchQuery query) {
|
||||
if (file.isEmpty()) {
|
||||
wrkInfoService.dispatch(query, 0);
|
||||
return AjaxResult.success();
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class WrkInfoTerminalRecordController {
|
|||
*/
|
||||
@SysLog(value = "我的终端池", businessType = BusinessType.QUERY)
|
||||
@GetMapping("/mine/page")
|
||||
@RequiresPermissions("ins:terminal:mine")
|
||||
// @RequiresPermissions("ins:terminal:mine")
|
||||
public AjaxResult minePageList(@Validated TerminalQuery query) {
|
||||
// 获取当前用户的
|
||||
query.setUserId(SecurityUtils.getUserId());
|
||||
|
|
|
|||
|
|
@ -189,6 +189,8 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
|||
@Transactional
|
||||
public List<WrkInfo> dispatch(DispatchQuery query, int i) {
|
||||
|
||||
AssertUtil.invalidate(CollectionUtil.isNotEmpty(query.getTerminalIds()) && CollectionUtil.isNotEmpty(query.getTerminalNos()),
|
||||
"获取终端错误");
|
||||
// 获取所有终端信息
|
||||
List<Terminal> terminals = terminalService.list(new LambdaQueryWrapper<Terminal>()
|
||||
.in(CollectionUtil.isNotEmpty(query.getTerminalIds()), Terminal::getTerminalId, query.getTerminalIds())
|
||||
|
|
@ -205,7 +207,6 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
|||
// 商户 map
|
||||
Map<Long, Store> storeMap
|
||||
= stores.stream().collect(Collectors.toMap(Store::getStoreId, s -> s, (o, n) -> n));
|
||||
Set<String> nickNames = stores.stream().map(Store::getAccountManager).collect(Collectors.toSet());
|
||||
Result<SysUser> userInfo = userFeignService.getInfoById(query.getUserId(), SecurityConstants.INNER);
|
||||
|
||||
Set<Long> deptIds = stores.stream().map(Store::getDeptId).collect(Collectors.toSet());
|
||||
|
|
@ -430,8 +431,8 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void withdraw(List<Long> ids) throws Exception {
|
||||
List<Integer> status = ListUtil.toList(1, 2, 5, 6, 7);
|
||||
public void withdraw(List<Long> ids) {
|
||||
List<Integer> status = ListUtil.toList(1, 5, 6, 9);
|
||||
LambdaQueryWrapper<WrkInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(WrkInfo::getWrkId, ids);
|
||||
queryWrapper.in(WrkInfo::getWrkStatus, status);
|
||||
|
|
@ -442,6 +443,16 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
|||
wrkImgService.remove(new LambdaQueryWrapper<WrkImg>().in(WrkImg::getWrkId, wrkIds));
|
||||
inspectionDataService.remove(new LambdaQueryWrapper<InspectionData>().in(InspectionData::getInsId, wrkIds));
|
||||
// todo 终端占用状态和江西内蒙古
|
||||
wrkInfoStoreRecordService.removeBatchByIds(wrkIds);
|
||||
// 修改 终端信息
|
||||
wrkInfoTerminalRecordService.removeBatchByIds(wrkIds);
|
||||
// 修改 终端对应巡检信息
|
||||
wrkInfoTerminalInsRecordService.removeBatchByIds(wrkIds);
|
||||
|
||||
// todo 解除终端的占用
|
||||
// todo 江苏工行, 建行内蒙古的撤回
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ import java.util.stream.Collectors;
|
|||
@Slf4j
|
||||
@Service
|
||||
public class WrkInfoTerminalRecordServiceImpl extends ServiceImpl<WrkInfoTerminalRecordMapper, WrkInfoTerminalRecord> implements WrkInfoTerminalRecordService {
|
||||
@Resource
|
||||
private RemoteDeptService remoteDeptService;
|
||||
/**
|
||||
* 我的终端池
|
||||
*/
|
||||
|
|
@ -40,15 +38,6 @@ public class WrkInfoTerminalRecordServiceImpl extends ServiceImpl<WrkInfoTermina
|
|||
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||
Page<StoreTerminalVO> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
|
||||
List<StoreTerminalVO> terminalVOS = baseMapper.minePageList(query, page);
|
||||
if (CollectionUtil.isNotEmpty(terminalVOS)){
|
||||
Set<Long> deptIds =
|
||||
terminalVOS.stream().map(StoreTerminalVO::getDeptId).collect(Collectors.toSet());
|
||||
Map<Long, String> deptNameByIds
|
||||
= remoteDeptService.getDeptNameByIds(deptIds, SecurityConstants.INNER);
|
||||
if (CollectionUtil.isNotEmpty(deptNameByIds)){
|
||||
terminalVOS.forEach(s-> s.setDeptName(deptNameByIds.get(s.getDeptId())));
|
||||
}
|
||||
}
|
||||
return new PageResult(terminalVOS, page);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,6 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScpoe')}
|
||||
</if>
|
||||
ORDER BY #{query.orderBy} #{query.isAsc}
|
||||
ORDER BY t.${query.orderBy} ${query.isAsc}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -35,6 +35,6 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY #{query.orderBy} #{query.isAsc}
|
||||
ORDER BY s.${query.orderBy} ${query.isAsc}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY #{query.orderBy} #{query.isAsc}
|
||||
ORDER BY t.${query.orderBy} ${query.isAsc}
|
||||
</select>
|
||||
<sql id="selectStoreTerminalSql">
|
||||
SELECT pt.project_id AS projectId,
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
i.lower_task_id AS lowerTaskId,
|
||||
lpt.`name` AS lowerTaskName,
|
||||
i.dept_id AS deptId,
|
||||
i.dept_name AS deptName,
|
||||
i.work_no AS workNo,
|
||||
i.wrk_id AS wrkId,
|
||||
|
||||
|
|
@ -68,6 +69,6 @@
|
|||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
ORDER BY #{query.orderBy} #{query.isAsc}
|
||||
ORDER BY i.${query.orderBy} ${query.isAsc}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -23,16 +23,13 @@ public class InsTest {
|
|||
public void test(){
|
||||
DispatchQuery query = new DispatchQuery();
|
||||
query.setTerminalIds(List.of(1815687260161114113L));
|
||||
query.setTaskId(1808384396409679874L);
|
||||
query.setUserId(1805497601669918722L);
|
||||
query.setWorkType(20);
|
||||
query.setEndTime(LocalDateTime.of(2024, 7, 31, 0, 0, 0));
|
||||
query.setWorkSort(1);
|
||||
query.setRemark("111");
|
||||
query.setWorkSource(3);
|
||||
query.setNos(List.of("1242"));
|
||||
query.setTerminalNos(List.of("235"));
|
||||
query.setOccupy(0);
|
||||
wrkInfoService.dispatch(query, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue