|
@@ -41,10 +41,10 @@ public class MaintenanceOptionController {
|
|
|
public RestResponse list(@RequestBody OptionReq req) {
|
|
|
IPage<MaintenanceOption> page = optionService.page(
|
|
|
new Page<>(req.getPageNum(), req.getPageSize()), new QueryWrapper<MaintenanceOption>()
|
|
|
- //0L是固定数据的公司id
|
|
|
- .in("mt_company_id", 0L, req.getMtCompanyId())
|
|
|
+ //10086L是固定数据的公司id
|
|
|
+ .in("mt_company_id", 10086L, req.getMtCompanyId())
|
|
|
.in(req.getType() != null, "type", type(req))
|
|
|
- .eq(req.getLiftType() != null, "lift_type", req.getLiftType())
|
|
|
+ .eq(req.getLiftCategory() != null, "lift_category", req.getLiftCategory())
|
|
|
.orderByDesc("mt_company_id")
|
|
|
);
|
|
|
if (page.getRecords().isEmpty()) {
|
|
@@ -61,17 +61,18 @@ public class MaintenanceOptionController {
|
|
|
*/
|
|
|
@PostMapping("/options")
|
|
|
public RestResponse options(@RequestBody OptionReq req) {
|
|
|
- Integer liftType = req.getLiftType();
|
|
|
+ Integer liftType = req.getLiftCategory();
|
|
|
String sort = null;
|
|
|
if (liftType.equals(3)) {
|
|
|
sort = "-1,1";
|
|
|
}
|
|
|
List<MaintenanceOption> options = optionService.list(
|
|
|
new QueryWrapper<MaintenanceOption>()
|
|
|
- //0L是固定数据的公司id
|
|
|
- .in("mt_company_id", 0L, req.getMtCompanyId())
|
|
|
+ //10086L是固定数据的公司id
|
|
|
+ .in("mt_company_id", 10086L, req.getMtCompanyId())
|
|
|
.in(req.getType() != null, "type", type(req))
|
|
|
- .eq(req.getLiftType() != null, "lift_type", req.getLiftType())
|
|
|
+ .eq(req.getLiftCategory() != null, "lift_category", req.getLiftCategory())
|
|
|
+ .eq(req.getStatus() != null, "status", req.getStatus())
|
|
|
.in(sort != null, "sort", sort)
|
|
|
);
|
|
|
if (options.isEmpty()) {
|
|
@@ -81,10 +82,10 @@ public class MaintenanceOptionController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 新增维保项
|
|
|
+ *
|
|
|
* @param option 维保项信息
|
|
|
* @return RestResponse
|
|
|
- * @description 新增维保项
|
|
|
- * @date 2019/12/19 9:20
|
|
|
*/
|
|
|
@PostMapping("/add")
|
|
|
public RestResponse add(@RequestBody MaintenanceOption option) {
|
|
@@ -102,8 +103,8 @@ public class MaintenanceOptionController {
|
|
|
*/
|
|
|
@PostMapping("/modify")
|
|
|
public RestResponse modify(@RequestBody MaintenanceOption option) {
|
|
|
- //0L是固定数据的公司id
|
|
|
- if (option.getMtCompanyId().equals(0L)) {
|
|
|
+ //10086L是固定数据的公司id
|
|
|
+ if (option.getMtCompanyId().equals(10086L)) {
|
|
|
return RestResponse.fail("默认维保项无法编辑");
|
|
|
}
|
|
|
if (optionService.updateById(option)) {
|
|
@@ -116,12 +117,11 @@ public class MaintenanceOptionController {
|
|
|
* @param option 维保项id
|
|
|
* @return RestResponse
|
|
|
* @description 判断是否是默认维保项,不是默认的维保项才可以删除
|
|
|
- * @date 2019/12/19 9:20
|
|
|
*/
|
|
|
@PostMapping("/delete")
|
|
|
public RestResponse delete(@RequestBody MaintenanceOption option) {
|
|
|
- //10086是平台的团队id
|
|
|
- if (option.getMtCompanyId().equals(0L)) {
|
|
|
+ //10086L是平台的团队id
|
|
|
+ if (option.getMtCompanyId().equals(10086L)) {
|
|
|
return RestResponse.fail("默认维保项无法删除");
|
|
|
}
|
|
|
if (optionService.removeById(option.getId())) {
|