提交数据
parent
4943051086
commit
df447b2439
|
@ -1,6 +1,10 @@
|
|||
package com.fate.firm.domain;
|
||||
|
||||
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 com.fate.common.core.annotation.Excel;
|
||||
import com.fate.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.Example;
|
||||
import lombok.*;
|
||||
|
@ -17,5 +21,15 @@ import lombok.*;
|
|||
@TableName("t_firm_type")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class FirmType extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "故障码类型ID",cellType = Excel.ColumnType.NUMERIC)
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer faultTypeId;
|
||||
|
||||
|
||||
@Excel(name = "故障码类型")
|
||||
@TableField("fault_type_name")
|
||||
private Integer faultTypeName;
|
||||
|
||||
}
|
||||
|
|
|
@ -2,10 +2,11 @@ package com.fate.firm.controller;
|
|||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.fate.common.datasource.annotation.Master;
|
||||
import com.fate.common.core.domain.Result;
|
||||
import com.fate.common.core.web.controller.BaseController;
|
||||
import com.fate.firm.domain.Firm;
|
||||
import com.fate.firm.domain.FirmType;
|
||||
import com.fate.firm.domain.request.FirmRequest;
|
||||
import com.fate.firm.service.FirmService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
@ -27,6 +28,7 @@ import java.util.List;
|
|||
@RestController
|
||||
@RequestMapping("/firm")
|
||||
@Log4j2
|
||||
@Master
|
||||
public class FirmController extends BaseController {
|
||||
@Autowired
|
||||
private FirmService firmService;
|
||||
|
@ -84,15 +86,24 @@ public class FirmController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询企业的信息
|
||||
* @author: ZhuoXin
|
||||
* @date: 2023/11/21 13:35
|
||||
* @param: [firmRequest]
|
||||
* @return: com.fate.common.core.domain.Result<java.util.List<com.fate.firm.domain.Firm>>
|
||||
**/
|
||||
@PostMapping("/list")
|
||||
public Result<List<Firm>> list(@RequestBody Firm firm) {
|
||||
List<Firm> list = firmService.listSel(firm);
|
||||
public Result<List<Firm>> list(@RequestBody FirmRequest firmRequest) {
|
||||
log.info("功能:查询企业的信息,URI:{},方法:{},参数:{}",request.getRequestURI(),request.getMethod(),JSON.toJSONString(firmRequest));
|
||||
List<Firm> list = firmService.listSel(Firm.addReqBuild(firmRequest));
|
||||
log.info("功能:查询企业的信息,URI:{},方法:{},参数:{}",request.getRequestURI(),request.getMethod(),JSON.toJSONString(list));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* 管理员查看所有企业
|
||||
* @author: ZhuoXin
|
||||
* @date: 2023/11/20 10:24
|
||||
* @param: []
|
||||
|
@ -101,9 +112,7 @@ public class FirmController extends BaseController {
|
|||
@GetMapping("/listAll")
|
||||
public Result<List<Firm>> listAll() {
|
||||
log.info("功能:查询我的公司,URI:{},方法:{}", request.getRequestURI(), request.getMethod());
|
||||
LambdaQueryWrapper<Firm> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(Firm::getCreateBy, "1");
|
||||
List<Firm> list = firmService.list(queryWrapper);
|
||||
List<Firm> list = firmService.list();
|
||||
log.info("功能:查询我的公司,URI:{},方法:{},响应:{}", request.getRequestURI(), request.getMethod(), JSON.toJSONString(list));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
@ -125,11 +134,5 @@ public class FirmController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package com.fate.firm.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.fate.common.core.domain.Result;
|
||||
import com.fate.common.core.web.controller.BaseController;
|
||||
import com.fate.firm.domain.FirmType;
|
||||
import com.fate.firm.service.FirmTypeService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author: SIKADI
|
||||
* @date: 2023/11/22 0:31
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/firmType")
|
||||
@Log4j2
|
||||
public class FirmTypeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private FirmTypeService firmTypeService;
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
/**
|
||||
* 企业类型的数据库
|
||||
* @author: ZhuoXin
|
||||
* @date: 2023/11/22 0:29
|
||||
* @param: []
|
||||
* @return: com.fate.common.core.domain.Result<java.util.List<com.fate.firm.domain.FirmType>>
|
||||
**/
|
||||
@GetMapping("/faultType")
|
||||
public Result<List<FirmType>> faultType(){
|
||||
log.info("功能:查询类型,URI:{},方法:{}",request.getRequestURI(),request.getMethod());
|
||||
List<FirmType> firmTypes = firmTypeService.list();
|
||||
log.info("功能:查询类型,URI:{},方法:{},响应:{}",request.getRequestURI(),request.getMethod(), JSON.toJSONString(firmTypes));
|
||||
return Result.success(firmTypes);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.fate.firm.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fate.common.datasource.annotation.Master;
|
||||
import com.fate.firm.domain.Firm;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
@ -13,13 +14,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
* @since 2023-11-18 06:27:02
|
||||
*/
|
||||
@Mapper
|
||||
@Master
|
||||
public interface FirmMapper extends BaseMapper<Firm> {
|
||||
/**
|
||||
* 修改状态
|
||||
* @author: ZhuoXin
|
||||
* @date: 2023/11/20 22:26
|
||||
* @param: [firm]
|
||||
* @return: java.lang.Integer
|
||||
**/
|
||||
Integer deleteFirm(Firm firm);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package com.fate.firm.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fate.firm.domain.FirmType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface FirmTypeMapper extends BaseMapper<FirmType> {
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.fate.firm.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fate.common.core.domain.Result;
|
||||
import com.fate.common.datasource.annotation.Master;
|
||||
import com.fate.firm.domain.Firm;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -14,7 +15,7 @@ import java.util.List;
|
|||
* @author sikadi
|
||||
* @since 2023-11-18 06:27:02
|
||||
*/
|
||||
|
||||
@Master
|
||||
public interface FirmService extends IService<Firm> {
|
||||
|
||||
/**
|
||||
|
@ -37,6 +38,13 @@ public interface FirmService extends IService<Firm> {
|
|||
**/
|
||||
Result updateFirm(Firm firm);
|
||||
|
||||
/**
|
||||
* 查询公司
|
||||
* @author: ZhuoXin
|
||||
* @date: 2023/11/21 13:45
|
||||
* @param: [firm]
|
||||
* @return: java.util.List<com.fate.firm.domain.Firm>
|
||||
**/
|
||||
List<Firm> listSel(Firm firm);
|
||||
|
||||
/**
|
||||
|
@ -57,4 +65,6 @@ public interface FirmService extends IService<Firm> {
|
|||
* @return: com.fate.common.core.domain.Result
|
||||
**/
|
||||
Result deleteFirm(Firm firm);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package com.fate.firm.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fate.firm.domain.FirmType;
|
||||
|
||||
public interface FirmTypeService extends IService<FirmType> {
|
||||
}
|
|
@ -4,11 +4,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fate.common.core.domain.Result;
|
||||
import com.fate.common.core.utils.StringUtils;
|
||||
import com.fate.common.datasource.annotation.Master;
|
||||
import com.fate.common.security.utils.SecurityUtils;
|
||||
import com.fate.common.system.domain.LoginUser;
|
||||
import com.fate.firm.domain.Firm;
|
||||
import com.fate.firm.domain.FirmType;
|
||||
import com.fate.firm.mapper.FirmMapper;
|
||||
import com.fate.firm.service.FirmService;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -22,6 +28,7 @@ import java.util.List;
|
|||
* @since 2023-11-18 06:27:02
|
||||
*/
|
||||
@Service
|
||||
@Master
|
||||
public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements FirmService {
|
||||
|
||||
@Autowired
|
||||
|
@ -56,6 +63,14 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
|
|||
return i > 0 ? Result.success("成功") : Result.error("失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员查询
|
||||
* @author: ZhuoXin
|
||||
* @date: 2023/11/21 13:45
|
||||
* @param: [firm]
|
||||
* @return: java.util.List<com.fate.firm.domain.Firm>
|
||||
**/
|
||||
|
||||
@Override
|
||||
public List<Firm> listSel(Firm firm) {
|
||||
LambdaQueryWrapper<Firm> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
@ -89,7 +104,11 @@ public class FirmServiceImpl extends ServiceImpl<FirmMapper, Firm> implements Fi
|
|||
**/
|
||||
@Override
|
||||
public Result deleteFirm(Firm firm) {
|
||||
Integer integer = firmMapper.deleteFirm(firm);
|
||||
Integer integer = firmMapper.deleteById(firm);
|
||||
return integer>0?Result.success("成功"):Result.error("失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package com.fate.firm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fate.firm.domain.FirmType;
|
||||
import com.fate.firm.mapper.FirmTypeMapper;
|
||||
import com.fate.firm.service.FirmService;
|
||||
import com.fate.firm.service.FirmTypeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author: SIKADI
|
||||
* @date: 2023/11/22 0:32
|
||||
**/
|
||||
@Service
|
||||
public class FirmTypeServiceImpl extends ServiceImpl<FirmTypeMapper,FirmType> implements FirmTypeService {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fate.firm.mapper.FirmTypeMapper">
|
||||
|
||||
|
||||
</mapper>
|
|
@ -2,9 +2,4 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fate.firm.mapper.FirmMapper">
|
||||
|
||||
<delete id="deleteFirm">
|
||||
delete
|
||||
from t_firm
|
||||
where firm_id = #{firmId};
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue