Merge remote-tracking branch 'origin/fix-bug-202303' into fix-bug-202303
This commit is contained in:
+1
@@ -614,6 +614,7 @@ public class oConvertUtils {
|
||||
} catch (IllegalAccessException e) {
|
||||
log.error("entityToModel : 安全权限异常", e);
|
||||
}
|
||||
assert model != null;
|
||||
BeanUtils.copyProperties(entity, model);
|
||||
return (T)model;
|
||||
}
|
||||
|
||||
+69
-53
@@ -16,6 +16,8 @@ import com.jero.common.system.query.QueryCondition;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.demo.mock.vxe.entity.MockEntity;
|
||||
import com.jero.modules.demo.mock.vxe.websocket.VXESocket;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -38,7 +40,7 @@ public class VxeMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change1")
|
||||
public Result mockChange1(@RequestParam("id") String id, @RequestParam("status") String status) {
|
||||
public Result<T> mockChange1(@RequestParam("id") String id, @RequestParam("status") String status) {
|
||||
/* id 为 行的id(rowId),只要获取到rowId,那么只需要调用 VXESocket.sendMessageToAll() 即可 */
|
||||
|
||||
// 封装行数据
|
||||
@@ -61,7 +63,7 @@ public class VxeMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change2")
|
||||
public Result mockChange2(@RequestParam("id") String id, @RequestParam("tug_status") String tug_status) {
|
||||
public Result<T> mockChange2(@RequestParam("id") String id, @RequestParam("tug_status") String tug_status) {
|
||||
/* id 为 行的id(rowId),只要获取到rowId,那么只需要调用 VXESocket.sendMessageToAll() 即可 */
|
||||
|
||||
// 封装行数据
|
||||
@@ -85,7 +87,7 @@ public class VxeMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change3")
|
||||
public Result mockChange3(@RequestParam("id") String id, @RequestParam("progress") String progress) {
|
||||
public Result<T> mockChange3(@RequestParam("id") String id, @RequestParam("progress") String progress) {
|
||||
/* id 为 行的id(rowId),只要获取到rowId,那么只需要调用 VXESocket.sendMessageToAll() 即可 */
|
||||
|
||||
// 封装行数据
|
||||
@@ -121,7 +123,7 @@ public class VxeMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change4")
|
||||
public Result mockChange4(@RequestParam("status") String status) {
|
||||
public Result<T> mockChange4(@RequestParam("status") String status) {
|
||||
// 封装socket数据
|
||||
JSONObject socketData = new JSONObject();
|
||||
// 这里的 key 是前端注册时使用的key,必须保持一致
|
||||
@@ -143,7 +145,7 @@ public class VxeMockController {
|
||||
* @param rowData 行数据,实际使用时可以替换成一个实体类
|
||||
*/
|
||||
@PostMapping ("/immediateSaveRow")
|
||||
public Result mockImmediateSaveRow(@RequestBody JSONObject rowData) throws Exception {
|
||||
public Result<T> mockImmediateSaveRow(@RequestBody JSONObject rowData) throws InterruptedException {
|
||||
log.info("即时保存.rowData:" + rowData.toJSONString());
|
||||
// 延时1.5秒,模拟网慢堵塞真实感
|
||||
Thread.sleep(500);
|
||||
@@ -156,7 +158,7 @@ public class VxeMockController {
|
||||
* @param tableData 表格数据(实际使用时可以替换成一个List实体类)
|
||||
*/
|
||||
@PostMapping("/immediateSaveAll")
|
||||
public Result mockImmediateSaveAll(@RequestBody JSONArray tableData) throws Exception {
|
||||
public Result<T> mockImmediateSaveAll(@RequestBody JSONArray tableData) throws InterruptedException {
|
||||
// 【注】:
|
||||
// 1、tableData里包含该页所有的数据
|
||||
// 2、如果你实现了“即时保存”,那么除了新增的数据,其他的都是已经保存过的了,
|
||||
@@ -179,7 +181,7 @@ public class VxeMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getData")
|
||||
public Result getMockData(
|
||||
public Result<IPage<JSONObject>> getMockData(
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
// 父级id,根据父级id查询子级,如果为空则查询顶级
|
||||
@@ -205,7 +207,7 @@ public class VxeMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDdjhData")
|
||||
public Result getMockDdjhData(
|
||||
public Result<IPage<JSONObject>> getMockDdjhData(
|
||||
// SpringMVC 会自动将参数注入到实体里
|
||||
MockEntity mockEntity,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@@ -223,8 +225,8 @@ public class VxeMockController {
|
||||
Map<String, String[]> parameterMap = request.getParameterMap();
|
||||
// 遍历输出到控制台
|
||||
log.info("\ngetDdjhData - 普通查询条件:");
|
||||
for (String key : parameterMap.keySet()) {
|
||||
log.info("-- " + key + ": " + JSON.toJSONString(parameterMap.get(key)));
|
||||
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
|
||||
log.info("-- " + entry.getKey() + ": " + JSON.toJSONString(entry.getValue()));
|
||||
}
|
||||
// 输出高级查询
|
||||
try {
|
||||
@@ -270,13 +272,20 @@ public class VxeMockController {
|
||||
}
|
||||
|
||||
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
|
||||
List<JSONObject> records = getJsonObjects(dataList, page);
|
||||
page.setRecords(records);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<JSONObject> getJsonObjects(JSONArray dataList, IPage<JSONObject> page) {
|
||||
// 逐行查询子表数据,用于计算拖轮状态
|
||||
List<JSONObject> records = page.getRecords();
|
||||
for (JSONObject record : records) {
|
||||
for (JSONObject obj : records) {
|
||||
Map<String, Integer> tugStatusMap = new HashMap<>();
|
||||
String id = record.getString("id");
|
||||
String id = obj.getString("id");
|
||||
// 查询出主表的拖轮
|
||||
String tugMain = record.getString("tug");
|
||||
String tugMain = obj.getString("tug");
|
||||
// 判断是否有值
|
||||
if (StringUtils.isNotBlank(tugMain)) {
|
||||
// 拖轮根据分号分割
|
||||
@@ -284,49 +293,56 @@ public class VxeMockController {
|
||||
// 查询子表数据
|
||||
List<JSONObject> subRecords = this.queryDataPage(dataList, id, null, null).getRecords();
|
||||
// 遍历子表和拖轮数据,找出进行计算反推拖轮状态
|
||||
for (JSONObject subData : subRecords) {
|
||||
String subTug = subData.getString("tug");
|
||||
if (StringUtils.isNotBlank(subTug)) {
|
||||
for (String tug : tugs) {
|
||||
if (tug.equals(subTug)) {
|
||||
// 计算拖轮状态逻辑
|
||||
int statusCode = 0;
|
||||
|
||||
/* 如果有发船时间、作业开始时间、作业结束时间、回船时间,则主表中的拖轮列中的每个拖轮背景色要即时变色 */
|
||||
|
||||
// 有发船时间,状态 +1
|
||||
String departureTime = subData.getString("departure_time");
|
||||
if (StringUtils.isNotBlank(departureTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有作业开始时间,状态 +1
|
||||
String workBeginTime = subData.getString("work_begin_time");
|
||||
if (StringUtils.isNotBlank(workBeginTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有作业结束时间,状态 +1
|
||||
String workEndTime = subData.getString("work_end_time");
|
||||
if (StringUtils.isNotBlank(workEndTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有回船时间,状态 +1
|
||||
String returnTime = subData.getString("return_time");
|
||||
if (StringUtils.isNotBlank(returnTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 保存拖轮状态,key是拖轮的值,value是状态,前端根据不同的状态码,显示不同的颜色,这个颜色也可以后台计算完之后返回给前端直接使用
|
||||
tugStatusMap.put(tug, statusCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
doForSubRecords(tugStatusMap, tugs, subRecords);
|
||||
}
|
||||
// 新加一个字段用于保存拖轮状态,不要直接覆盖原来的,这个字段可以不保存到数据库里
|
||||
record.put("tug_status", tugStatusMap);
|
||||
obj.put("tug_status", tugStatusMap);
|
||||
}
|
||||
return records;
|
||||
}
|
||||
|
||||
private void doForSubRecords(Map<String, Integer> tugStatusMap, String[] tugs, List<JSONObject> subRecords) {
|
||||
for (JSONObject subData : subRecords) {
|
||||
String subTug = subData.getString("tug");
|
||||
if (StringUtils.isNotBlank(subTug)) {
|
||||
doForTugs(tugStatusMap, tugs, subData, subTug);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doForTugs(Map<String, Integer> tugStatusMap, String[] tugs, JSONObject subData, String subTug) {
|
||||
for (String tug : tugs) {
|
||||
if (tug.equals(subTug)) {
|
||||
// 计算拖轮状态逻辑
|
||||
int statusCode = 0;
|
||||
|
||||
/* 如果有发船时间、作业开始时间、作业结束时间、回船时间,则主表中的拖轮列中的每个拖轮背景色要即时变色 */
|
||||
|
||||
// 有发船时间,状态 +1
|
||||
String departureTime = subData.getString("departure_time");
|
||||
if (StringUtils.isNotBlank(departureTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有作业开始时间,状态 +1
|
||||
String workBeginTime = subData.getString("work_begin_time");
|
||||
if (StringUtils.isNotBlank(workBeginTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有作业结束时间,状态 +1
|
||||
String workEndTime = subData.getString("work_end_time");
|
||||
if (StringUtils.isNotBlank(workEndTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有回船时间,状态 +1
|
||||
String returnTime = subData.getString("return_time");
|
||||
if (StringUtils.isNotBlank(returnTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 保存拖轮状态,key是拖轮的值,value是状态,前端根据不同的状态码,显示不同的颜色,这个颜色也可以后台计算完之后返回给前端直接使用
|
||||
tugStatusMap.put(tug, statusCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
page.setRecords(records);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+9
-9
@@ -56,7 +56,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
@ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表")
|
||||
@GetMapping(value = "/list")
|
||||
@PermissionData(pageComponent = "jero/JeroDemoList")
|
||||
public Result list(JeroDemo jeroDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
public Result<IPage<JeroDemo>> list(JeroDemo jeroDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeroDemo> queryWrapper = QueryGenerator.initQueryWrapper(jeroDemo, req.getParameterMap());
|
||||
Page<JeroDemo> page = new Page<>(pageNo, pageSize);
|
||||
@@ -78,7 +78,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
@PostMapping(value = "/add")
|
||||
@AutoLog(value = "添加测试DEMO")
|
||||
@ApiOperation(value = "添加DEMO", notes = "添加DEMO")
|
||||
public Result add(@RequestBody JeroDemo jeroDemo) {
|
||||
public Result<T> add(@RequestBody JeroDemo jeroDemo) {
|
||||
JeroDemoService.save(jeroDemo);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
@PostMapping(value = "/edit")
|
||||
@ApiOperation(value = "编辑DEMO", notes = "编辑DEMO")
|
||||
@AutoLog(value = "编辑DEMO", operateType = CommonConstant.OPERATE_TYPE_3)
|
||||
public Result edit(@RequestBody JeroDemo jeroDemo) {
|
||||
public Result<T> edit(@RequestBody JeroDemo jeroDemo) {
|
||||
JeroDemoService.updateById(jeroDemo);
|
||||
return Result.OK("更新成功!");
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
@AutoLog(value = "删除测试DEMO")
|
||||
@PostMapping(value = "/delete")
|
||||
@ApiOperation(value = "通过ID删除DEMO", notes = "通过ID删除DEMO")
|
||||
public Result delete(@RequestBody Map<String, String> map) {
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
JeroDemoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
@@ -134,7 +134,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
@ApiOperation(value = "通过ID查询DEMO", notes = "通过ID查询DEMO")
|
||||
public Result queryById(@ApiParam(name = "id", value = "示例id", required = true) @RequestParam(name = "id", required = true) String id) {
|
||||
public Result<JeroDemo> queryById(@ApiParam(name = "id", value = "示例id", required = true) @RequestParam(name = "id", required = true) String id) {
|
||||
JeroDemo jeroDemo = JeroDemoService.getById(id);
|
||||
return Result.OK(jeroDemo);
|
||||
}
|
||||
@@ -161,7 +161,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
public Result<JeroDemo> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, JeroDemo.class);
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
|
||||
// ==========================================动态表单 JSON接收测试===========================================
|
||||
@PostMapping(value = "/testOnlineAdd")
|
||||
public Result testOnlineAdd(@RequestBody JSONObject json) {
|
||||
public Result<T> testOnlineAdd(@RequestBody JSONObject json) {
|
||||
log.info(json.toJSONString());
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
*/
|
||||
@GetMapping(value = "/mpList")
|
||||
@PermissionData(pageComponent = "jero/JeroDemoList")
|
||||
public Result loadMpPermissonList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
public Result<IPage<JeroDemo>> loadMpPermissonList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<JeroDemo> queryWrapper = new QueryWrapper<JeroDemo>();
|
||||
//编程方式,给queryWrapper装载数据权限规则
|
||||
@@ -276,7 +276,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
*/
|
||||
@GetMapping(value = "/sqlList")
|
||||
@PermissionData(pageComponent = "jero/JeroDemoList")
|
||||
public Result loadSqlPermissonList(JeroDemo jeroDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
public Result<IPage<JeroDemo>> loadSqlPermissonList(JeroDemo jeroDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<JeroDemo> pageList = JeroDemoService.queryListWithPermission(pageSize, pageNo);
|
||||
return Result.OK(pageList);
|
||||
|
||||
+7
-7
@@ -64,7 +64,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
public Result queryPageList(JeroOrderMain jeroOrderMain, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
||||
public Result<IPage<JeroOrderMain>> queryPageList(JeroOrderMain jeroOrderMain, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
||||
QueryWrapper<JeroOrderMain> queryWrapper = QueryGenerator.initQueryWrapper(jeroOrderMain, req.getParameterMap());
|
||||
Page<JeroOrderMain> page = new Page<>(pageNo, pageSize);
|
||||
IPage<JeroOrderMain> pageList = jeroOrderMainService.page(page, queryWrapper);
|
||||
@@ -78,7 +78,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public Result add(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
public Result<T> add(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
JeroOrderMain jeroOrderMain = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(jeroOrderMainPage, jeroOrderMain);
|
||||
jeroOrderMainService.saveMain(jeroOrderMain, jeroOrderMainPage.getJeroOrderCustomerList(), jeroOrderMainPage.getJeroOrderTicketList());
|
||||
@@ -92,7 +92,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/edit")
|
||||
public Result eidt(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
public Result<T> eidt(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
JeroOrderMain jeroOrderMain = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(jeroOrderMainPage, jeroOrderMain);
|
||||
jeroOrderMainService.updateCopyMain(jeroOrderMain, jeroOrderMainPage.getJeroOrderCustomerList(), jeroOrderMainPage.getJeroOrderTicketList());
|
||||
@@ -132,7 +132,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
public Result<JeroOrderMain> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
JeroOrderMain jeroOrderMain = jeroOrderMainService.getById(id);
|
||||
return Result.OK(jeroOrderMain);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryOrderCustomerListByMainId")
|
||||
public Result queryOrderCustomerListByMainId(@RequestParam(name = "id", required = true) String id) {
|
||||
public Result<List<JeroOrderCustomer>> queryOrderCustomerListByMainId(@RequestParam(name = "id", required = true) String id) {
|
||||
List<JeroOrderCustomer> jeroOrderCustomerList = jeroOrderCustomerService.selectCustomersByMainId(id);
|
||||
return Result.OK(jeroOrderCustomerList);
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryOrderTicketListByMainId")
|
||||
public Result queryOrderTicketListByMainId(@RequestParam(name = "id", required = true) String id) {
|
||||
public Result<List<JeroOrderTicket>> queryOrderTicketListByMainId(@RequestParam(name = "id", required = true) String id) {
|
||||
List<JeroOrderTicket> jeroOrderTicketList = jeroOrderTicketService.selectTicketsByMainId(id);
|
||||
return Result.OK(jeroOrderTicketList);
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
*/
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
@PostMapping("/importExcel")
|
||||
public Result importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
public Result<T> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
|
||||
+14
-14
@@ -61,7 +61,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/orderList")
|
||||
public Result respondePagedData(JeroOrderMain jeroOrderMain,
|
||||
public Result<IPage<JeroOrderMain>> respondePagedData(JeroOrderMain jeroOrderMain,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
@@ -78,7 +78,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public Result add(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
public Result<T> add(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
JeroOrderMain jeroOrderMain = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(jeroOrderMainPage, jeroOrderMain);
|
||||
jeroOrderMainService.save(jeroOrderMain);
|
||||
@@ -92,7 +92,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/edit")
|
||||
public Result edit(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
public Result<T> edit(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
JeroOrderMain jeroOrderMain = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(jeroOrderMainPage, jeroOrderMain);
|
||||
jeroOrderMainService.updateById(jeroOrderMain);
|
||||
@@ -132,7 +132,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
public Result<JeroOrderMain> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
JeroOrderMain jeroOrderMain = jeroOrderMainService.getById(id);
|
||||
return Result.OK(jeroOrderMain);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/listOrderCustomerByMainId")
|
||||
public Result queryOrderCustomerListByMainId(JeroOrderCustomer jeroOrderCustomer,
|
||||
public Result<IPage<JeroOrderCustomer>> queryOrderCustomerListByMainId(JeroOrderCustomer jeroOrderCustomer,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
@@ -162,7 +162,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/listOrderTicketByMainId")
|
||||
public Result queryOrderTicketListByMainId(JeroOrderTicket jeroOrderTicket,
|
||||
public Result<IPage<JeroOrderTicket>> queryOrderTicketListByMainId(JeroOrderTicket jeroOrderTicket,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
@@ -179,7 +179,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addCustomer")
|
||||
public Result addCustomer(@RequestBody JeroOrderCustomer jeroOrderCustomer) {
|
||||
public Result<T> addCustomer(@RequestBody JeroOrderCustomer jeroOrderCustomer) {
|
||||
jeroOrderCustomerService.save(jeroOrderCustomer);
|
||||
return Result.OK(ResultConstant.OP_OK);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/editCustomer")
|
||||
public Result editCustomer(@RequestBody JeroOrderCustomer jeroOrderCustomer) {
|
||||
public Result<T> editCustomer(@RequestBody JeroOrderCustomer jeroOrderCustomer) {
|
||||
jeroOrderCustomerService.updateById(jeroOrderCustomer);
|
||||
return Result.OK(ResultConstant.OP_OK);
|
||||
}
|
||||
@@ -203,7 +203,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteCustomer")
|
||||
public Result deleteCustomer(@RequestBody Map<String, String> map) {
|
||||
public Result<T> deleteCustomer(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
jeroOrderCustomerService.removeById(id);
|
||||
return Result.OK(ResultConstant.DEL_OK);
|
||||
@@ -216,7 +216,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatchCustomer")
|
||||
public Result deleteBatchCustomer(@RequestBody Map<String, String> map) {
|
||||
public Result<T> deleteBatchCustomer(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
this.jeroOrderCustomerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK(ResultConstant.BATCH_DEL_OK);
|
||||
@@ -229,7 +229,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addTicket")
|
||||
public Result addTicket(@RequestBody JeroOrderTicket jeroOrderTicket) {
|
||||
public Result<T> addTicket(@RequestBody JeroOrderTicket jeroOrderTicket) {
|
||||
jeroOrderTicketService.save(jeroOrderTicket);
|
||||
return Result.OK(ResultConstant.OP_OK);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/editTicket")
|
||||
public Result editTicket(@RequestBody JeroOrderTicket jeroOrderTicket) {
|
||||
public Result<T> editTicket(@RequestBody JeroOrderTicket jeroOrderTicket) {
|
||||
jeroOrderTicketService.updateById(jeroOrderTicket);
|
||||
return Result.OK(ResultConstant.OP_OK);
|
||||
}
|
||||
@@ -253,7 +253,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteTicket")
|
||||
public Result deleteTicket(@RequestBody Map<String, String> map) {
|
||||
public Result<T> deleteTicket(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
jeroOrderTicketService.removeById(id);
|
||||
return Result.OK(ResultConstant.DEL_OK);
|
||||
@@ -266,7 +266,7 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatchTicket")
|
||||
public Result deleteBatchTicket(@RequestBody Map<String, String> map) {
|
||||
public Result<T> deleteBatchTicket(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
this.jeroOrderTicketService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK(ResultConstant.BATCH_DEL_OK);
|
||||
|
||||
+16
-26
@@ -1,15 +1,9 @@
|
||||
package com.jero.modules.demo.test.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.api.vo.ResultConstant;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
@@ -17,31 +11,27 @@ import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.demo.test.entity.JoaDemo;
|
||||
import com.jero.modules.demo.test.service.IJoaDemoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 流程测试
|
||||
@@ -206,7 +196,7 @@ public class JoaDemoController {
|
||||
*/
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
@PostMapping("/importExcel")
|
||||
public Result importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
public Result<T> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
|
||||
+95
-75
@@ -16,6 +16,8 @@ import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.constant.VXESocketConst;
|
||||
import com.jero.modules.demo.mock.vxe.websocket.VXESocket;
|
||||
import com.jero.modules.dlglong.entity.MockEntity;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -38,7 +40,7 @@ public class DlMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change1")
|
||||
public Result mockChange1(@RequestParam("id") String id, @RequestParam("status") String status) {
|
||||
public Result<T> mockChange1(@RequestParam("id") String id, @RequestParam("status") String status) {
|
||||
/* id 为 行的id(rowId),只要获取到rowId,那么只需要调用 VXESocket.sendMessageToAll() 即可 */
|
||||
|
||||
// 封装行数据
|
||||
@@ -61,7 +63,7 @@ public class DlMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change2")
|
||||
public Result mockChange2(@RequestParam("id") String id, @RequestParam("tug_status") String tug_status) {
|
||||
public Result<T> mockChange2(@RequestParam("id") String id, @RequestParam("tug_status") String tug_status) {
|
||||
/* id 为 行的id(rowId),只要获取到rowId,那么只需要调用 VXESocket.sendMessageToAll() 即可 */
|
||||
|
||||
// 封装行数据
|
||||
@@ -85,7 +87,7 @@ public class DlMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change3")
|
||||
public Result mockChange3(@RequestParam("id") String id, @RequestParam("progress") String progress) {
|
||||
public Result<T> mockChange3(@RequestParam("id") String id, @RequestParam("progress") String progress) {
|
||||
/* id 为 行的id(rowId),只要获取到rowId,那么只需要调用 VXESocket.sendMessageToAll() 即可 */
|
||||
|
||||
// 封装行数据
|
||||
@@ -120,7 +122,7 @@ public class DlMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/change4")
|
||||
public Result mockChange4(@RequestParam("status") String status) {
|
||||
public Result<T> mockChange4(@RequestParam("status") String status) {
|
||||
// 封装socket数据
|
||||
JSONObject socketData = new JSONObject();
|
||||
// 这里的 key 是前端注册时使用的key,必须保持一致
|
||||
@@ -142,7 +144,7 @@ public class DlMockController {
|
||||
* @param rowData 行数据,实际使用时可以替换成一个实体类
|
||||
*/
|
||||
@PostMapping("/immediateSaveRow")
|
||||
public Result mockImmediateSaveRow(@RequestBody JSONObject rowData) throws Exception {
|
||||
public Result<T> mockImmediateSaveRow(@RequestBody JSONObject rowData) throws InterruptedException {
|
||||
log.info("即时保存.rowData:" + rowData.toJSONString());
|
||||
// 延时1.5秒,模拟网慢堵塞真实感
|
||||
Thread.sleep(500);
|
||||
@@ -155,7 +157,7 @@ public class DlMockController {
|
||||
* @param tableData 表格数据(实际使用时可以替换成一个List实体类)
|
||||
*/
|
||||
@PostMapping("/immediateSaveAll")
|
||||
public Result mockImmediateSaveAll(@RequestBody JSONArray tableData) throws Exception {
|
||||
public Result<T> mockImmediateSaveAll(@RequestBody JSONArray tableData) throws InterruptedException {
|
||||
// 【注】:
|
||||
// 1、tableData里包含该页所有的数据
|
||||
// 2、如果你实现了“即时保存”,那么除了新增的数据,其他的都是已经保存过的了,
|
||||
@@ -178,7 +180,7 @@ public class DlMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getData")
|
||||
public Result getMockData(
|
||||
public Result<IPage<JSONObject>> getMockData(
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
// 父级id,根据父级id查询子级,如果为空则查询顶级
|
||||
@@ -204,7 +206,7 @@ public class DlMockController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDdjhData")
|
||||
public Result getMockDdjhData(
|
||||
public Result<IPage<JSONObject>> getMockDdjhData(
|
||||
// SpringMVC 会自动将参数注入到实体里
|
||||
MockEntity mockEntity,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@@ -222,32 +224,11 @@ public class DlMockController {
|
||||
Map<String, String[]> parameterMap = request.getParameterMap();
|
||||
// 遍历输出到控制台
|
||||
log.info("\ngetDdjhData - 普通查询条件:");
|
||||
for (String key : parameterMap.keySet()) {
|
||||
log.info("-- " + key + ": " + JSON.toJSONString(parameterMap.get(key)));
|
||||
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
|
||||
log.info("-- " + entry.getKey() + ": " + JSON.toJSONString(entry.getValue()));
|
||||
}
|
||||
// 输出高级查询
|
||||
try {
|
||||
log.info("\ngetDdjhData - 高级查询条件:");
|
||||
// 高级查询模式
|
||||
MatchTypeEnum matchType = MatchTypeEnum.getByValue(superQueryMatchType);
|
||||
if (matchType == null) {
|
||||
log.info("-- 高级查询模式:不识别(" + superQueryMatchType + ")");
|
||||
} else {
|
||||
log.info("-- 高级查询模式:" + matchType.getValue());
|
||||
}
|
||||
superQueryParams = URLDecoder.decode(superQueryParams, "UTF-8");
|
||||
List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class);
|
||||
if (conditions != null) {
|
||||
for (QueryCondition condition : conditions) {
|
||||
log.info("-- " + JSON.toJSONString(condition));
|
||||
}
|
||||
} else {
|
||||
log.info("-- 没有传递任何高级查询条件");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("-- 高级查询操作失败:" + superQueryParams, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
printExpertQuery(superQueryParams, superQueryMatchType);
|
||||
|
||||
/* 注:实际使用中不用写上面那种繁琐的代码,这里只是为了直观的输出到控制台里而写的示例,
|
||||
使用下面这种写法更简洁方便 */
|
||||
@@ -270,12 +251,19 @@ public class DlMockController {
|
||||
|
||||
IPage<JSONObject> page = this.queryDataPage(dataList, parentId, pageNo, pageSize);
|
||||
// 逐行查询子表数据,用于计算拖轮状态
|
||||
List<JSONObject> records = getJsonObjects(dataList, page);
|
||||
page.setRecords(records);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<JSONObject> getJsonObjects(JSONArray dataList, IPage<JSONObject> page) {
|
||||
List<JSONObject> records = page.getRecords();
|
||||
for (JSONObject record : records) {
|
||||
for (JSONObject obj : records) {
|
||||
Map<String, Integer> tugStatusMap = new HashMap<>();
|
||||
String id = record.getString("id");
|
||||
String id = obj.getString("id");
|
||||
// 查询出主表的拖轮
|
||||
String tugMain = record.getString("tug");
|
||||
String tugMain = obj.getString("tug");
|
||||
// 判断是否有值
|
||||
if (StringUtils.isNotBlank(tugMain)) {
|
||||
// 拖轮根据分号分割
|
||||
@@ -283,49 +271,81 @@ public class DlMockController {
|
||||
// 查询子表数据
|
||||
List<JSONObject> subRecords = this.queryDataPage(dataList, id, null, null).getRecords();
|
||||
// 遍历子表和拖轮数据,找出进行计算反推拖轮状态
|
||||
for (JSONObject subData : subRecords) {
|
||||
String subTug = subData.getString("tug");
|
||||
if (StringUtils.isNotBlank(subTug)) {
|
||||
for (String tug : tugs) {
|
||||
if (tug.equals(subTug)) {
|
||||
// 计算拖轮状态逻辑
|
||||
int statusCode = 0;
|
||||
|
||||
/* 如果有发船时间、作业开始时间、作业结束时间、回船时间,则主表中的拖轮列中的每个拖轮背景色要即时变色 */
|
||||
|
||||
// 有发船时间,状态 +1
|
||||
String departureTime = subData.getString("departure_time");
|
||||
if (StringUtils.isNotBlank(departureTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有作业开始时间,状态 +1
|
||||
String workBeginTime = subData.getString("work_begin_time");
|
||||
if (StringUtils.isNotBlank(workBeginTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有作业结束时间,状态 +1
|
||||
String workEndTime = subData.getString("work_end_time");
|
||||
if (StringUtils.isNotBlank(workEndTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有回船时间,状态 +1
|
||||
String returnTime = subData.getString("return_time");
|
||||
if (StringUtils.isNotBlank(returnTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 保存拖轮状态,key是拖轮的值,value是状态,前端根据不同的状态码,显示不同的颜色,这个颜色也可以后台计算完之后返回给前端直接使用
|
||||
tugStatusMap.put(tug, statusCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
getRecords(tugStatusMap, tugs, subRecords);
|
||||
}
|
||||
// 新加一个字段用于保存拖轮状态,不要直接覆盖原来的,这个字段可以不保存到数据库里
|
||||
record.put("tug_status", tugStatusMap);
|
||||
obj.put("tug_status", tugStatusMap);
|
||||
}
|
||||
return records;
|
||||
}
|
||||
|
||||
private void getRecords(Map<String, Integer> tugStatusMap, String[] tugs, List<JSONObject> subRecords) {
|
||||
for (JSONObject subData : subRecords) {
|
||||
String subTug = subData.getString("tug");
|
||||
if (StringUtils.isNotBlank(subTug)) {
|
||||
doForTugs(tugStatusMap, tugs, subData, subTug);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doForTugs(Map<String, Integer> tugStatusMap, String[] tugs, JSONObject subData, String subTug) {
|
||||
for (String tug : tugs) {
|
||||
if (tug.equals(subTug)) {
|
||||
// 计算拖轮状态逻辑
|
||||
int statusCode = 0;
|
||||
|
||||
/* 如果有发船时间、作业开始时间、作业结束时间、回船时间,则主表中的拖轮列中的每个拖轮背景色要即时变色 */
|
||||
|
||||
// 有发船时间,状态 +1
|
||||
String departureTime = subData.getString("departure_time");
|
||||
if (StringUtils.isNotBlank(departureTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有作业开始时间,状态 +1
|
||||
String workBeginTime = subData.getString("work_begin_time");
|
||||
if (StringUtils.isNotBlank(workBeginTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有作业结束时间,状态 +1
|
||||
String workEndTime = subData.getString("work_end_time");
|
||||
if (StringUtils.isNotBlank(workEndTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 有回船时间,状态 +1
|
||||
String returnTime = subData.getString("return_time");
|
||||
if (StringUtils.isNotBlank(returnTime)) {
|
||||
statusCode += 1;
|
||||
}
|
||||
// 保存拖轮状态,key是拖轮的值,value是状态,前端根据不同的状态码,显示不同的颜色,这个颜色也可以后台计算完之后返回给前端直接使用
|
||||
tugStatusMap.put(tug, statusCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void printExpertQuery(@RequestParam(name = "superQueryParams", required = false) String superQueryParams, @RequestParam(name = "superQueryMatchType", required = false) String superQueryMatchType) {
|
||||
try {
|
||||
log.info("\ngetDdjhData - 高级查询条件:");
|
||||
// 高级查询模式
|
||||
MatchTypeEnum matchType = MatchTypeEnum.getByValue(superQueryMatchType);
|
||||
if (matchType == null) {
|
||||
log.info("-- 高级查询模式:不识别(" + superQueryMatchType + ")");
|
||||
} else {
|
||||
log.info("-- 高级查询模式:" + matchType.getValue());
|
||||
}
|
||||
superQueryParams = URLDecoder.decode(superQueryParams, "UTF-8");
|
||||
List<QueryCondition> conditions = JSON.parseArray(superQueryParams, QueryCondition.class);
|
||||
if (conditions != null) {
|
||||
for (QueryCondition condition : conditions) {
|
||||
log.info("-- " + JSON.toJSONString(condition));
|
||||
}
|
||||
} else {
|
||||
log.info("-- 没有传递任何高级查询条件");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("-- 高级查询操作失败:" + superQueryParams, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
page.setRecords(records);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public interface IQuartzJobService extends IService<QuartzJob> {
|
||||
* 执行定时任务
|
||||
* @param quartzJob
|
||||
*/
|
||||
void execute(QuartzJob quartzJob) throws Exception;
|
||||
void execute(QuartzJob quartzJob) throws IllegalAccessException, InstantiationException, ClassNotFoundException, SchedulerException;
|
||||
|
||||
/**
|
||||
* 暂停任务
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(QuartzJob quartzJob) throws Exception {
|
||||
public void execute(QuartzJob quartzJob) throws IllegalAccessException, InstantiationException, ClassNotFoundException, SchedulerException {
|
||||
String jobName = quartzJob.getJobClassName().trim();
|
||||
Date startDate = new Date();
|
||||
String ymd = DateUtils.date2Str(startDate, DateUtils.yyyymmddhhmmss.get());
|
||||
|
||||
-1
@@ -248,7 +248,6 @@ public class SysDepartController {
|
||||
// @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
|
||||
@PostMapping("/deleteBatch")
|
||||
@CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
|
||||
// public Result<Object> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
public Result<Object> deleteBatch(@RequestBody Map<String,String> map) {
|
||||
String ids = map.get("ids");
|
||||
if (ids == null || "".equals(ids.trim())) {
|
||||
|
||||
-1
@@ -392,7 +392,6 @@ public class SysDictController {
|
||||
@ApiOperation(value = "字典控制器-删除字典", notes = "字典控制器-删除字典")
|
||||
@PostMapping(value = "/delete")
|
||||
@CacheEvict(value={CacheConstant.SYS_DICT_CACHE, CacheConstant.SYS_ENABLE_DICT_CACHE}, allEntries=true)
|
||||
// public Result<Object> delete(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<Object> delete(@RequestBody Map<String,String> map) {
|
||||
String id = map.get("id");
|
||||
boolean ok = sysDictService.removeById(id);
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @param page 分页参数
|
||||
* @return
|
||||
*/
|
||||
IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, IPage page);
|
||||
IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, Page<SysUserSysDepartModel> page);
|
||||
|
||||
/**
|
||||
* 根据角色Id查询
|
||||
|
||||
+3
-3
@@ -295,7 +295,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, IPage page) {
|
||||
public IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, Page<SysUserSysDepartModel> page) {
|
||||
List<SysUserSysDepartModel> list = baseMapper.getUserByOrgCode(page, orgCode, userParams);
|
||||
Integer total = baseMapper.getUserByOrgCodeTotal(orgCode, userParams);
|
||||
|
||||
@@ -370,8 +370,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<?> checkUserIsEffective(SysUser sysUser) {
|
||||
Result<?> result = new Result<>();
|
||||
public Result<T> checkUserIsEffective(SysUser sysUser) {
|
||||
Result<T> result = new Result<>();
|
||||
//情况1:根据用户信息查询,该用户不存在
|
||||
if (sysUser == null) {
|
||||
baseCommonService.addLog("用户登录失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#mysql
|
||||
driver_name=com.mysql.cj.jdbc.Driver
|
||||
url=jdbc:mysql://121.36.69.172:3307/jero-boot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||
url=jdbc:mysql://10.10.10.44:3306/jero-boot-bug?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||
username=root
|
||||
password=123456
|
||||
database_name=jero-boot
|
||||
password=hzwlsoft.com
|
||||
database_name=jero-boot-bug
|
||||
|
||||
#oracle
|
||||
#diver_name=oracle.jdbc.driver.OracleDriver
|
||||
@@ -24,4 +24,4 @@ database_name=jero-boot
|
||||
#url=jdbc:sqlserver://192.168.1.200:1433;DatabaseName=jero
|
||||
#username=sa
|
||||
#password=SA
|
||||
#database_name=jero
|
||||
#database_name=jero
|
||||
|
||||
@@ -1489,14 +1489,14 @@
|
||||
}));
|
||||
while (t.length) n = n.then(t.shift(), t.shift());
|
||||
return n
|
||||
}, a.forEach(["delete", "get", "head", "options"], (function(e) {
|
||||
}, a.forEach(["get", "head", "options"], (function(e) {
|
||||
s.prototype[e] = function(t, n) {
|
||||
return this.request(a.merge(n || {}, {
|
||||
method: e,
|
||||
url: t
|
||||
}))
|
||||
}
|
||||
})), a.forEach(["post", "put", "patch"], (function(e) {
|
||||
})), a.forEach(["post", "patch"], (function(e) {
|
||||
s.prototype[e] = function(t, n, r) {
|
||||
return this.request(a.merge(r || {}, {
|
||||
method: e,
|
||||
@@ -8082,7 +8082,7 @@
|
||||
function o(e, t) {
|
||||
return Object(r["a"])({
|
||||
url: e,
|
||||
method: "put",
|
||||
method: "post",
|
||||
data: t
|
||||
})
|
||||
}
|
||||
@@ -8098,7 +8098,7 @@
|
||||
function c(e, t) {
|
||||
return Object(r["a"])({
|
||||
url: e,
|
||||
method: "delete",
|
||||
method: "post",
|
||||
params: t
|
||||
})
|
||||
}
|
||||
@@ -10407,7 +10407,7 @@
|
||||
},
|
||||
edit: function(e, t) {
|
||||
var that = this;
|
||||
this.titleText = "编辑", this.uiSchema.method = "put", this.uiSchema.formTemplate = e, this.uiSchema.url =
|
||||
this.titleText = "编辑", this.uiSchema.method = "post", this.uiSchema.formTemplate = e, this.uiSchema.url =
|
||||
this.url.optPre + this.code, this.uiSchema = c({}, this.uiSchema), this.visible = !0, this.disableSubmit = !
|
||||
1, Object(o["c"])(this.url.optPre + this.code + "/" + t).then((function(e) {
|
||||
if (e.success) {
|
||||
@@ -11122,9 +11122,9 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
r.forEach(["delete", "get", "head"], (function(e) {
|
||||
r.forEach(["post", "get", "head"], (function(e) {
|
||||
c.headers[e] = {}
|
||||
})), r.forEach(["post", "put", "patch"], (function(e) {
|
||||
})), r.forEach(["post", "patch"], (function(e) {
|
||||
c.headers[e] = r.merge(i)
|
||||
})), e.exports = c
|
||||
}).call(this, n("f28c"))
|
||||
@@ -11639,7 +11639,7 @@
|
||||
while (1) switch (e.prev = e.next) {
|
||||
case 0:
|
||||
return a = "/sys/fillRule/executeRuleByCode/".concat(t), i = {}, "function" === typeof r && (i = r()),
|
||||
e.next = 5, Object(_api_manage__WEBPACK_IMPORTED_MODULE_5__["e"])(a, i, "PUT");
|
||||
e.next = 5, Object(_api_manage__WEBPACK_IMPORTED_MODULE_5__["e"])(a, i, "POST");
|
||||
case 5:
|
||||
if (o = e.sent, s = o.success, c = o.message, l = o.result, !s) {
|
||||
e.next = 13;
|
||||
@@ -20330,7 +20330,7 @@
|
||||
e.single = 1 == t.result.head.tableType;
|
||||
var n = {
|
||||
formTemplate: t.result.head.formTemplate,
|
||||
method: "put",
|
||||
method: "post",
|
||||
url: e.url.optPre + t.result.head.id
|
||||
};
|
||||
e.schema = Object.assign({}, t.result.schema, n);
|
||||
@@ -24352,7 +24352,7 @@
|
||||
var t = this,
|
||||
n = "post",
|
||||
r = this.url.add;
|
||||
this.model.id && (n = "put", r = this.url.edit), this.confirmLoading = !0, Object(s["e"])(r, e, n).then((
|
||||
this.model.id && (r = this.url.edit), this.confirmLoading = !0, Object(s["e"])(r, e, n).then((
|
||||
function(e) {
|
||||
e.success ? (t.$message.success(e.message), t.$emit("ok"), t.close()) : t.$message.warning(e.message)
|
||||
})).finally((function() {
|
||||
@@ -29134,7 +29134,7 @@
|
||||
e.exports = function(e) {
|
||||
l(e), e.baseURL && !s(e.url) && (e.url = c(e.baseURL, e.url)), e.headers = e.headers || {}, e.data = a(e.data,
|
||||
e.headers, e.transformRequest), e.headers = r.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers ||
|
||||
{}), r.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (function(t) {
|
||||
{}), r.forEach(["get", "head", "post", "patch", "common"], (function(t) {
|
||||
delete e.headers[t]
|
||||
}));
|
||||
var t = e.adapter || o.adapter;
|
||||
@@ -34058,7 +34058,7 @@
|
||||
e.head && e.head.tableName && (e.head.tableName = e.head.tableName.toLowerCase().trim());
|
||||
var i = "post",
|
||||
o = this.url.addAll;
|
||||
this.model.id && (i = "put", o = this.url.editAll), Object(p["e"])(o, e, i).then((function(n) {
|
||||
this.model.id && (o = this.url.editAll), Object(p["e"])(o, e, i).then((function(n) {
|
||||
n.success ? (t.refreshCacheTableName(t.metaTableName, e.head["tableName"]), t.$message.success(n.message),
|
||||
t.$emit("ok"), t.close()) : t.$message.warning(n.message)
|
||||
})).finally((function() {
|
||||
@@ -37496,8 +37496,8 @@
|
||||
if (!n) {
|
||||
t.confirmLoading = !0;
|
||||
var a = "",
|
||||
o = "";
|
||||
e.model.id ? (a += e.url.edit, o = "put") : (a += e.url.add, o = "post");
|
||||
o = "post";
|
||||
e.model.id ? (a += e.url.edit) : (a += e.url.add);
|
||||
var s = Object.assign(e.model, r);
|
||||
s.cgformHeadId = e.code, Object(i["e"])(a, s, o).then((function(e) {
|
||||
e.success ? (t.$message.success(e.message), t.$emit("ok")) : t.$message.warning(e.message)
|
||||
@@ -40153,7 +40153,7 @@
|
||||
},
|
||||
edit: function(e, t) {
|
||||
var n = this;
|
||||
this.titleText = "编辑", this.uiSchema.method = "put", this.uiSchema.formTemplate = e, this.uiSchema.url =
|
||||
this.titleText = "编辑", this.uiSchema.method = "post", this.uiSchema.formTemplate = e, this.uiSchema.url =
|
||||
this.urls.optPre + this.code, this.uiSchema = v({}, this.uiSchema), this.visible = !0, this.disableSubmit = !
|
||||
1, Object(i["c"])(this.urls.optPre + this.code + "/" + t).then((function(e) {
|
||||
if (e.success) {
|
||||
@@ -73614,7 +73614,7 @@
|
||||
},
|
||||
edit: function(e, t) {
|
||||
var n = this;
|
||||
this.titleText = "编辑", this.uiSchema.method = "put", this.uiSchema.formTemplate = e, this.uiSchema.url =
|
||||
this.titleText = "编辑", this.uiSchema.method = "post", this.uiSchema.formTemplate = e, this.uiSchema.url =
|
||||
this.url.optPre + this.code, this.uiSchema = c({}, this.uiSchema), this.visible = !0, this.disableSubmit = !
|
||||
1, Object(o["c"])(this.url.optPre + this.code + "/" + t).then((function(e) {
|
||||
if (e.success) {
|
||||
|
||||
@@ -40,7 +40,8 @@ export default {
|
||||
dict: 'sys_user,realname,username',
|
||||
params: {
|
||||
key: 'select_dict_search',
|
||||
type: JVXETypes.selectDictSearch
|
||||
type: JVXETypes.selectDictSearch,
|
||||
dict: 'sys_user,realname,username'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<div>
|
||||
<div>
|
||||
<a-button @click="clearCurrentCache(1)">清理表1缓存</a-button>
|
||||
<a-button @click="clearCurrentCache(2)">清理表2缓存</a-button>
|
||||
<a-button @click="clearJTableCache">清理全局缓存</a-button>
|
||||
</div>
|
||||
<j-table bordered
|
||||
:table-key="$route.name + '_table1'"
|
||||
ref='table1'
|
||||
rowKey='key'
|
||||
tableLayout='fixed'
|
||||
:scroll="{ x: 2000 }"
|
||||
:data-source="dataSource"
|
||||
:columns.sync="columns">
|
||||
|
||||
<span slot="action" slot-scope="{record}">
|
||||
<a-popconfirm
|
||||
v-if="dataSource.length"
|
||||
title="Sure to delete?"
|
||||
@confirm="() => onDelete(record.key)"
|
||||
>
|
||||
<a href="javascript:">Delete</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
|
||||
</j-table>
|
||||
|
||||
<j-table bordered
|
||||
:table-key="$route.name + '_table2'"
|
||||
ref='table2'
|
||||
rowKey='key'
|
||||
tableLayout='fixed'
|
||||
:scroll="{ x: 2000 }"
|
||||
:data-source="dataSource"
|
||||
:columns.sync="columns">
|
||||
|
||||
<span slot="action" slot-scope="{record}">
|
||||
<a-popconfirm
|
||||
v-if="dataSource.length"
|
||||
title="Sure to delete?"
|
||||
@confirm="() => onDelete(record.key)"
|
||||
>
|
||||
<a href="javascript:">Delete</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
|
||||
</j-table>
|
||||
</div>
|
||||
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JTable from '@comp/jero/JTable'
|
||||
|
||||
export default {
|
||||
name: 'JTableList',
|
||||
components: { JTable },
|
||||
data () {
|
||||
const columns = [
|
||||
{
|
||||
// 是否在配置表格中显示
|
||||
// hideSettingColumn: true,
|
||||
// 尽量要有minWidth,冻结列时会临时使用作为width
|
||||
minWidth: 100,
|
||||
// 禁用配置表格中的隐藏或冻结
|
||||
// disabledHide: true,
|
||||
// disabledFreeze: true,
|
||||
title: '#',
|
||||
ellipsis: true,
|
||||
dataIndex: 'key',
|
||||
fixed: true
|
||||
},
|
||||
{
|
||||
title: 'Date',
|
||||
dataIndex: 'date',
|
||||
minWidth: 200
|
||||
},
|
||||
{
|
||||
title: 'Amount',
|
||||
dataIndex: 'amount',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
title: 'Type',
|
||||
dataIndex: 'type',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
title: 'Note',
|
||||
dataIndex: 'note',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
title: 'Action',
|
||||
key: 'action',
|
||||
width: 200
|
||||
}
|
||||
]
|
||||
const dataSource = [
|
||||
{
|
||||
key: 0,
|
||||
date: '2018-02-11',
|
||||
amount: 120,
|
||||
type: 'income',
|
||||
note: 'transfer'
|
||||
},
|
||||
{
|
||||
key: 1,
|
||||
date: '2018-03-11',
|
||||
amount: 243,
|
||||
type: 'income',
|
||||
note: 'transfer'
|
||||
},
|
||||
{
|
||||
key: 2,
|
||||
date: '2018-04-11',
|
||||
amount: 98,
|
||||
type: 'income',
|
||||
note: 'transfer'
|
||||
}
|
||||
]
|
||||
return {
|
||||
columns,
|
||||
dataSource
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 清除当前表格缓存
|
||||
clearCurrentCache (n) {
|
||||
this.$refs['table' + n].clearSetting()
|
||||
},
|
||||
// 清除所有缓存
|
||||
clearJTableCache () {
|
||||
this.$refs.table1.clearAllCacheSetting()
|
||||
},
|
||||
onDelete (key) {
|
||||
this.$message.info(`del:${key}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user