master
parent
e93d04f20b
commit
19911a64c2
@ -0,0 +1,103 @@
|
||||
package com.dsic.gj_erp.bean.sy;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门表
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="DmDepart对象", description="部门表")
|
||||
public class DmDepart implements Serializable{
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@TableId(value = "depart_code", type = IdType.INPUT)
|
||||
private String departCode;
|
||||
|
||||
private String departName;
|
||||
|
||||
private String parentCode;
|
||||
|
||||
@ApiModelProperty(value = "单位全称")
|
||||
private String departFullname;
|
||||
|
||||
private String sortNo;
|
||||
|
||||
@ApiModelProperty(value = "单位属性")
|
||||
private String departAttr;
|
||||
|
||||
@ApiModelProperty(value = "单位类型")
|
||||
private String departType;
|
||||
|
||||
@ApiModelProperty(value = "生产性质")
|
||||
private String manuType;
|
||||
|
||||
@ApiModelProperty(value = "状态 1-有效(默认) 0-无效")
|
||||
private Integer departStatus;
|
||||
|
||||
@ApiModelProperty(value = "制作标识 1-选择 0-未选择(默认)")
|
||||
private Integer manuFlag;
|
||||
|
||||
@ApiModelProperty(value = "表面处理标识 1-选择 0-未选择(默认)")
|
||||
private Integer paintFlag;
|
||||
|
||||
@ApiModelProperty(value = "配送标识 1-选择 0-未选择(默认)")
|
||||
private Integer distFlag;
|
||||
|
||||
@ApiModelProperty(value = "水压标识 1-选择 0-未选择(默认)")
|
||||
private Integer syFlag;
|
||||
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private String charger;
|
||||
|
||||
@ApiModelProperty(value = "座机电话")
|
||||
private String landlinePhone;
|
||||
|
||||
@ApiModelProperty(value = "移动电话")
|
||||
private String mobilePhone;
|
||||
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "配送单位2022.2.8")
|
||||
private String psDept;
|
||||
|
||||
@ApiModelProperty(value = "涂装单位2022.2.8")
|
||||
private String tzDept;
|
||||
|
||||
@ApiModelProperty(value = "涂装单位2022.2.8")
|
||||
private String clDept;
|
||||
|
||||
@ApiModelProperty(value = "非包显示2022.2.8")
|
||||
private String fbxs;
|
||||
|
||||
@ApiModelProperty(value = "大包显示2022.2.8")
|
||||
private String dbxs;
|
||||
|
||||
@ApiModelProperty(value = "小包显示2022.2.8")
|
||||
private String xbxs;
|
||||
|
||||
//铁舾排序
|
||||
@TableField("sort_3")
|
||||
private String sort3;//结构排序
|
||||
@TableField("sort_4")
|
||||
private String sort4;//涂装排序
|
||||
@TableField("sort_5")
|
||||
private String sort5;//镀锌排序
|
||||
@TableField("sort_6")
|
||||
private String sort6;//配送排序
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.dsic.gj_erp.bean.sy;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @version V1.0.0
|
||||
* @Title: DmDepartIn
|
||||
* @Package com.dsic.xzerp.bean.sy
|
||||
* @Description: 单位部门入参
|
||||
* @author: 张恩铭
|
||||
* @date: 2021/5/12 11:03
|
||||
*/
|
||||
@Data
|
||||
public class DmDepartIn implements Serializable {
|
||||
|
||||
private String departCode;
|
||||
private String departAttr;
|
||||
private String departType;
|
||||
private String manuType;
|
||||
private String manuFlag;
|
||||
private String bmbm;
|
||||
private String zxtbm;
|
||||
private String parentCode;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.dsic.gj_erp.bean.sy;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @version V1.0.0
|
||||
* @Title: DmEmployee
|
||||
* @Package com.dsic.xzerp.bean.sy
|
||||
* @Description: 管系制造员工
|
||||
* @author: 张恩铭
|
||||
* @date: 2021/4/1 15:49
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("管系制造员工")
|
||||
public class DmEmployee implements Serializable {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("部门科室编码")
|
||||
private String departCode;
|
||||
|
||||
@ApiModelProperty("职号")
|
||||
private String employeeNo;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String employeeName;
|
||||
|
||||
@ApiModelProperty("性别")
|
||||
private String gender;
|
||||
|
||||
@ApiModelProperty("在职状态")
|
||||
private Integer employeeStatus;
|
||||
|
||||
@ApiModelProperty("岗位")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty("责任区域")
|
||||
private String zone;//责任区域对应字典ZRQY 1:船装;2:机装;3:局装
|
||||
|
||||
@ApiModelProperty("职称")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("座机电话")
|
||||
private String landlinePhone;
|
||||
|
||||
@ApiModelProperty("移动电话")
|
||||
private String mobilePhone;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.dsic.gj_erp.bean.sy;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 管系系统数据
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="DmPipeSystem对象", description="管系系统数据")
|
||||
public class DmPipeSystem implements Serializable {
|
||||
|
||||
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "工程编号 Q11")
|
||||
private String project;
|
||||
|
||||
@ApiModelProperty(value = "所属部门 默认02")
|
||||
private String departCode;
|
||||
|
||||
//@Dict(dictCode = "test_code")
|
||||
@ApiModelProperty(value = "系统代号 Q12")
|
||||
private String stCode;
|
||||
|
||||
@ApiModelProperty(value = "系统名称 Q21")
|
||||
private String stName;
|
||||
|
||||
@ApiModelProperty(value = "四大系统标识 默认N")
|
||||
private String stFlag;
|
||||
|
||||
@ApiModelProperty(value = "系统英文名称")
|
||||
private String stEname;
|
||||
|
||||
private String stDwgno;
|
||||
|
||||
private String bzry;
|
||||
|
||||
private String bzrq;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String jjCode;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.dsic.gj_erp.bean.sy;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="SyDict对象", description="")
|
||||
@Accessors(chain = true)
|
||||
public class SyDict {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "字典编码")
|
||||
// @TableId(value = "dict_code", type = IdType.ASSIGN_UUID)
|
||||
@TableId
|
||||
private String dictCode;
|
||||
|
||||
@ApiModelProperty(value = "字典名称")
|
||||
private String dictName;
|
||||
|
||||
@ApiModelProperty(value = "子系统")
|
||||
private String systemCode;
|
||||
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.dsic.gj_erp.bean.sy;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.dsic.gj_erp.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="SyDictItem对象", description="")
|
||||
public class SyDictItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
@Dict(dictTable ="sy_dict",dictText = "dict_name",dictCode = "dict_code")
|
||||
@ApiModelProperty(value = "字典编码")
|
||||
private String dictCode;
|
||||
|
||||
@ApiModelProperty(value = "字典项文本")
|
||||
private String itemCode;
|
||||
|
||||
@ApiModelProperty(value = "字典项值")
|
||||
private String itemValue;
|
||||
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "排序")
|
||||
private String sortNo;
|
||||
|
||||
private String params1;
|
||||
|
||||
private String params2;
|
||||
|
||||
private String params3;
|
||||
|
||||
private String params4;
|
||||
|
||||
private String params5;
|
||||
|
||||
private String ylzd5;//铁舾油漆旧消耗系数
|
||||
private String yqxs1;//铁舾油漆新消耗系数
|
||||
|
||||
//集团切块
|
||||
private String jtqk;
|
||||
|
||||
//舾装切块
|
||||
private String xzqk;
|
||||
|
||||
//统计类型
|
||||
private String tjlx;
|
||||
|
||||
//工艺类型
|
||||
private String gylx;
|
||||
|
||||
//分析类型1
|
||||
private String fxlx1;
|
||||
|
||||
//分析类型2
|
||||
private String fxlx2;
|
||||
|
||||
//gj下 管径范围>=
|
||||
private BigDecimal params6;
|
||||
//gj下管径范围<=
|
||||
private BigDecimal params7;
|
||||
//gj下消耗系数
|
||||
private BigDecimal params8;
|
||||
//gj下附件消耗系数
|
||||
private BigDecimal params9;
|
||||
//gj下限额消耗系数
|
||||
private BigDecimal params10;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.dsic.gj_erp.bean.sy;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import com.dsic.gj_erp.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志表
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-04-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="SyLog对象", description="系统日志表")
|
||||
public class SyLog extends Model<SyLog> {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "职号")
|
||||
private String userCode;
|
||||
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String userName;
|
||||
|
||||
@Dict(dictTable ="sy_system",dictText = "system_name",dictCode = "system_code")
|
||||
@ApiModelProperty(value = "子系统编码")
|
||||
private String systemCode;
|
||||
|
||||
@ApiModelProperty(value = "子系统名称")
|
||||
private String systemName;
|
||||
|
||||
@ApiModelProperty(value = "使用内容:模块>子模块>菜单名称")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "方法")
|
||||
private String method;
|
||||
|
||||
@ApiModelProperty(value = "计算机名")
|
||||
private String computerName;
|
||||
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(value = "使用日期时间")
|
||||
private String createTime;
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.dsic.gj_erp.bean.tree;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version V1.0.0
|
||||
* @Title: ProjectTreeVo
|
||||
* @Package com.dsic.xzerp.bean.tree
|
||||
* @Description: tree
|
||||
* @author: xhj
|
||||
* @date: 2021/3/15 13:18
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PhTreeVo {
|
||||
private String id;
|
||||
private String parentBm;
|
||||
private String label;
|
||||
private String departCode;
|
||||
private String status;
|
||||
|
||||
private String lckStatus;
|
||||
private String dwgNo;
|
||||
private String dwgType;
|
||||
private String bzry;
|
||||
private List<PhTreeVo> children;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.dsic.gj_erp.bean.tree;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version V1.0.0
|
||||
* @Title: ProjectTreeVo
|
||||
* @Package com.dsic.xzerp.bean.tree
|
||||
* @Description: tree
|
||||
* @author: xhj
|
||||
* @date: 2021/3/15 13:18
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProjectTreeVo {
|
||||
private String id;
|
||||
private String parentBm;
|
||||
private String label;
|
||||
private List<ProjectTreeVo> children;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.dsic.gj_erp.bean.tree;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version V1.0.0
|
||||
* @Title: ProjectTreeVo
|
||||
* @Package com.dsic.xzerp.bean.tree
|
||||
* @Description: tree
|
||||
* @author: xhj
|
||||
* @date: 2021/3/15 13:18
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class Tree {
|
||||
private String id;
|
||||
private String parentBm;
|
||||
private String parentValue;
|
||||
private String label;
|
||||
private List<Tree> children;
|
||||
private String value;
|
||||
|
||||
private String level;
|
||||
|
||||
private String params;
|
||||
// private String lckId;
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.dsic.gj_erp.controller.sy;
|
||||
|
||||
|
||||
import com.dsic.gj_erp.annotation.AuthFunction;
|
||||
import com.dsic.gj_erp.bean.ResultBean;
|
||||
import com.dsic.gj_erp.bean.sy.DmDepart;
|
||||
import com.dsic.gj_erp.bean.sy.DmDepartIn;
|
||||
import com.dsic.gj_erp.service.sy.DmDepartService;
|
||||
import io.swagger.annotations.Authorization;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/sy/depart")
|
||||
public class DmDepartController1 {
|
||||
|
||||
@Resource
|
||||
private DmDepartService dmDepartService;
|
||||
|
||||
/**
|
||||
* 无参获取全部部门
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getall")
|
||||
public ResultBean<List<DmDepart>> getAll(){
|
||||
return new ResultBean<List<DmDepart>>(this.dmDepartService.getAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询部门及其子部门
|
||||
* @param dmDepart
|
||||
* @return
|
||||
*/
|
||||
@AuthFunction
|
||||
@PostMapping("/getcon")
|
||||
public ResultBean<List<DmDepart>> getByCondition(@RequestBody DmDepart dmDepart){
|
||||
return new ResultBean<List<DmDepart>>(this.dmDepartService.getByCondition(dmDepart));
|
||||
}
|
||||
|
||||
@AuthFunction
|
||||
@PostMapping("/getcondefault")
|
||||
public ResultBean<List<DmDepart>> getByConditionDefaultDepartCode(@RequestBody DmDepartIn dmDepart){
|
||||
return new ResultBean<List<DmDepart>>(this.dmDepartService.getByConditionDefaultDepartCode(dmDepart));
|
||||
}
|
||||
|
||||
@AuthFunction
|
||||
@PostMapping("/getallparent")
|
||||
public ResultBean<List<DmDepart>> getAllParent(){
|
||||
return new ResultBean<>(this.dmDepartService.getAllParent());
|
||||
}
|
||||
|
||||
@AuthFunction
|
||||
@PostMapping("/getallchildren")
|
||||
public ResultBean<List<DmDepart>> getAllChildren(){
|
||||
return new ResultBean<>(this.dmDepartService.getAllChildren());
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title
|
||||
* @Description //根据参数不同查询部门
|
||||
* @author xcs
|
||||
* @updateAuthor xcs
|
||||
* @Date 2021/5/12 10:26
|
||||
* @version v1.0.0
|
||||
* @exception
|
||||
* @throws
|
||||
* @return
|
||||
**/
|
||||
@ResponseBody
|
||||
@RequestMapping("/selectall")
|
||||
public ResultBean<List<DmDepart>> selectall(@RequestBody String[] map){
|
||||
// System.out.println(map+"打印一下这个东西");
|
||||
List<String> ids = Arrays.asList(map);
|
||||
return this.dmDepartService.selectDepartQuery(ids);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,45 @@
|
||||
package com.dsic.gj_erp.controller.sy;
|
||||
|
||||
|
||||
import com.dsic.gj_erp.bean.ResultBean;
|
||||
import com.dsic.gj_erp.bean.sy.DmEmployee;
|
||||
import com.dsic.gj_erp.service.sy.DmEmployeeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version V1.0.0
|
||||
* @Title: DmEmployeeController
|
||||
* @Package com.dsic.xzerp.controller.sy
|
||||
* @Description: 管系制造员工查询专用controller
|
||||
* @author: 张恩铭
|
||||
* @date: 2021/4/2 9:06
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "管系制造员工查询专用controller")
|
||||
@RequestMapping("/api/sy/ygcx")
|
||||
public class DmEmployeeController1 {
|
||||
|
||||
@Resource
|
||||
private DmEmployeeService dmEmployeeService;
|
||||
|
||||
@PostMapping("/getcon")
|
||||
@ApiOperation("无like条件查询")
|
||||
public ResultBean<List<DmEmployee>> getByCon(@RequestBody DmEmployee dmEmployee){
|
||||
return new ResultBean<List<DmEmployee>>(this.dmEmployeeService.getByCondition(dmEmployee));
|
||||
}
|
||||
|
||||
@PostMapping("/getcondefault")
|
||||
@ApiOperation("特定like条件查询")
|
||||
public ResultBean<List<DmEmployee>> getByConDefaultDeptCode(@RequestBody DmEmployee dmEmployee){
|
||||
return new ResultBean<>(this.dmEmployeeService.getByConditionDefaultDepartCode(dmEmployee));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.dsic.gj_erp.controller.sy;
|
||||
|
||||
|
||||
import com.dsic.gj_erp.bean.ResultBean;
|
||||
import com.dsic.gj_erp.service.sy.SyDictService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/api/sy/dict")
|
||||
public class SyDictController {
|
||||
@Autowired
|
||||
SyDictService syDictService;
|
||||
|
||||
|
||||
@PostMapping(value = "/getTreeList")
|
||||
public ResultBean getTreeList(@RequestBody Map<String, Object> params) {
|
||||
return new ResultBean( syDictService.getTreeList(params));
|
||||
|
||||
}
|
||||
|
||||
@PostMapping(value = "/getTxTreeList")
|
||||
public ResultBean getTxTreeList(@RequestBody Map<String, Object> params) {
|
||||
return new ResultBean( syDictService.getTxTreeList(params));
|
||||
|
||||
}
|
||||
|
||||
@PostMapping(value = "/getTreeListForQKFL")
|
||||
public ResultBean getTreeListForQKFL(@RequestBody Map<String, Object> params) {
|
||||
return new ResultBean( syDictService.getTreeListForQKFL(params));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,91 @@
|
||||
package com.dsic.gj_erp.controller.sy;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.dsic.gj_erp.bean.ResultBean;
|
||||
import com.dsic.gj_erp.bean.sy.SyDictItem;
|
||||
import com.dsic.gj_erp.service.sy.SyDictItemService;
|
||||
import com.dsic.gj_erp.util.CacheConstant;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/api/sy/dict")
|
||||
public class SyDictItemController {
|
||||
|
||||
@Resource
|
||||
SyDictItemService syDictItemService;
|
||||
|
||||
@PostMapping(value = "/getList")
|
||||
public ResultBean getList(@RequestBody Map<String, Object> params) {
|
||||
QueryWrapper<SyDictItem> queryWrapper = new QueryWrapper<SyDictItem>();
|
||||
if (!StringUtils.isBlank((String)params.get("name"))){
|
||||
queryWrapper.eq("dict_code",params.get("name"));
|
||||
}
|
||||
return new ResultBean(syDictItemService.list(queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取以dictCode分组的字典数据
|
||||
*/
|
||||
@GetMapping("mapList")
|
||||
public ResultBean<?> mapList(){
|
||||
List<SyDictItem> list=syDictItemService.list();
|
||||
Map<String,List<SyDictItem>> map=list.stream()
|
||||
.collect(Collectors.groupingBy(SyDictItem::getDictCode));
|
||||
return new ResultBean<>(map);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/add")
|
||||
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public ResultBean getList(@RequestBody List<SyDictItem> syDictItem) {
|
||||
return new ResultBean(syDictItemService.saveBatch(syDictItem));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/del")
|
||||
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public ResultBean del(@RequestBody List<String> delArr) {
|
||||
syDictItemService.removeByIds(delArr);
|
||||
return new ResultBean();
|
||||
}
|
||||
|
||||
@PostMapping(value = "/update")
|
||||
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public ResultBean update(@RequestBody List<SyDictItem> syDictItem) {
|
||||
syDictItemService.updateBatchById(syDictItem);
|
||||
return new ResultBean();
|
||||
}
|
||||
|
||||
@PostMapping("/getbycode")
|
||||
public ResultBean getByCode(@RequestBody SyDictItem syDictItem){
|
||||
return new ResultBean(this.syDictItemService.getByCode(syDictItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据dictCode查询,itemCode右模糊查询
|
||||
*/
|
||||
@PostMapping("/getByDictCodeWithItemCodeRightLike")
|
||||
public ResultBean getByDictCodeWithItemCodeRightLike(@RequestBody SyDictItem syDictItem){
|
||||
List<SyDictItem> list=this.syDictItemService.list(new QueryWrapper<SyDictItem>()
|
||||
.eq("dict_code",syDictItem.getDictCode())
|
||||
.likeRight("item_code",syDictItem.getItemCode()));
|
||||
return new ResultBean(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,100 @@
|
||||
package com.dsic.gj_erp.controller.sy;
|
||||
|
||||
|
||||
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.dsic.gj_erp.annotation.AuthFunction;
|
||||
import com.dsic.gj_erp.bean.ResultBean;
|
||||
import com.dsic.gj_erp.bean.sy.DmPipeSystem;
|
||||
import com.dsic.gj_erp.bean.sy.SyLog;
|
||||
import com.dsic.gj_erp.service.sy.SyLogService;
|
||||
import com.dsic.gj_erp.util.IPUtils;
|
||||
import io.swagger.annotations.Authorization;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-04-08
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/api/sy/syLog")
|
||||
public class SyLogController {
|
||||
|
||||
@Autowired
|
||||
SyLogService syLogService;
|
||||
|
||||
@AuthFunction
|
||||
@PostMapping(value = "/add")
|
||||
public ResultBean getList(HttpServletRequest httpRequest , @RequestBody SyLog syLog) {
|
||||
|
||||
syLog.setIp(IPUtils.getIpAddr(httpRequest));
|
||||
syLog.setComputerName(System.getenv().get("USERNAME"));
|
||||
syLog.setUserCode((String) httpRequest.getAttribute("yhdm"));
|
||||
syLog.setUserName((String) httpRequest.getAttribute("username"));
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");//设置日期格式
|
||||
syLog.setCreateTime(df.format(new Date()));
|
||||
syLogService.save(syLog);
|
||||
return new ResultBean();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getList")
|
||||
public ResultBean getList(@RequestBody Map<String, Object> paramMap){
|
||||
IPage<SyLog> page = new Page<>((Integer)paramMap.get("pageNo"), (Integer)paramMap.get("pageSize"));
|
||||
QueryWrapper qw = new QueryWrapper<DmPipeSystem>();
|
||||
|
||||
Map syLog = (Map)paramMap.get("syLog");
|
||||
qw.orderByDesc("create_time");
|
||||
if (!StringUtils.isBlank((String)syLog.get("userName"))){
|
||||
qw.like("user_name",syLog.get("userName"));
|
||||
|
||||
}
|
||||
if (!StringUtils.isBlank((String)syLog.get("systemCode"))){
|
||||
qw.like("system_code",syLog.get("systemCode"));
|
||||
|
||||
}
|
||||
if (!StringUtils.isBlank((String)syLog.get("content"))){
|
||||
qw.like("content",syLog.get("content"));
|
||||
//qw.apply("left(content,2)=2");
|
||||
}
|
||||
if (!StringUtils.isBlank((String)syLog.get("ks"))){
|
||||
qw.apply("left(create_time,10)>='"+syLog.get("ks")+"'");
|
||||
}
|
||||
if (!StringUtils.isBlank((String)syLog.get("js"))){
|
||||
qw.apply("left(create_time,10)<='"+syLog.get("js")+"'");
|
||||
}
|
||||
|
||||
// List list = syLogService.list(qw);
|
||||
IPage<SyLog> page1 = syLogService.page(page, qw);
|
||||
|
||||
|
||||
// System.out.println(page1);
|
||||
return new ResultBean(page1);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/del")
|
||||
public ResultBean del(@RequestBody List<String> delArr) {
|
||||
syLogService.removeByIds(delArr);
|
||||
return new ResultBean();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.dsic.gj_erp.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dsic.gj_erp.bean.sy.DmDepart;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface DmDepartMapper extends BaseMapper<DmDepart> {
|
||||
@Select(value = {"<script>"
|
||||
+ "select depart_code,depart_name from dm_depart "
|
||||
+ " where depart_code in "
|
||||
+ "<foreach collection='ids' item='id' open='(' separator=',' close=')'>"
|
||||
+"#{id}"
|
||||
+"</foreach>"
|
||||
+ "</script>"})
|
||||
List<DmDepart> selectDepartQuery (@Param("ids") List<String> ids);
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.dsic.gj_erp.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dsic.gj_erp.bean.sy.DmEmployee;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @version V1.0.0
|
||||
* @Title: DmEmployeeMapper
|
||||
* @Package com.dsic.xzerp.dao.sy
|
||||
* @Description: 管系制造员工mapper
|
||||
* @author: 张恩铭
|
||||
* @date: 2021/4/2 9:01
|
||||
*/
|
||||
@Mapper
|
||||
public interface DmEmployeeMapper extends BaseMapper<DmEmployee> {
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.dsic.gj_erp.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dsic.gj_erp.bean.sy.SyDictItem;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-16
|
||||
*/
|
||||
@Mapper
|
||||
public interface SyDictItemMapper extends BaseMapper<SyDictItem> {
|
||||
|
||||
|
||||
String queryTableDictTextByKey(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("key") String key);
|
||||
String queryTableDictTextByKeySys(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("key") String key,@Param("code1") String code1, @Param("key1") String key1);
|
||||
String queryDictTextByKey(@Param("code") String code,@Param("key") String key);
|
||||
|
||||
@MapKey("itemCode")
|
||||
Map<String,SyDictItem> getCodeToMap(String dictCode);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.dsic.gj_erp.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dsic.gj_erp.bean.sy.SyDict;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface SyDictMapper extends BaseMapper<SyDict> {
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.dsic.gj_erp.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dsic.gj_erp.bean.sy.SyLog;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-04-08
|
||||
*/
|
||||
public interface SyLogMapper extends BaseMapper<SyLog> {
|
||||
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.dsic.gj_erp.service;
|
||||
|
||||
public interface MyCacheInterface {
|
||||
void refreshRedis();
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.dsic.gj_erp.service.cache;
|
||||
|
||||
public interface RedisCacheKeyConfig {
|
||||
//船只信息缓存,对应DmProject
|
||||
String PROJECT_KEY="ZX_ERP::PROJECT";
|
||||
|
||||
//部门缓存
|
||||
String DEPT_KEY="ZX_ERP::DEPT";
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
package com.dsic.gj_erp.service.cache;
|
||||
//缓存读取
|
@ -0,0 +1,30 @@
|
||||
package com.dsic.gj_erp.service.sy;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dsic.gj_erp.bean.ResultBean;
|
||||
import com.dsic.gj_erp.bean.sy.DmDepart;
|
||||
import com.dsic.gj_erp.bean.sy.DmDepartIn;
|
||||
import com.dsic.gj_erp.service.MyCacheInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-23
|
||||
*/
|
||||
public interface DmDepartService extends IService<DmDepart>, MyCacheInterface {
|
||||
List<DmDepart> getAll();
|
||||
List<DmDepart> getByCondition(DmDepart dmDepart);
|
||||
List<DmDepart> getByConditionDefaultDepartCode(DmDepartIn dmDepart);
|
||||
List<DmDepart> getAllParent();
|
||||
List<DmDepart> getAllChildren();
|
||||
ResultBean<Integer> addDepart(DmDepart[] dmDeparts);
|
||||
ResultBean<Integer> updateDepart(DmDepart[] dmDeparts);
|
||||
ResultBean<Integer> delDepart(DmDepart[] dmDeparts);
|
||||
ResultBean<List<DmDepart>> selectDepartQuery (List<String> params);
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.dsic.gj_erp.service.sy;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dsic.gj_erp.bean.ResultBean;
|
||||
import com.dsic.gj_erp.bean.sy.DmEmployee;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version V1.0.0
|
||||
* @Title: DmEmployeeService
|
||||
* @Package com.dsic.xzerp.service.sy
|
||||
* @Description: 管系制造员工service
|
||||
* @author: 张恩铭
|
||||
* @date: 2021/4/2 9:04
|
||||
*/
|
||||
public interface DmEmployeeService extends IService<DmEmployee> {
|
||||
List<DmEmployee> getAll();
|
||||
List<DmEmployee> getByCondition(DmEmployee dmEmployee);
|
||||
List<DmEmployee> getByConditionDefaultDepartCode(DmEmployee dmEmployee);
|
||||
ResultBean<Integer> addEmployee(DmEmployee[] dmEmployees);
|
||||
ResultBean<Integer> updateEmployee(DmEmployee[] dmEmployees);
|
||||
ResultBean<Integer> delEmployee(DmEmployee[] dmEmployees);
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.dsic.gj_erp.service.sy;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dsic.gj_erp.bean.sy.SyDictItem;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-16
|
||||
*/
|
||||
|
||||
public interface SyDictItemService extends IService<SyDictItem> {
|
||||
|
||||
public String translateDictFromTable(String table, String text, String code, String key);
|
||||
public String translateDict(String code, String key);
|
||||
public String translateDictFromTableByKey(String table, String text, String code, String key,String code1, String key1);
|
||||
public List<SyDictItem> getByCode(SyDictItem syDictItem);
|
||||
public List<Map<String, Object>> getCodeByString(String code);
|
||||
|
||||
public Map<String,SyDictItem> getCodeToMap(String dictCode);
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.dsic.gj_erp.service.sy;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dsic.gj_erp.bean.sy.SyDict;
|
||||
import com.dsic.gj_erp.bean.tree.ProjectTreeVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-15
|
||||
*/
|
||||
|
||||
public interface SyDictService extends IService<SyDict> {
|
||||
|
||||
public List<ProjectTreeVo> getTreeList(Map<String, Object> params);
|
||||
public List<ProjectTreeVo> getTxTreeList(Map<String, Object> params);
|
||||
public List<ProjectTreeVo> getTreeListForQKFL(Map<String, Object> params);
|
||||
|
||||
//public Map getBase(Map map);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.dsic.gj_erp.service.sy;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dsic.gj_erp.bean.sy.SyLog;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-04-08
|
||||
*/
|
||||
public interface SyLogService extends IService<SyLog> {
|
||||
|
||||
}
|
@ -0,0 +1,240 @@
|
||||
package com.dsic.gj_erp.service.sy.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dsic.gj_erp.bean.ResultBean;
|
||||
import com.dsic.gj_erp.bean.sy.DmDepart;
|
||||
import com.dsic.gj_erp.bean.sy.DmDepartIn;
|
||||
import com.dsic.gj_erp.mapper.DmDepartMapper;
|
||||
import com.dsic.gj_erp.service.cache.RedisCacheKeyConfig;
|
||||
import com.dsic.gj_erp.service.sy.DmDepartService;
|
||||
import com.dsic.gj_erp.util.ConditionSelect;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 部门表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-23
|
||||
*/
|
||||
@Service
|
||||
public class DmDepartServiceImpl extends ServiceImpl<DmDepartMapper, DmDepart> implements DmDepartService {
|
||||
|
||||
@Resource
|
||||
private DmDepartMapper dmDepartMapper;
|
||||
|
||||
private HashMap<String, String> departBm = new HashMap<String, String>(){{
|
||||
put("DY", "03");
|
||||
put("GJ", "02");
|
||||
put("TX", "01");
|
||||
put("QC", "06");
|
||||
}};
|
||||
|
||||
/**
|
||||
* 无参查询所有部门
|
||||
* @author 张恩铭
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DmDepart> getAll() {
|
||||
return this.dmDepartMapper.selectList(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门号条件查询部门及其子部门
|
||||
* @author 张恩铭
|
||||
* @param dmDepart
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DmDepart> getByCondition(DmDepart dmDepart) {
|
||||
ConditionSelect<DmDepart> conditionSelect = new ConditionSelect<>(dmDepart, new QueryWrapper<>(), dmDepartMapper);
|
||||
return conditionSelect.getResultByLikeRight();
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门号模糊查询其他条件指定查询
|
||||
* @param dmDepart
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DmDepart> getByConditionDefaultDepartCode(DmDepartIn dmDepart) {
|
||||
// System.out.println(dmDepart);
|
||||
// VoToEntity<DmDepartIn, DmDepart> voToEntity = new VoToEntity<>(dmDepart, new DmDepart());
|
||||
// DmDepart eneity = voToEntity.getEneity();
|
||||
// boolean flag = false;
|
||||
// if(dmDepart.getDepartCode().length() >= 2){
|
||||
// for (String key : departBm.keySet()) {
|
||||
// if (dmDepart.getZxtbm().equals(key)){
|
||||
// flag = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if (flag){
|
||||
// return getByCondition(eneity);
|
||||
// }else{
|
||||
// eneity.setDepartCode(departBm.get(dmDepart.getZxtbm()));
|
||||
// return getByCondition(eneity);
|
||||
// }
|
||||
// }else {
|
||||
// eneity.setDepartCode(departBm.get(dmDepart.getZxtbm()));
|
||||
// return getByCondition(eneity);
|
||||
// }
|
||||
QueryWrapper<DmDepart> qw =new QueryWrapper<>();
|
||||
qw.eq("parent_code",dmDepart.getParentCode());
|
||||
if(StringUtils.isNotBlank(dmDepart.getDepartCode())){
|
||||
qw.eq("depart_code",dmDepart.getDepartCode());
|
||||
}
|
||||
if(StringUtils.isNotBlank(dmDepart.getDepartCode())){
|
||||
qw.eq("depart_code",dmDepart.getDepartCode());
|
||||
}
|
||||
if(StringUtils.isNotBlank(dmDepart.getManuType())){
|
||||
qw.eq("manu_type",dmDepart.getManuType());
|
||||
}
|
||||
if(StringUtils.isNotBlank(dmDepart.getDepartType())){
|
||||
qw.eq("depart_type",dmDepart.getDepartType());
|
||||
}
|
||||
if(StringUtils.isNotBlank(dmDepart.getDepartAttr())){
|
||||
qw.eq("depart_attr",dmDepart.getDepartAttr());
|
||||
}
|
||||
qw.eq(StrUtil.isNotEmpty(dmDepart.getManuFlag()),"manu_flag",dmDepart.getManuFlag());
|
||||
return this.list(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有主部门
|
||||
* @author 张恩铭
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DmDepart> getAllParent() {
|
||||
List<DmDepart> result = new ArrayList<>();
|
||||
List<DmDepart> temp = this.getAll();
|
||||
for (DmDepart d : temp) {
|
||||
if(d.getDepartCode().length() == 2){
|
||||
result.add(d);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有子部门
|
||||
* @author 张恩铭
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DmDepart> getAllChildren() {
|
||||
List<DmDepart> result = new ArrayList<>();
|
||||
List<DmDepart> temp = this.getAll();
|
||||
for (DmDepart d : temp) {
|
||||
if(d.getDepartCode().length() > 2){
|
||||
result.add(d);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加部门
|
||||
* @author 张恩铭
|
||||
* @param dmDeparts
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<Integer> addDepart(DmDepart[] dmDeparts) {
|
||||
int i = 0;
|
||||
for (DmDepart d : dmDeparts) {
|
||||
if(d.getDepartCode() == null || d.getDepartCode().equals("")){
|
||||
continue;
|
||||
}else{
|
||||
DmDepart temp = new DmDepart();
|
||||
temp.setDepartCode(d.getDepartCode());
|
||||
ConditionSelect<DmDepart> conditionSelect = new ConditionSelect<>(temp, new QueryWrapper<>(), this.dmDepartMapper);
|
||||
if(conditionSelect.getResult().size() > 0){
|
||||
continue;
|
||||
}else{
|
||||
if(this.dmDepartMapper.insert(d) == 1) i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
ResultBean<Integer> resultBean = new ResultBean<>();
|
||||
resultBean.setData(i);
|
||||
return resultBean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改部门
|
||||
* @author 张恩铭
|
||||
* @param dmDeparts
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<Integer> updateDepart(DmDepart[] dmDeparts) {
|
||||
int i = 0;
|
||||
for (DmDepart d : dmDeparts) {
|
||||
if(d.getDepartCode() == null || d.getDepartCode().equals("")){
|
||||
continue;
|
||||
}else{
|
||||
DmDepart temp = new DmDepart();
|
||||
temp.setDepartCode(d.getDepartCode());
|
||||
ConditionSelect<DmDepart> conditionSelect = new ConditionSelect<>(temp, new QueryWrapper<>(), this.dmDepartMapper);
|
||||
List<DmDepart> result = conditionSelect.getResult();
|
||||
if(result.size() > 0 && !result.get(0).getDepartCode().equals(d.getDepartCode())){
|
||||
continue;
|
||||
}else{
|
||||
if(this.dmDepartMapper.updateById(d) == 1) i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
ResultBean<Integer> resultBean = new ResultBean<>();
|
||||
resultBean.setData(i);
|
||||
return resultBean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
* @author 张恩铭
|
||||
* @param dmDeparts
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<Integer> delDepart(DmDepart[] dmDeparts) {
|
||||
int i = 0;
|
||||
for (DmDepart d : dmDeparts) {
|
||||
if(this.dmDepartMapper.deleteById(d) == 1) i++;
|
||||
}
|
||||
ResultBean<Integer> resultBean = new ResultBean<>();
|
||||
resultBean.setData(i);
|
||||
return resultBean;
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean<List<DmDepart>> selectDepartQuery( List<String> params) {
|
||||
ResultBean<List<DmDepart>> resultBean = new ResultBean<List<DmDepart>>();
|
||||
resultBean.setData(dmDepartMapper.selectDepartQuery(params));
|
||||
return resultBean;
|
||||
|
||||
}
|
||||
|
||||
@Resource
|
||||
RedisTemplate<String ,Object> redisTemplate;
|
||||
@Override
|
||||
public void refreshRedis() {
|
||||
List<DmDepart> list=this.list();
|
||||
list.forEach(l->redisTemplate.opsForHash().put(RedisCacheKeyConfig.DEPT_KEY,l.getDepartCode(),l));
|
||||
}
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package com.dsic.gj_erp.service.sy.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dsic.gj_erp.bean.ResultBean;
|
||||
import com.dsic.gj_erp.bean.sy.DmEmployee;
|
||||
import com.dsic.gj_erp.mapper.DmEmployeeMapper;
|
||||
import com.dsic.gj_erp.service.sy.DmEmployeeService;
|
||||
import com.dsic.gj_erp.util.ConditionSelect;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version V1.0.0
|
||||
* @Title: DmEmployeeServiceImpl
|
||||
* @Package com.dsic.xzerp.service.sy.impl
|
||||
* @Description: 管系制造员工service实现类
|
||||
* @author: 张恩铭
|
||||
* @date: 2021/4/2 9:05
|
||||
*/
|
||||
@Service
|
||||
public class DmEmployeeServiceImpl extends ServiceImpl<DmEmployeeMapper, DmEmployee> implements DmEmployeeService {
|
||||
|
||||
@Resource
|
||||
private DmEmployeeMapper dmEmployeeMapper;
|
||||
|
||||
private ResultBean resultBean;
|
||||
|
||||
/**
|
||||
* 查询所有
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DmEmployee> getAll() {
|
||||
return this.dmEmployeeMapper.selectList(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 非like不定条件查询
|
||||
* @param dmEmployee
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DmEmployee> getByCondition(DmEmployee dmEmployee) {
|
||||
ConditionSelect<DmEmployee> conditionSelect = new ConditionSelect<>(dmEmployee, new QueryWrapper<>(), this.dmEmployeeMapper);
|
||||
return conditionSelect.getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* 特定like不定条件查询
|
||||
* @param dmEmployee
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DmEmployee> getByConditionDefaultDepartCode(DmEmployee dmEmployee) {
|
||||
String[] strings = {"departCode"};
|
||||
ConditionSelect<DmEmployee> conditionSelect = new ConditionSelect<>(dmEmployee, new QueryWrapper<>(), this.dmEmployeeMapper, strings);
|
||||
return conditionSelect.getResultBySomeLikeRight();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加员工
|
||||
* @param dmEmployees
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultBean<Integer> addEmployee(DmEmployee[] dmEmployees) {
|
||||
int i = 0;
|
||||
for (DmEmployee d : dmEmployees) {
|
||||
|
||||
this.dmEmployeeMapper.insert(d) ;
|
||||
}
|
||||
resultBean = new ResultBean<Integer>();
|
||||
|
||||
return resultBean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工
|
||||
* @param dmEmployees
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<Integer> updateEmployee(DmEmployee[] dmEmployees) {
|
||||
int i = 0;
|
||||
for (DmEmployee d : dmEmployees) {
|
||||
if(this.dmEmployeeMapper.updateById(d) == 1) i++;
|
||||
// if(d.getDepartCode() == null){
|
||||
// continue;
|
||||
// }else{
|
||||
// if(d.getDepartCode().length() == 2){
|
||||
// if(d.getEmployeeNo().substring(0, 2).equals(d.getDepartCode())){
|
||||
// if(this.dmEmployeeMapper.updateById(d) == 1) i++;
|
||||
// }else{
|
||||
// continue;
|
||||
// }
|
||||
// }else if(d.getDepartCode().length() == 4){
|
||||
// if(d.getEmployeeNo().substring(0, 4).equals(d.getDepartCode())){
|
||||
// if(this.dmEmployeeMapper.updateById(d) == 1) i++;
|
||||
// }else{
|
||||
// continue;
|
||||
// }
|
||||
// }else{
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
resultBean = new ResultBean<Integer>();
|
||||
resultBean.setData(i);
|
||||
return resultBean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工
|
||||
* @param dmEmployees
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<Integer> delEmployee(DmEmployee[] dmEmployees) {
|
||||
int i = 0;
|
||||
for (DmEmployee d : dmEmployees) {
|
||||
if(this.dmEmployeeMapper.deleteById(d) == 1) i++;
|
||||
}
|
||||
resultBean = new ResultBean<Integer>();
|
||||
resultBean.setData(i);
|
||||
return resultBean;
|
||||
}
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package com.dsic.gj_erp.service.sy.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dsic.gj_erp.bean.sy.SyDict;
|
||||
import com.dsic.gj_erp.bean.tree.ProjectTreeVo;
|
||||
import com.dsic.gj_erp.mapper.SyDictMapper;
|
||||
import com.dsic.gj_erp.service.sy.SyDictService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-03-15
|
||||
*/
|
||||
@Service
|
||||
public class SyDictServiceImpl extends ServiceImpl<SyDictMapper, SyDict> implements SyDictService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<ProjectTreeVo> getTreeList(Map<String, Object> params) {
|
||||
QueryWrapper<SyDict> queryWrapper = new QueryWrapper<SyDict>();
|
||||
if (!StringUtils.isBlank((String)params.get("name"))){
|
||||
queryWrapper.and(wp->wp.like("dict_code",params.get("name")).or().like("dict_name",params.get("name")));
|
||||
}
|
||||
List<SyDict> list = this.list(queryWrapper);
|
||||
//父级
|
||||
List<ProjectTreeVo> vo= new ArrayList<>();
|
||||
ProjectTreeVo projectTreeVo =new ProjectTreeVo();
|
||||
//子级
|
||||
List<ProjectTreeVo> projectTreeVoList = new ArrayList<>();
|
||||
|
||||
list.stream().forEach(e->{
|
||||
ProjectTreeVo tree=new ProjectTreeVo();
|
||||
tree.setId(e.getDictCode());
|
||||
tree.setLabel(e.getDictName());
|
||||
tree.setParentBm("@@@");
|
||||
projectTreeVoList.add(tree);
|
||||
});
|
||||
projectTreeVo.setId("@@@").setLabel("编码类别").setChildren(projectTreeVoList);
|
||||
vo.add(projectTreeVo);
|
||||
return vo;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectTreeVo> getTxTreeList(Map<String, Object> params) {
|
||||
QueryWrapper<SyDict> queryWrapper = new QueryWrapper<SyDict>();
|
||||
|
||||
queryWrapper.eq(StringUtils.isNotBlank((String)params.get("code")),"system_code",params.get("code"));
|
||||
if(StringUtils.isNotBlank((String)params.get("name"))){
|
||||
queryWrapper.and(wp->wp.like("dict_code",params.get("name")).or().like("dict_name",params.get("name")));
|
||||
}
|
||||
List<SyDict> list = this.list(queryWrapper);
|
||||
//父级
|
||||
List<ProjectTreeVo> vo= new ArrayList<>();
|
||||
ProjectTreeVo projectTreeVo =new ProjectTreeVo();
|
||||
//子级
|
||||
List<ProjectTreeVo> projectTreeVoList = new ArrayList<>();
|
||||
|
||||
list.stream().forEach(e->{
|
||||
ProjectTreeVo tree=new ProjectTreeVo();
|
||||
tree.setId(e.getDictCode());
|
||||
tree.setLabel(e.getDictName()+"["+e.getDictCode()+"]");
|
||||
tree.setParentBm("@@@");
|
||||
projectTreeVoList.add(tree);
|
||||
});
|
||||
projectTreeVo.setId("@@@").setLabel("编码类别").setChildren(projectTreeVoList);
|
||||
vo.add(projectTreeVo);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectTreeVo> getTreeListForQKFL(Map<String, Object> params) {
|
||||
QueryWrapper<SyDict> queryWrapper = new QueryWrapper<SyDict>();
|
||||
|
||||
queryWrapper.eq(StringUtils.isNotBlank((String)params.get("code")),"system_code",params.get("code"))
|
||||
.in("dict_name","集团切块","舾装切块");
|
||||
|
||||
if(StringUtils.isNotBlank((String)params.get("name"))){
|
||||
queryWrapper.and(wp->wp.like("dict_code",params.get("name")).or().like("dict_name",params.get("name")));
|
||||
}
|
||||
List<SyDict> list = this.list(queryWrapper);
|
||||
//父级
|
||||
List<ProjectTreeVo> vo= new ArrayList<>();
|
||||
ProjectTreeVo projectTreeVo =new ProjectTreeVo();
|
||||
//子级
|
||||
List<ProjectTreeVo> projectTreeVoList = new ArrayList<>();
|
||||
|
||||
list.stream().forEach(e->{
|
||||
ProjectTreeVo tree=new ProjectTreeVo();
|
||||
tree.setId(e.getDictCode());
|
||||
tree.setLabel(e.getDictName());
|
||||
tree.setParentBm("@@@");
|
||||
projectTreeVoList.add(tree);
|
||||
});
|
||||
projectTreeVo.setId("@@@").setLabel("编码类别").setChildren(projectTreeVoList);
|
||||
vo.add(projectTreeVo);
|
||||
return vo;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.dsic.gj_erp.service.sy.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dsic.gj_erp.bean.sy.SyLog;
|
||||
import com.dsic.gj_erp.mapper.SyLogMapper;
|
||||
import com.dsic.gj_erp.service.sy.SyLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统日志表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author xhj
|
||||
* @since 2021-04-08
|
||||
*/
|
||||
@Service
|
||||
public class SyLogServiceImpl extends ServiceImpl<SyLogMapper, SyLog> implements SyLogService {
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.dsic.gj_erp.util;
|
||||
|
||||
/**
|
||||
* @author: huangxutao
|
||||
* @date: 2019-06-14
|
||||
* @description: 缓存常量
|
||||
*/
|
||||
public interface CacheConstant {
|
||||
|
||||
/**
|
||||
* 字典信息缓存
|
||||
*/
|
||||
public static final String SYS_DICT_CACHE = "sys:cache:dict";
|
||||
/**
|
||||
* 表字典信息缓存
|
||||
*/
|
||||
public static final String SYS_DICT_TABLE_CACHE = "sys:cache:dictTable";
|
||||
|
||||
public static final String SYS_DICT_TABLE_BY_KEYS_CACHE = SYS_DICT_TABLE_CACHE + "ByKeys";
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
package com.dsic.gj_erp.util;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version V1.0.0
|
||||
* @Title: ConditionSelect
|
||||
* @Package com.dsic.xzerp.bean
|
||||
* @Description: 条件查询
|
||||
* @author: 张恩铭
|
||||
* @date: 2021/3/16 11:28
|
||||
*/
|
||||
public class ConditionSelect<T> implements Serializable {
|
||||
|
||||
private T entity;
|
||||
private QueryWrapper<T> queryWrapper;
|
||||
private BaseMapper<T> baseMapper;
|
||||
private String[] likeAttrs;
|
||||
|
||||
public ConditionSelect(T data, QueryWrapper<T> queryWrapper, BaseMapper<T> baseMapper){
|
||||
this.entity = data;
|
||||
this.queryWrapper = queryWrapper;
|
||||
this.baseMapper = baseMapper;
|
||||
}
|
||||
|
||||
public ConditionSelect(T data, QueryWrapper<T> queryWrapper, BaseMapper<T> baseMapper, String[] likeAttrs){
|
||||
this.entity = data;
|
||||
this.queryWrapper = queryWrapper;
|
||||
this.baseMapper = baseMapper;
|
||||
this.likeAttrs = likeAttrs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 无like不定条件查询
|
||||
* @return java.util.List
|
||||
*/
|
||||
public List<T> getResult(){
|
||||
try{
|
||||
Field[] fields = entity.getClass().getDeclaredFields();
|
||||
|
||||
for (Field f:fields) {
|
||||
if (f.getAnnotation(TableField.class)!=null&&!f.getAnnotation(TableField.class).exist()){
|
||||
continue;
|
||||
}
|
||||
f.setAccessible(true);
|
||||
if (!f.getName().equals("serialVersionUID")){
|
||||
if(f.get(entity) != null && f.get(entity) != "" && f.get(entity).toString().toLowerCase() != "null"){
|
||||
char[] chars = f.getName().toCharArray();
|
||||
String temp_s = "";
|
||||
for (int i = 0; i < chars.length; i++){
|
||||
if(chars[i] >= 'A' && chars[i] <= 'Z'){
|
||||
String temp_ss = String.valueOf(chars[i]);
|
||||
temp_s = temp_s + "_" + temp_ss.toLowerCase();
|
||||
}else{
|
||||
temp_s += chars[i];
|
||||
}
|
||||
}
|
||||
queryWrapper.eq(temp_s, f.get(entity));
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
List<T> list = this.baseMapper.selectList(this.queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 只有like不定条件查询
|
||||
* @return java.util.List
|
||||
*/
|
||||
public List<T> getResultByLikeRight(){
|
||||
try{
|
||||
Field[] fields = entity.getClass().getDeclaredFields();
|
||||
for (Field f:fields) {
|
||||
f.setAccessible(true);
|
||||
if (!f.getName().equals("serialVersionUID")){
|
||||
if(f.get(entity) != null && f.get(entity) != "" && f.get(entity).toString().toLowerCase() != "null"){
|
||||
char[] chars = f.getName().toCharArray();
|
||||
String temp_s = "";
|
||||
for (int i = 0; i < chars.length; i++){
|
||||
if(chars[i] >= 'A' && chars[i] <= 'Z'){
|
||||
String temp_ss = String.valueOf(chars[i]);
|
||||
temp_s = temp_s + "_" + temp_ss.toLowerCase();
|
||||
}else{
|
||||
temp_s += chars[i];
|
||||
}
|
||||
}
|
||||
queryWrapper.likeRight(temp_s, f.get(entity));
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
List<T> list = this.baseMapper.selectList(this.queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 特定like不定条件查询
|
||||
* @return java.util.List
|
||||
*/
|
||||
public List<T> getResultBySomeLikeRight(){
|
||||
boolean flag = false;
|
||||
try {
|
||||
Field[] fields = entity.getClass().getDeclaredFields();
|
||||
for (Field f:fields) {
|
||||
f.setAccessible(true);
|
||||
if (!f.getName().equals("serialVersionUID")){
|
||||
if(f.get(entity) != null && f.get(entity) != "" && f.get(entity).toString().toLowerCase() != "null"){
|
||||
for (String like_string: likeAttrs) {
|
||||
if(like_string.equals(f.getName())){
|
||||
flag = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
char[] chars = f.getName().toCharArray();
|
||||
String temp_s = "";
|
||||
for (int i = 0; i < chars.length; i++){
|
||||
if(chars[i] >= 'A' && chars[i] <= 'Z'){
|
||||
String temp_ss = String.valueOf(chars[i]);
|
||||
temp_s = temp_s + "_" + temp_ss.toLowerCase();
|
||||
}else{
|
||||
temp_s += chars[i];
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
queryWrapper.eq(temp_s, f.get(entity));
|
||||
}else{
|
||||
queryWrapper.likeRight(temp_s, f.get(entity));
|
||||
}
|
||||
}
|
||||
}
|
||||
flag = false;
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
List<T> list = this.baseMapper.selectList(this.queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<?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.dsic.gj_erp.mapper.DmDepartMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.dsic.gj_erp.bean.sy.DmDepart">
|
||||
<id column="depart_code" property="departCode" />
|
||||
<result column="depart_name" property="departName" />
|
||||
<result column="parent_code" property="parentCode" />
|
||||
<result column="depart_fullname" property="departFullname" />
|
||||
<result column="sort_no" property="sortNo" />
|
||||
<result column="depart_attr" property="departAttr" />
|
||||
<result column="depart_type" property="departType" />
|
||||
<result column="manu_type" property="manuType" />
|
||||
<result column="depart_status" property="departStatus" />
|
||||
<result column="manu_flag" property="manuFlag" />
|
||||
<result column="paint_flag" property="paintFlag" />
|
||||
<result column="dist_flag" property="distFlag" />
|
||||
<result column="charger" property="charger" />
|
||||
<result column="landline_phone" property="landlinePhone" />
|
||||
<result column="mobile_phone" property="mobilePhone" />
|
||||
<result column="remark" property="remark" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
depart_code, depart_name, parent_code, depart_fullname, sort_no, depart_attr, depart_type, manu_type, depart_status, manu_flag, paint_flag, dist_flag, charger, landline_phone, mobile_phone, remark
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,49 @@
|
||||
<?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.dsic.gj_erp.mapper.SyDictItemMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.dsic.gj_erp.bean.sy.SyDictItem">
|
||||
<id column="id" property="id" />
|
||||
<result column="dict_code" property="dictCode" />
|
||||
<result column="item_code" property="itemCode" />
|
||||
<result column="item_value" property="itemValue" />
|
||||
<result column="remark" property="remark" />
|
||||
<result column="sort_no" property="sortNo" />
|
||||
<result column="params1" property="params1" />
|
||||
<result column="params2" property="params2" />
|
||||
<result column="params3" property="params3" />
|
||||
<result column="params4" property="params4" />
|
||||
<result column="params5" property="params5" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, dict_code, item_code, item_value, remark, sort_no, params1, params2, params3, params4, params5
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- my -->
|
||||
<select id="queryTableDictTextByKey" parameterType="String" resultType="String">
|
||||
select ${text} as "text" from ${table} where ${code}= #{key}
|
||||
</select>
|
||||
|
||||
<select id="queryTableDictTextByKeySys" parameterType="String" resultType="String">
|
||||
select ${text} as "text" from ${table} where ${code}= #{key} and ${code1}= #{key1}
|
||||
</select>
|
||||
|
||||
<select id="queryDictTextByKey" parameterType="String" resultType="String">
|
||||
select s.item_value from sy_dict_item s
|
||||
where s.dict_code = #{code}
|
||||
and s.item_code = #{key}
|
||||
</select>
|
||||
<select id="getCodeToMap" resultType="com.dsic.gj_erp.bean.sy.SyDictItem">
|
||||
select
|
||||
item_code as itemCode ,item_value as itemValue
|
||||
from
|
||||
sy_dict_item
|
||||
where
|
||||
dict_code=#{dictCode}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,18 @@
|
||||
<?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.dsic.gj_erp.mapper.SyDictMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.dsic.gj_erp.bean.sy.SyDict">
|
||||
<id column="dict_code" property="dictCode" />
|
||||
<result column="dict_name" property="dictName" />
|
||||
<result column="system_code" property="systemCode" />
|
||||
<result column="remark" property="remark" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
dict_code, dict_name, system_code, remark
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
<?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.dsic.gj_erp.mapper.SyLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.dsic.gj_erp.bean.sy.SyLog">
|
||||
<id column="id" property="id" />
|
||||
<result column="user_code" property="userCode" />
|
||||
<result column="user_name" property="userName" />
|
||||
<result column="system_code" property="systemCode" />
|
||||
<result column="system_name" property="systemName" />
|
||||
<result column="content" property="content" />
|
||||
<result column="method" property="method" />
|
||||
<result column="computer_name" property="computerName" />
|
||||
<result column="ip" property="ip" />
|
||||
<result column="create_time" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_code, user_name, system_code, system_name, content, method, computer_name, ip, create_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
Loading…
Reference in new issue