xiaoning 1 year ago
parent e4b2daa758
commit f50b9ed225

@ -42,7 +42,7 @@ public class DmXbjh implements Serializable {
private String yf;
@ApiModelProperty(value = "重量")
private Double zl;
private Double zl=0.0;
@ApiModelProperty(value = "有效年份")
private String yxnf;

@ -1,6 +1,7 @@
package com.dsic.gj_erp.bean.sy;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -19,6 +20,7 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="SyDict对象", description="")
@Accessors(chain = true)
@TableName("DM_ZHBMLBP")
public class SyDict {
private static final long serialVersionUID=1L;
@ -26,16 +28,19 @@ public class SyDict {
@ApiModelProperty(value = "字典编码")
// @TableId(value = "dict_code", type = IdType.ASSIGN_UUID)
@TableId
private String dictCode;
private String bmlb;
@ApiModelProperty(value = "字典名称")
private String dictName;
private String lbmc;
@ApiModelProperty(value = "子系统")
private String systemCode;
private String zxtbm;
private String bmcd;
@ApiModelProperty(value = "描述")
private String remark;

@ -2,7 +2,9 @@ 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 com.baomidou.mybatisplus.annotation.TableName;
import com.dsic.gj_erp.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -23,74 +25,28 @@ import java.math.BigDecimal;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="SyDictItem对象", description="")
@TableName("DM_ZHBMP")
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 = "字典编码")
@TableId("bmlb")
private String dictCode;
@ApiModelProperty(value = "字典项文本")
@TableField("bmsm")
private String itemCode;
@ApiModelProperty(value = "字典项值")
@TableField("bm")
private String itemValue;
@ApiModelProperty(value = "描述")
private String remark;
@ApiModelProperty(value = "排序")
@TableField("bm")
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;
}

@ -1,30 +0,0 @@
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;
}

@ -1,30 +0,0 @@
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;
}

@ -1,9 +1,12 @@
package com.dsic.gj_erp.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSONObject;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jhgk.DmQfxq;
import com.dsic.gj_erp.bean.sy.*;
import com.dsic.gj_erp.service.sy.SYService;
import io.swagger.annotations.Api;
@ -69,7 +72,7 @@ public class SYController {
@ApiImplicitParam(name = "gwdm", value = "工作组代码", required = false, paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "sort", value = "排序方式", required = false, paramType = "query", dataType = "Integer" ,defaultValue = "0"),
})
@AuthFunction(CKDMS = {"w_gzzdy", "w_yhdy"})
@AuthFunction(CKDMS = {"w_gzzdy", "Yhgl"})
@RequestMapping(value = "/getUserList")
public ResultBean getUserList(@RequestBody Map<String, Object> paramMap) {
String gwdm = (String) paramMap.get("gwdm");
@ -99,8 +102,8 @@ public class SYController {
@ApiOperation(value = "更新用户信息")
@RequestMapping(value = "/updateUser")
public ResultBean updateUser(@RequestBody Syuserp[] syuserp) {
syService.updateUser(syuserp[0], syuserp[1]);
public ResultBean updateUser(@RequestBody Syuserp syuserp) {
syService.updateUser(syuserp);
return new ResultBean();
}
@ -273,31 +276,23 @@ public class SYController {
List<Map> dmZhbmp= syService.em_sbjbb_ZM(bmlb);
return new ResultBean(dmZhbmp);
}
// ----------------------------------------------------------------
@RequestMapping(value = "/getDepartList")
public ResultBean getDepartList() {
return new ResultBean(syService.getDepartList());
@RequestMapping(value = "/getSystemList")
public ResultBean getSystemList(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getSystemList());
}
@RequestMapping(value = "/addRole")
public ResultBean addRole(@RequestBody Map role) {
return new ResultBean(syService.addRole(role));
@RequestMapping(value = "/getMenuList")
public ResultBean getMenuList(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getMenuList());
}
@RequestMapping(value = "/deleteRole")
public ResultBean deleteRole(@RequestBody Map paramMap) {
return new ResultBean(syService.deleteRole((String) paramMap.get("role_code")));
@RequestMapping(value = "/getUserListByMenu")
public ResultBean getUserListByMenu(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getUserListByMenu(paramMap));
}
@RequestMapping(value = "/updateRole")
public ResultBean updateRole(@RequestBody Map role) {
return new ResultBean(syService.updateRole(role));
@RequestMapping(value = "/getDepartList")
public ResultBean getDepartList() {
return new ResultBean(syService.getDepartList());
}
@RequestMapping(value = "/getRoleList")
@ -305,10 +300,9 @@ public class SYController {
return new ResultBean(syService.getRoleList());
}
@RequestMapping(value = "/getRoleListByUser")
public ResultBean getRoleListByUser(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getRoleListByUser((String) paramMap.get("user_code")));
return new ResultBean(syService.getRoleListByUser((String) paramMap.get("yhdm")));
}
@RequestMapping(value = "/addRoleForUser")
@ -323,94 +317,28 @@ public class SYController {
return new ResultBean();
}
@RequestMapping(value = "/getSystemList")
public ResultBean getSystemList(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getSystemList());
}
@RequestMapping(value = "/getMenuList")
public ResultBean getMenuList(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getMenuList());
}
@RequestMapping(value = "/getUserListByMenu")
public ResultBean getUserListByMenu(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getUserListByMenu(Integer.parseInt(paramMap.get("id").toString())));
}
@RequestMapping(value = "/getInstitutionList")
public ResultBean getInstitutionList(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getInstitutionList());
}
@RequestMapping(value = "/getUserListByRole")
public ResultBean getUserListByRole(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getUserListByRole(paramMap.get("role_code").toString()));
}
@RequestMapping(value = "/addRoleForInstitution")
public ResultBean addRoleForInstitution(@RequestBody List<Map<String, Object>> paramList) {
syService.addRoleForInstitution(paramList);
return new ResultBean();
}
@RequestMapping(value = "/deleteRoleForInstitution")
public ResultBean deleteRoleForInstitution(@RequestBody List<Map<String, Object>> paramList) {
syService.deleteRoleForInstitution(paramList);
return new ResultBean();
}
@RequestMapping(value = "/getInstitutionListByRole")
public ResultBean getInstitutionListByRole(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getInstitutionListByRole(paramMap.get("role_code").toString()));
}
@RequestMapping(value = "/getSystemListByRole")
public ResultBean getSystemListByRole(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getSystemListByRole(paramMap.get("role_code").toString()));
}
@RequestMapping(value = "/addRoleForSystem")
public ResultBean addRoleForSystem(@RequestBody List<Map<String, Object>> paramList) {
syService.addRoleForSystem(paramList);
return new ResultBean();
}
@RequestMapping(value = "/deleteRoleForSystem")
public ResultBean deleteRoleForSystem(@RequestBody List<Map<String, Object>> paramList) {
syService.deleteRoleForSystem(paramList);
return new ResultBean();
}
@RequestMapping(value = "/getMenuListByRole")
public ResultBean getMenuListByRole(@RequestBody Map<String, Object> paramMap) {
return new ResultBean(syService.getMenuListByRole(paramMap.get("role_code").toString()));
}
@RequestMapping(value = "/addRoleForMenu")
public ResultBean addRoleForMenu(@RequestBody List<Map<String, Object>> paramList) {
syService.addRoleForMenu(paramList);
return new ResultBean();
}
@RequestMapping(value = "/deleteRoleForMenu")
public ResultBean deleteRoleForMenu(@RequestBody List<Map<String, Object>> paramList) {
syService.deleteRoleForMenu(paramList);
return new ResultBean();
}
}

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jcsj.EmGcrl;
import com.dsic.gj_erp.bean.jcsj.EmSbcnp;
import com.dsic.gj_erp.bean.jhgk.DmDhqdp;
import com.dsic.gj_erp.bean.jhgk.DmQfxq;
@ -17,6 +18,7 @@ import com.dsic.gj_erp.bean.jhgk.excel.SyExcel;
import com.dsic.gj_erp.exception.CustomException;
import com.dsic.gj_erp.listeners.ExcelQFListener;
import com.dsic.gj_erp.listeners.ExcelSYListener;
import com.dsic.gj_erp.service.jcsj.EmGcrlService;
import com.dsic.gj_erp.service.jhgk.DmSygdService;
import com.dsic.gj_erp.service.sy.SYService;
import io.swagger.annotations.ApiOperation;
@ -26,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -44,16 +47,27 @@ public class DmSygdController {
@Resource
DmSygdService service;
@Autowired
private EmGcrlService gcrlService;
@RequestMapping("/getList")
@AuthFunction
public ResultBean getList(@RequestBody DmSygd sygd){
List<DmSygd> list= service.list(new QueryWrapper<DmSygd>()
.eq("gd_zt",sygd.getGdZt())
.ge(StrUtil.isNotEmpty(sygd.getBeginTime()),"sl_sj",sygd.getBeginTime())
.le(StrUtil.isNotEmpty(sygd.getEndTime()),"sl_sj",sygd.getEndTime())
.eq(StrUtil.isNotEmpty(sygd.getGdZt()),"gd_zt",sygd.getGdZt())
.ge(StrUtil.isNotEmpty(sygd.getBeginTime()),"gjjs_xz",sygd.getBeginTime())
.le(StrUtil.isNotEmpty(sygd.getEndTime()),"gjjs_xz",sygd.getEndTime())
.orderByAsc("sl_sj,dc_ch,dc_pl")
);
return new ResultBean(list);
Map map=new HashMap();
if (list.size()>0){
String beginTime=list.get(0).getGjjsXz();
String endTime=list.get(list.size()-1).getGjjsXz();
List<EmGcrl> emGcrls= gcrlService.list(new QueryWrapper<EmGcrl>().select("gl").between("gl",beginTime,endTime).eq("xxr","0"));
List<String> gcrl = emGcrls.stream().map(EmGcrl::getGl).collect(Collectors.toList());
map.put("gcrl",gcrl);
}
map.put("list",list);
return new ResultBean(map);
}
@PostMapping("/upload")

@ -7,10 +7,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jcsj.DmCzplpNew;
import com.dsic.gj_erp.bean.jcsj.EmGcrl;
import com.dsic.gj_erp.bean.jcsj.EmSbcnp;
import com.dsic.gj_erp.bean.jcsj.EmSbjbb;
import com.dsic.gj_erp.bean.jhgk.DmQfxq;
import com.dsic.gj_erp.bean.jhgk.DmSygd;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.service.jcsj.EmGcrlService;
import com.dsic.gj_erp.service.jcsj.EmSbcnpService;
import com.dsic.gj_erp.service.jhgk.DmSygdMxService;
import com.dsic.gj_erp.service.sy.SYService;
@ -42,6 +45,9 @@ public class DmSygdMxController {
@Autowired
private EmSbcnpService emSbcnpService;
@Autowired
private EmGcrlService gcrlService;
@PostMapping("cgjhdhqk")
public ResultBean<?> cgjhdhqk(@RequestBody Map<String,Object> map){
return new ResultBean<>(service.cgjhdhqk(map));
@ -55,10 +61,19 @@ public class DmSygdMxController {
.eq(StrUtil.isNotEmpty(sygd.getDcPl()),"dc_pl",sygd.getDcPl())
.ge(StrUtil.isNotEmpty(sygd.getBeginTime()),"jssj",sygd.getBeginTime())
.le(StrUtil.isNotEmpty(sygd.getEndTime()),"jssj",
sygd.getEndTime())
DateUtil.endOfMonth(DateUtil.parseDate(sygd.getEndTime())).toString("yyyy/MM/dd"))
.orderByAsc("jssj,dc_ch,dc_pl")
);
return new ResultBean(list);
Map map=new HashMap();
if (list.size()>0){
String beginTime=list.get(0).getJssj();
String endTime=list.get(list.size()-1).getJssj();
List<EmGcrl> emGcrls= gcrlService.list(new QueryWrapper<EmGcrl>().select("gl").between("gl",beginTime,endTime).eq("xxr","0"));
List<String> gcrl = emGcrls.stream().map(EmGcrl::getGl).collect(Collectors.toList());
map.put("gcrl",gcrl);
}
map.put("list",list);
return new ResultBean(map);
}
@RequestMapping("/saveByDcch")
@ -87,6 +102,7 @@ public class DmSygdMxController {
// map.put("dhList",service.getDhList(list));
return new ResultBean(map);
}
@RequestMapping("/getCnsb")
@AuthFunction
public ResultBean getCnsb(){
@ -110,7 +126,7 @@ public class DmSygdMxController {
@RequestMapping("/tqSygd")
@AuthFunction
public ResultBean tqSygd( ){
public ResultBean tqSygd(@RequestBody List<DmSygdMx> list){
return service.tqSygd();
}
}

@ -1,7 +1,6 @@
package com.dsic.gj_erp.controller.jhgk;
import cn.hutool.core.date.DateUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@ -46,8 +46,9 @@ public class DmSygdxqController {
public ResultBean getList(@RequestBody Map<String, String> map) {
List<DmSygdxq> list = service.list(new QueryWrapper<DmSygdxq>()
.ge(StrUtil.isNotEmpty(map.get("beginTime")), "xzglxq", DateUtil.beginOfMonth(DateUtil.parseDate(map.get("beginTime"))).toString("yyyy/MM/dd"))
.le(StrUtil.isNotEmpty(map.get("endTime")), "xzglxq", DateUtil.endOfMonth(DateUtil.parseDate(map.get("endTime"))).toString("yyyy/MM/dd"))
.eq(StrUtil.isNotEmpty(map.get("dcCh")),"dc_ch",map.get("dcCh"))
.ge(StrUtil.isNotEmpty(map.get("beginTime")), "xzglxq", DateUtil.beginOfMonth(DateUtil.parseDate(map.get("beginTime"))))
.le(StrUtil.isNotEmpty(map.get("endTime")), "xzglxq", DateUtil.endOfMonth(DateUtil.parseDate(map.get("endTime"))))
.orderByAsc("dc_ch, cast(dc_pl as int),xzglxq"));
return new ResultBean(list);
}

@ -1,91 +0,0 @@
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);
}
}

@ -5,6 +5,7 @@ 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;
@ -35,7 +36,7 @@ public class SyDictItemController {
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"));
queryWrapper.eq("bmlb",params.get("name"));
}
return new ResultBean(syDictItemService.list(queryWrapper));
}
@ -59,8 +60,12 @@ public class SyDictItemController {
@PostMapping(value = "/del")
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
public ResultBean del(@RequestBody List<String> delArr) {
syDictItemService.removeByIds(delArr);
public ResultBean del(@RequestBody List<SyDictItem> delArr) {
for (SyDictItem syDictItem : delArr) {
syDictItemService.remove(new QueryWrapper<SyDictItem>()
.eq("bmlb",syDictItem.getDictCode())
.eq("bm",syDictItem.getItemValue()));
}
return new ResultBean();
}

@ -1,100 +0,0 @@
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();
}
}

@ -1,31 +0,0 @@
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);
}

@ -1,17 +0,0 @@
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> {
}

@ -1,5 +1,6 @@
package com.dsic.gj_erp.mapper;
import com.dsic.gj_erp.bean.sy.Syuserp;
import org.mapstruct.Mapper;
import org.springframework.stereotype.Repository;
@ -10,18 +11,18 @@ import java.util.Map;
@Mapper
public interface SyuserMapper {
int updateUser (Syuserp syuserp);
List<Map> getUserMenu(String usercode, String systemcode);
//------------------------------------------------------
List<Map> getDepartList();
List<Map> getSystemList();
List<Map> getRoleList();
List<Map> getMenuList();
Integer addRole(Map role);
List<Map> getUserListByMenu(Map<String, Object> paramMap);
Integer deleteRole(String role_code);
List<Map> getDepartList();
Integer updateRole(Map role);
List<Map> getRoleList();
List<Map> getRoleListByUser(String user_code);
@ -29,12 +30,6 @@ public interface SyuserMapper {
Integer deleteRoleForUser(Map<String, Object> user_role);
List<Map> getSystemList();
List<Map> getMenuList();
List<Map> getUserListByMenu(int menu_id);
List<Map> getInstitutionList();
List<Map> getUserListByRole(String role_code);
@ -43,29 +38,5 @@ public interface SyuserMapper {
List<Map> getSystemListByRole(String role_code);
Integer addRoleForInstitution(Map<String, Object> institution_role);
Integer deleteRoleForInstitution(Map<String, Object> institution_role);
Integer addRoleForSystem(Map<String, Object> system_role);
Integer deleteRoleForSystem(Map<String, Object> system_role);
List<Map> getMenuListByRole(String role_code);
void addRoleForMenu(Map<String, Object> menu_role);
void deleteRoleForMenu(Map<String, Object> menu_role);
void addFingerprintResult(String uuid, String fingerprint, String user_code);
String getCodeByUuid(String uuid);
Integer updateFingerprint(String uuid, String fingerprint);
Integer updateFingerprint1(String userCode, String fingerprint);
Integer updateFingerprint2(String userCode, String fingerprint);
Integer updateFingerprint3(String userCode, String fingerprint);
Map<String,Object> getUserInfo(Map<String,Object> map);
}

@ -1,5 +0,0 @@
package com.dsic.gj_erp.service;
public interface MyCacheInterface {
void refreshRedis();
}

@ -1,9 +0,0 @@
package com.dsic.gj_erp.service.cache;
public interface RedisCacheKeyConfig {
//船只信息缓存,对应DmProject
String PROJECT_KEY="ZX_ERP::PROJECT";
//部门缓存
String DEPT_KEY="ZX_ERP::DEPT";
}

@ -1,2 +0,0 @@
package com.dsic.gj_erp.service.cache;
//缓存读取

@ -40,7 +40,7 @@ public class EmSbcnpServiceImpl extends ServiceImpl<EmSbcnpMapper, EmSbcnp> impl
// emSbcnpMapper.test();
// }
List<EmSbcnp> emSbjbbs=emSbcnpMapper.selectList(queryWrapper.orderByDesc("kw,tzbh,zl,jgsx"));
List<EmSbcnp> emSbjbbs=emSbcnpMapper.selectList(queryWrapper.orderByAsc("kw,tzbh,zl,jgsx"));
return emSbjbbs;
}

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.dto.*;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.HashMap;
import java.util.List;

@ -65,7 +65,7 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
/**
*
*/
public Object cgjhdhqk(Map<String,Object> map){
public Object cgjhdhqk(Map<String, Object> map) {
return baseMapper.cgjhdhqk(map);
}
@ -81,40 +81,33 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
public ResultBean sygdPC() {
//todo 重复导入(三月滚动计划)的数据处理
//零件 删除
// String begin=DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
// String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),3)),"yyyy/MM/dd");
String begin="2023/08/01";
String end ="2023/10/31";
String begin=DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),3)),"yyyy/MM/dd");
//测试日期
// String begin = "2023/08/01";
// String end = "2023/10/31";
//todo 零件
ljService.remove(new QueryWrapper<DmSygdMxLj>().between("xzglxq",begin,end));
ljService.remove(new QueryWrapper<DmSygdMxLj>().between("xzglxq", begin, end));
//todo 三月滚动明细
this.remove(new QueryWrapper<DmSygdMx>().between("jssj",begin,end));
//todo 三月滚动计划
sygdService.remove(new QueryWrapper<DmSygd>().between("sl_sj",begin,end));
this.remove(new QueryWrapper<DmSygdMx>().between("jssj", begin, end));
//todo 三月滚动计划
sygdService.remove(new QueryWrapper<DmSygd>().between("sl_sj", begin, end));
baseMapper.getLjxx(begin,end);
List<DmSygdMxLj> ljList = ljService.list(new QueryWrapper<DmSygdMxLj>().between("xzglxq",begin,end));
baseMapper.getLjxx(begin, end);
List<DmSygdMxLj> ljList = ljService.list(new QueryWrapper<DmSygdMxLj>().between("xzglxq", begin, end));
if (ljList.size()<1){
return new ResultBean(false,1,"请先导入"+begin+" ~ "+end+"分段钢料需求!");
if (ljList.size() < 1) {
return new ResultBean(false, 1, "请先导入" + begin + " ~ " + end + "分段钢料需求!");
}
//TODO 零件排产 按时间 船号 批量 图号 排序
//1.根据BOM中的定额工时 坡口标识 pkbs 打磨标识 dmbs 曲标识 qbs
//坡口长度 pkcd 打磨长度dmcd
//定额工时:blgs pwgs llgs hxgs qggs pkgs dmgs qgs
//qgjssj 切割完成期(最晚)
//判断标识 零件数量*定额工时*长度=加工时长 累计加工时长 需求日期-累计加工时长=切割完成期(最晚)
//todo 有标识 无定额-->设备产能中同跨位零件加工定额 无-->通用零件加工定额
//2.根据
List<DmSygdMx> mxList = baseMapper.getMx(begin,end);
List<DmSygdMx> mxList = baseMapper.getMx(begin, end);
//todo 排产
ypc(mxList);
baseMapper.setParent(begin,end);
ResultBean r=new ResultBean(mxList);
baseMapper.setParent(begin, end);
ResultBean r = new ResultBean(mxList);
r.setSuccess(true);
return r;
return r;
}
/**
@ -123,66 +116,69 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
* @param list
*/
public void ypc(List<DmSygdMx> list) {
Map<String,List<DmSygdMx>> mxMap= list.stream().collect(Collectors.groupingBy(x -> x.getKw()+x.getZl()));
Map<String, List<DmSygdMx>> mxMap = list.stream().collect(Collectors.groupingBy(x -> x.getKw() + x.getZl()));
//加工工序list
List<EmSbcnp> sbcnp= sbcnpService.list(new QueryWrapper<EmSbcnp>().orderByDesc("tzbh,zl,jgsx"));
Map<String,List<EmSbcnp>> cnMap= sbcnp.stream().collect(Collectors.groupingBy(l->l.getTzbh()+l.getZl()));
for (String ljkey:mxMap.keySet()){
for (String cnkey:cnMap.keySet()){
if(ljkey.equals(cnkey)){
List<DmSygdMx> mxs= mxMap.get(ljkey);
List<EmSbcnp> cns= cnMap.get(cnkey);
mxs.forEach(l->{
double ljgs=0.0;
for (EmSbcnp cn : cns) {
// 号料 手工切割 倒棱 切端头 自由边 预组
// 曲 (个)
if(StrUtil.isNotEmpty(l.getQbs())&&cn.getGx().equals("18")){
ljgs+= l.getLjsl()/cn.getDegs();
l.setQjgrq(getRq(ljgs,l.getJssj()));
}
// 打磨
if(ObjectUtil.isNotEmpty(l.getDmcd())&&("16,13".indexOf(cn.getGx())>0)){
ljgs+= l.getDmcd() /cn.getDegs();
l.setDmrq(getRq(ljgs,l.getJssj()));
}
// 坡口
if(ObjectUtil.isNotEmpty(l.getPkcd())&&("08,10".indexOf(cn.getGx())>0)){
ljgs+= l.getPkcd() /cn.getDegs();
l.setPkrq(getRq(ljgs,l.getJssj()));
}
if("03,04,05,07".indexOf(cn.getGx())>0){
ljgs+= l.getQgcd() /cn.getDegs();
l.setQgrq(getRq(ljgs,l.getJssj()));
}
// 划线
if(cn.getGx().equals("01")){
ljgs+= l.getHxcd() /cn.getDegs();
l.setHxrq(getRq(ljgs,l.getJssj()));
}
//上料
if(cn.getGx().equals("19")){
ljgs+= l.getHxcd() /cn.getDegs();
l.setSlrq(getRq(ljgs,l.getJssj()));
}
//抛丸
if(cn.getGx().equals("20")){
ljgs+= l.getHxcd() /cn.getDegs();
l.setPkrq(getRq(ljgs,l.getJssj()));
}
//理料
if(cn.getGx().equals("21")){
ljgs+= l.getHxcd() /cn.getDegs();
l.setLlrq(getRq(ljgs,l.getJssj()));
}
}
this.save(l);
});
}
}
}
List<EmSbcnp> sbcnp = sbcnpService.list(new QueryWrapper<EmSbcnp>().orderByDesc("tzbh,zl,jgsx"));
Map<String, List<EmSbcnp>> cnMap = sbcnp.stream().collect(Collectors.groupingBy(l -> l.getTzbh() + l.getZl()));
for (String ljkey : mxMap.keySet()) {
for (String cnkey : cnMap.keySet()) {
if (ljkey.equals(cnkey)) {
List<DmSygdMx> mxs = mxMap.get(ljkey);
List<EmSbcnp> cns = cnMap.get(cnkey);
//*******
mxs.forEach(l -> {
double ljgs = 0.0;
for (EmSbcnp cn : cns) {
// 号料 手工切割 倒棱 切端头 自由边 预组
// 曲 (个)
if (StrUtil.isNotEmpty(l.getQbs()) && cn.getGx().equals("18")) {
ljgs += l.getLjsl() / cn.getDegs();
l.setQjgrq(getRq(ljgs, l.getJssj()));
}
// 打磨
if (ObjectUtil.isNotEmpty(l.getDmcd()) && ("16,13".indexOf(cn.getGx()) > 0)) {
ljgs += l.getDmcd() / cn.getDegs();
l.setDmrq(getRq(ljgs, l.getJssj()));
}
// 坡口
if (ObjectUtil.isNotEmpty(l.getPkcd()) && ("08,10".indexOf(cn.getGx()) > 0)) {
ljgs += l.getPkcd() / cn.getDegs();
l.setPkrq(getRq(ljgs, l.getJssj()));
}
if ("03,04,05,07".indexOf(cn.getGx()) > 0) {
ljgs += l.getQgcd() / cn.getDegs();
l.setQgrq(getRq(ljgs, l.getJssj()));
}
// 划线
if (cn.getGx().equals("01")) {
ljgs += l.getHxcd() / cn.getDegs();
l.setHxrq(getRq(ljgs, l.getJssj()));
}
//上料
if (cn.getGx().equals("19")) {
ljgs += l.getHxcd() / cn.getDegs();
l.setSlrq(getRq(ljgs, l.getJssj()));
}
//抛丸
if (cn.getGx().equals("20")) {
ljgs += l.getHxcd() / cn.getDegs();
l.setPkrq(getRq(ljgs, l.getJssj()));
}
//理料
if (cn.getGx().equals("21")) {
ljgs += l.getHxcd() / cn.getDegs();
l.setLlrq(getRq(ljgs, l.getJssj()));
}
}
this.save(l);
});
}
}
}
//********************************************************************
//1.根据组立结束时间排序,决定生产顺序
// list = list.stream().sorted(Comparator.comparing(DmSygdMx::getQgjssj, Comparator.nullsLast(Comparator.naturalOrder()))).collect(Collectors.toList());
@ -219,26 +215,17 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
// this.saveBatch(list);
}
public String getRq(Double gs,String rq){
double ts=gs/8;
int num= (int)ts;
num+=(ts-num)>0?1:0;
return DateUtil.format(DateUtil.offsetDay(DateUtil.parseDate(rq),-num),"yyyy/MM/dd");
public String getRq(Double gs, String rq) {
double ts = gs / 8;
int num = (int) ts;
num += (ts - num) > 0 ? 1 : 0;
return DateUtil.format(DateUtil.offsetDay(DateUtil.parseDate(rq), -num), "yyyy/MM/dd");
}
public void pp(List<DmSygdMx> list,List<EmSbcnp> sbcnp){
// 1.零件按照交货时间排序,从后到前;按日期分组
// 2.时间倒序,排加工时间
//套料图类型一致
//日期从后往前
//产能 sbcnp.get(0).getDegs()*8
//循环日期 工厂日历 最后一天
}
/**
* 线
*
* @param list
* @return
*/
@ -273,6 +260,8 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
dmXbjh.setTlt_zl(shzl);
dmXbjh.setXczl(Double.valueOf(String.format("%.2f", shzl - dmXbjh.getZl())));
dmXbjh.setMxList(monthAndCh.get(ch));
} else {
dmXbjh.setXczl(Double.valueOf(String.format("%.2f", 0.0 - dmXbjh.getZl())));
}
}
});
@ -293,8 +282,8 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
Xbjhdto xbjhdto = new Xbjhdto();
xbjhdto.setDcCh("合计");
xbjhdto.setXczl(Double.valueOf(String.format("%.2f", tlt_zl - zl)));
xbjhdto.setTlt_zl(tlt_zl);
xbjhdto.setZl(zl);
xbjhdto.setTlt_zl(Double.valueOf(String.format("%.2f", tlt_zl)));
xbjhdto.setZl(Double.valueOf(String.format("%.2f", zl)));
xbjhdto.setYf(month);
xbjhdto.setNf(y.get(0).getNf());
list1.add(xbjhdto);
@ -334,26 +323,26 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
* @return
*/
@Override
public List<Kwdto> getKwList(List<DmSygdMx> list,String begin, String end) {
public List<Kwdto> getKwList(List<DmSygdMx> list, String begin, String end) {
List<Kwdto> kwdtoList = baseMapper.getkw(begin, end);
kwdtoList.forEach(l -> {
l.setMxList(list.stream().filter(
m -> m.getDcCh().equals(l.getCh())
&& m.getDcPl().equals(l.getPl())
&& (StrUtil.hasEmpty(m.getKw(),l.getKw())?true: m.getKw().equals(l.getKw()))
&& m.getJssj().substring(0,7) .equals(l.getYf())
&& (StrUtil.hasEmpty(m.getKw(), l.getKw()) ? true : m.getKw().equals(l.getKw()))
&& m.getJssj().substring(0, 7).equals(l.getYf())
).collect(Collectors.toList()));
});
Map<String,List<Kwdto>> map= kwdtoList.stream().collect(Collectors.groupingBy(Kwdto::getYf));
List<Kwdto> kws=new ArrayList<>();
Map<String, List<Kwdto>> map = kwdtoList.stream().collect(Collectors.groupingBy(Kwdto::getYf));
List<Kwdto> kws = new ArrayList<>();
for (String yf : map.keySet()) {
int count= list.stream().filter(
m -> m.getJssj().substring(0,7) .equals(yf)
int count = list.stream().filter(
m -> m.getJssj().substring(0, 7).equals(yf)
).collect(Collectors.toList()).size();
Kwdto k=new Kwdto();
k.setYf(yf.substring(5,7)+"月份合计");
Kwdto k = new Kwdto();
k.setYf(yf.substring(5, 7) + "月份合计");
k.setBs(new BigDecimal(count));
kws.add(k);
kws.addAll(map.get(yf));
@ -468,8 +457,8 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
//1.查询未来3个月明细信息
//测试
// List<DmSygdMx> list=null;
String begin=DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),3)),"yyyy/MM/dd");
String begin = DateUtil.format(DateUtil.nextMonth(), "yyyy/MM/01");
String end = DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(), 3)), "yyyy/MM/dd");
List<DmSygdMx> list = this.list(new QueryWrapper<DmSygdMx>()
.between("jssj",
@ -494,8 +483,8 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
sygd.setSlSl(mxList.size());
sygd.setPwSj(mxList.get(0).getSlrq());
sygd.setPwSl(mxList.size());
sygd.setGjjsDz(mxList.get(0).getJssj());
sygd.setGjjsXz(mxList.get(0).getGjjsDz());
sygd.setGjjsDz(mxList.get(0).getGjjsDz());
sygd.setGjjsXz(mxList.get(0).getJssj());
//跨位信息
Map<String, List<DmSygdMx>> kwMap = map.get(key).stream().collect(Collectors.groupingBy(x -> Optional.ofNullable(x.getKw()).orElse("0")));
for (String kw : kwMap.keySet()) {
@ -628,11 +617,11 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
if (kw.equals("16")) {//7跨型板
if (zl.equals("1110")) {//大组
//todo 型材米数
sygd.setX7xd(kssj.size());
sygd.setX7xd(kssj.size());
sygd.setX7xdSj(sj);
}
if (zl.equals("1010")) {//小组
sygd.setX7xx(kssj.size());
sygd.setX7xx(kssj.size());
sygd.setX7xxSj(sj);
}
}

@ -57,12 +57,12 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
//3.根据前方需求期,重新为三月滚动明细排产(板),排产后的数据添加到月度计划,并且反写数据到三月滚动明细
// List<DmQfxq> qfxqList= qfxqService.list(new QueryWrapper<DmQfxq>().eq("substring(db,0,8) ", DateUtil.format(DateUtil.nextMonth(),"yyyy/MM")));
int i = qfxqService.count(new QueryWrapper<DmQfxq>()
.eq("substring(xzglxq,0,8) ", "2023/08"));
.eq("substring(xzglxq,0,8) ", DateUtil.format(DateUtil.nextMonth(),"yyyy/MM")));
if (i < 1) {
System.out.println("下月的前方需求信息未导入!");
return null;
}
List<DmSygdMx> sygdmx = baseMapper.getSygdmx("2023/08");
List<DmSygdMx> sygdmx = baseMapper.getSygdmx(DateUtil.format(DateUtil.nextMonth(),"yyyy/MM"));
if (sygdmx.size() < 1) {
System.out.println("请导入零件配套表信息!");
}
@ -79,10 +79,10 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
Map<String,Object> map=new HashMap<>();
//月度计划汇总
//汇总时生成切割之前的派工单 状态为空
// String begin= DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
// String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),1)),"yyyy/MM/dd");
String begin="2023/08/01";
String end ="2023/08/31";
String begin= DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),1)),"yyyy/MM/dd");
// String begin="2023/08/01";
// String end ="2023/08/31";
//图纸计划
List<PgdTzjh> tzjhList=tzjhService.list(new QueryWrapper<PgdTzjh>().between("qgxqrq",begin,end).orderByAsc("czbh,pl,qgxqrq"));

@ -1,30 +0,0 @@
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);
}

@ -283,11 +283,12 @@ public class SYService {
}
@Transactional
public Syuserp updateUser(Syuserp osyuserp, Syuserp nsyuserp) {
QSyuirp syuirp = QSyuirp.syuirp;
queryFactory.update(syuirp).set(syuirp.YHDM, nsyuserp.getYHDM()).where(syuirp.YHDM.eq(osyuserp.getYHDM())).execute();
syuserpRepository.delete(osyuserp);
return syuserpRepository.save(nsyuserp);
public void updateUser(Syuserp syuserp) {
// QSyuirp syuirp = QSyuirp.syuirp;
// queryFactory.update(syuirp).set(syuirp.YHDM, nsyuserp.getYHDM()).where(syuirp.YHDM.eq(osyuserp.getYHDM())).execute();
// syuserpRepository.delete(osyuserp);
syuserMapper.updateUser(syuserp);
// return syuserpRepository.save(nsyuserp);
}
public void addWorkGroupUser(@RequestBody List<Syuirp> syuirp) {
@ -432,22 +433,19 @@ public class SYService {
}
return dmZhbmp;
}
// ----------------------------------------------------------------
public List<Map> getDepartList() {
return syuserMapper.getDepartList();
}
public Integer addRole(Map role) {
return syuserMapper.addRole(role);
public List<Map> getSystemList() {
return syuserMapper.getSystemList();
}
public List<Map> getMenuList() {
return syuserMapper.getMenuList();
}
public Integer deleteRole(String role_code) {
return syuserMapper.deleteRole(role_code);
public List<Map> getUserListByMenu(Map<String, Object> paramMap) {
return syuserMapper.getUserListByMenu(paramMap);
}
public Integer updateRole(Map role) {
return syuserMapper.updateRole(role);
public List<Map> getDepartList() {
return syuserMapper.getDepartList();
}
public List<Map> getRoleList() {
@ -458,7 +456,6 @@ public List<Map> getDepartList() {
return syuserMapper.getRoleListByUser(user_code);
}
public void addRoleForUser(List<Map<String, Object>> list) {
for (Map map : list) {
syuserMapper.addRoleForUser(map);
@ -471,25 +468,10 @@ public List<Map> getDepartList() {
}
}
public List<Map> getSystemList() {
return syuserMapper.getSystemList();
}
public List<Map> getMenuList() {
return syuserMapper.getMenuList();
}
public List<Map> getUserListByMenu(int menu_id) {
return syuserMapper.getUserListByMenu(menu_id);
}
public List<Map> getInstitutionList() {
return syuserMapper.getInstitutionList();
}
public List<Map> getUserListByRole(String role_code) {
return syuserMapper.getUserListByRole(role_code);
}
@ -502,49 +484,7 @@ public List<Map> getDepartList() {
public List<Map> getSystemListByRole(String role_code) {
return syuserMapper.getSystemListByRole(role_code);
}
public void addRoleForInstitution(List<Map<String, Object>> paramList) {
for (Map map : paramList) {
syuserMapper.addRoleForInstitution(map);
}
}
public void deleteRoleForInstitution(List<Map<String, Object>> paramList) {
for (Map map : paramList) {
syuserMapper.deleteRoleForInstitution(map);
}
}
public void addRoleForSystem(List<Map<String, Object>> paramList) {
for (Map map : paramList) {
syuserMapper.addRoleForSystem(map);
}
}
public void deleteRoleForSystem(List<Map<String, Object>> paramList) {
for (Map map : paramList) {
syuserMapper.deleteRoleForSystem(map);
}
}
public List<Map> getMenuListByRole(String role_code) {
return syuserMapper.getMenuListByRole(role_code);
}
public void addRoleForMenu(List<Map<String, Object>> paramList) {
for (Map map : paramList) {
syuserMapper.addRoleForMenu(map);
}
}
public void deleteRoleForMenu(List<Map<String, Object>> paramList) {
for (Map map : paramList) {
syuserMapper.deleteRoleForMenu(map);
}
}
}

@ -1,17 +0,0 @@
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> {
}

@ -1,240 +0,0 @@
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));
}
}

@ -30,7 +30,7 @@ public class SyDictServiceImpl extends ServiceImpl<SyDictMapper, SyDict> impleme
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")));
queryWrapper.and(wp->wp.like("lbmc",params.get("name")).or().like("bmlb",params.get("name")));
}
List<SyDict> list = this.list(queryWrapper);
//父级
@ -41,8 +41,8 @@ public class SyDictServiceImpl extends ServiceImpl<SyDictMapper, SyDict> impleme
list.stream().forEach(e->{
ProjectTreeVo tree=new ProjectTreeVo();
tree.setId(e.getDictCode());
tree.setLabel(e.getDictName());
tree.setId(e.getBmlb());
tree.setLabel(e.getLbmc());
tree.setParentBm("@@@");
projectTreeVoList.add(tree);
});
@ -68,13 +68,13 @@ public class SyDictServiceImpl extends ServiceImpl<SyDictMapper, SyDict> impleme
//子级
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);
});
// 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;
@ -97,13 +97,13 @@ public class SyDictServiceImpl extends ServiceImpl<SyDictMapper, SyDict> impleme
//子级
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);
});
// 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;

@ -1,21 +0,0 @@
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 {
}

@ -1,107 +0,0 @@
package com.dsic.gj_erp.util;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
public class CodeGenerator {
public static void main(String[] args) {
GlobalConfig config = new GlobalConfig();
String projectPath = System.getProperty("user.dir");
config.setActiveRecord(false)//开启AR模式
.setAuthor("xn")//设置作者
//生成路径(一般都是生成在此项目的src/main/java下面)
.setOutputDir(projectPath + "/src/main/java")
.setFileOverride(true)//第二次生成会把第一次生成的覆盖掉
.setIdType(IdType.ASSIGN_UUID)//主键策略
.setServiceName("%sService")//生成的service接口名字首字母是否为I这样设置就没有I
.setBaseResultMap(true)//生成resultMap
.setBaseColumnList(true).//在xml中生成基础列
setSwagger2(true);
//2、数据源配置
DataSourceConfig dataSourceConfig = new DataSourceConfig();
dataSourceConfig.setDbType(DbType.SQL_SERVER)//数据库类型
.setDriverName("com.microsoft.sqlserver.jdbc.SQLServerDriver")
.setUrl("jdbc:sqlserver://localhost:1433;DatabaseName=gj_erp") //250 是 tribon
.setUsername("sa")
.setPassword("gjerp");
//3、策略配置
StrategyConfig strategyConfig = new StrategyConfig();
strategyConfig.setCapitalMode(false)//开启全局大写命名
//.setDbColumnUnderline(true)//表名字段名使用下划线
.setNaming(NamingStrategy.underline_to_camel)//下划线到驼峰的命名方式
// .setTablePrefix("tb_")//表名前缀
.setEntityLombokModel(true)//使用lombok
.setRestControllerStyle(true)
.setInclude(new String[]{"qmjh"});
//.setInclude("表1","表2");//逆向工程使用的表
//4、包名策略配置
PackageConfig packageConfig = new PackageConfig();
//设置包名的parent
packageConfig.setParent("com.dsic.gj_erp")
.setMapper("mapper.pgd")
.setService("service.pgd")
.setServiceImpl("service.pgd.impl")
.setController("controller.pgd")
.setEntity("bean.pgd")
//设置xml文件的目录
.setXml("mapper.pgd");
//设置xml文件的目录
//
// packageConfig.setParent("com.dsic.xzerp")
// .setMapper("dao.gxzz.view")
// .setService("service.gxzz.view")
// .setServiceImpl("service.gxzz.view.impl")
// //.setController("controller.gxzz.jcsj")
// .setEntity("bean.gxzz.view")
// //设置xml文件的目录
// .setXml("dao.gxzz.view");
// packageConfig.setParent("com.dsic.xzerp")
// .setMapper("dao.zlgl.gcjy")
// .setService("service.zlgl.gcjy")
// .setServiceImpl("service.zlgl.gcjy.impl")
// .setController("controller.zlgl.gcjy")
// .setEntity("bean.zlgl.gcjy")
// //设置xml文件的目录
// .setXml("dao.zlgl.gcjy");
// packageConfig.setParent("com.dsic.xzerp")
// .setMapper("dao.gxzz.jszb")
// .setService("service.gxzz.jszb")
// .setServiceImpl("service.gxzz.jszb.impl")
// .setController("controller.gxzz.jszb")
// .setEntity("bean.gxzz.jszb")
// //设置xml文件的目录
// .setXml("dao.gxzz");
//
//
// packageConfig.setParent("com.dsic.xzerp")
// // .setMapper("dao.gxzz.jhsc")
// // .setService("service.gxzz.jhsc")
// // .setServiceImpl("service.gxzz.jhsc.impl")
// // .setController("controller.gxzz.jhsc")
// .setEntity("bean.gxzz.jhsc");
// //设置xml文件的目录
// // .setXml("dao.gxzz");
//5、整合配置
AutoGenerator autoGenerator = new AutoGenerator();
autoGenerator.setGlobalConfig(config)
.setDataSource(dataSourceConfig)
.setStrategy(strategyConfig)
.setPackageInfo(packageConfig)
;
//6、执行
autoGenerator.execute();
}
}

@ -1,57 +0,0 @@
package com.dsic.gj_erp.util;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
/**
* IP
*
* @Author xhj
* @Date 20210418
*/
public class IPUtils {
private static Logger logger = LoggerFactory.getLogger(IPUtils.class);
/**
* IP
*
* 使Nginx request.getRemoteAddr()IP
* 使X-Forwarded-ForIPX-Forwarded-ForunknownIPIP
*/
public static String getIpAddr(HttpServletRequest request) {
String ip = null;
try {
ip = request.getHeader("x-forwarded-for");
if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (StringUtils.isBlank(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_CLIENT_IP");
}
if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
} catch (Exception e) {
logger.error("IPUtils ERROR ", e);
}
// //使用代理则获取第一个IP地址
// if(StringUtils.isEmpty(ip) && ip.length() > 15) {
// if(ip.indexOf(",") > 0) {
// ip = ip.substring(0, ip.indexOf(","));
// }
// }
return ip;
}
}

@ -1,30 +0,0 @@
<?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>

@ -1,24 +0,0 @@
<?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>

@ -5,6 +5,10 @@
<mapper namespace="com.dsic.gj_erp.mapper.SyuserMapper">
<update id="updateUser" parameterType="com.dsic.gj_erp.bean.sy.Syuserp">
update syuserp set yhms=#{yhms}, bmbm=#{bmbm},ylzd1=#{ylzd1},ylzd2=#{ylzd2},
where yhdm=#{yhdm}
</update>
<select id="getUserMenu" resultType="Map">
SELECT distinct right(syfunp.ylzd2,2) as id,null as parent_id,syfunp.zxtbm as system_code,
syfunp.ylzd1 as menu_name,'1' as menu_status,left(syfunp.ylzd2,2) as url,null as component_path,
@ -30,140 +34,92 @@
ORDER BY id
</select>
<select id="getDepartList" resultType="Map">
SELECT * FROM dm_depart order by len(depart_code),depart_code
</select>
<insert id="addRole" parameterType="Map">
INSERT INTO sy_role (role_code,role_name,remark) VALUES (#{role_code},#{role_name},#{remark})
</insert>
<delete id="deleteRole" parameterType="String">
DELETE FROM sy_role WHERE role_code =#{role_code}
</delete>
<update id="updateRole" parameterType="Map">
UPDATE sy_role SET role_code =#{role_code},role_name =#{role_name},remark =#{remark} WHERE role_code =#{role_code}
</update>
<select id="getRoleList" resultType="Map">
SELECT * FROM sy_role
<select id="getSystemList" resultType="Map">
select zxtdm,zxtms from sysysp order by ylzd1
</select>
<select id="getRoleListByUser" resultType="Map">
select role_code from sy_user_role where user_code=#{user_code}
<select id="getMenuList" resultType="Map">
select syfunp.ylzd1,
rtrim(syfunp.ms) as ms,
syfunp.ckcs,
syfunp.zxtbm,
syfunp.ylzd2,
syfunp.ylzd3,
syfunp.gnlb
from syfunp,sysysp
where syfunp.zxtbm = sysysp.zxtdm and syfunp.zxtbm='PS'
order by syfunp.zxtbm,syfunp.ylzd2,syfunp.ylzd3,syfunp.gnlb
</select>
<insert id="addRoleForUser" parameterType="Map">
INSERT INTO sy_user_role (user_code,role_code) VALUES (#{user_code},#{role_code})
</insert>
<delete id="deleteRoleForUser" parameterType="Map">
DELETE FROM sy_user_role WHERE user_code =#{user_code} AND role_code =#{role_code}
</delete>
<select id="getSystemList" resultType="Map">
select * from sy_system
<select id="getUserListByMenu" resultType="Map" parameterType="Map">
SELECT syuserp.bmbm as depart_code,
syuirp.yhdm as user_code,
syuserp.yhms as user_name,
syifrp.ms,
max(syifrp.zxtbm) as zxtbm,
'' as zxt,
'' as roles
FROM syifrp,
syuirp,
syuserp
WHERE syifrp.gwdm = syuirp.gwdm
and syuirp.yhdm = syuserp.yhdm
and syifrp.zxtbm = #{zxtbm}
and syifrp.ms = #{ms}
GROUP BY syuirp.yhdm,
syuserp.yhms,
syifrp.ms,
syuserp.bmbm
</select>
<select id="getMenuList" resultType="Map">
select * from sy_menu
<select id="getDepartList" resultType="Map">
SELECT DM_ZHBMP.BM as depart_code,
DM_ZHBMP.BMSM as depart_name
FROM DM_ZHBMP WHERE DM_ZHBMP.BMLB='bmbm'
order by len(DM_ZHBMP.BM),DM_ZHBMP.BM
</select>
<select id="getUserListByMenu" resultType="Map">
SELECT a.*,GROUP_CONCAT(DISTINCT b.role_code separator ';') AS roles FROM sy_user as a
LEFT JOIN sy_user_role as b on a.user_code = b.user_code
LEFT JOIN sy_menu_role as c on b.role_code =c.role_code
WHERE menu_id =#{menu_id} GROUP BY a.user_code
<select id="getRoleList" resultType="Map">
SELECT RTRIM(JKDBM) AS role_code,
RTRIM(JKDMC) AS role_name
FROM SYWORKGP
</select>
<select id="getInstitutionList" resultType="Map">
select * from dm_institution
select bm as institution_code,bmsm as institution_name from dm_zhbmp
where bmlb='BMBM' and (bm like 'IM%' or bm like 'SD%' or bm like 'MS%' or bm like 'FP%' or bm like 'HR%')
</select>
<select id="getUserListByRole" resultType="Map">
select user_code from sy_user_role where role_code= #{role_code}
SELECT syuserp.yhdm from syuserp,syuirp WHERE syuserp.YHDM =syuirp.YHDM and syuirp.GWDM= #{role_code}
</select>
<select id="getInstitutionListByRole" resultType="Map">
select institution_code from sy_institution_role where role_code= #{role_code}
SELECT dm_zhbmp.bm as institution_code FROM SYIGRP,
(select * from dm_zhbmp
where bmlb='BMBM' and (bm like 'IM%' or bm like 'SD%' or bm like 'MS%' or bm like 'FP%' or bm like 'HR%')) dm_zhbmp
WHERE
dm_zhbmp.BM=(SYIGRP.ZXTDM+SYIGRP.FZDM ) and SYIGRP.GWDM =#{role_code}
</select>
<insert id="addRoleForInstitution" parameterType="Map">
INSERT INTO sy_institution_role (institution_code,role_code) VALUES (#{institution_code},#{role_code})
</insert>
<delete id="deleteRoleForInstitution" parameterType="Map">
DELETE FROM sy_institution_role WHERE institution_code =#{institution_code} AND role_code =#{role_code}
</delete>
<select id="getSystemListByRole" resultType="Map">
select system_code from sy_sytem_role where role_code= #{role_code}
select sysysp.zxtdm from SYIMRP,sysysp WHERE sysysp.ZXTDM=SYIMRP.ZXTBM and SYIMRP.GWDM= #{role_code}
</select>
<insert id="addRoleForSystem" parameterType="Map">
INSERT INTO sy_sytem_role (system_code,role_code) VALUES (#{system_code},#{role_code})
</insert>
<delete id="deleteRoleForSystem" parameterType="Map">
DELETE FROM sy_sytem_role WHERE system_code =#{system_code} AND role_code =#{role_code}
</delete>
<select id="getMenuListByRole" resultType="Map">
select distinct menu_id from sy_menu_role where role_code= #{role_code}
</select>
<insert id="addRoleForMenu" parameterType="Map">
INSERT INTO sy_menu_role (menu_id,role_code) VALUES (#{menu_id},#{role_code})
</insert>
<delete id="deleteRoleForMenu" parameterType="Map">
DELETE FROM sy_menu_role WHERE menu_id =#{menu_id} AND role_code =#{role_code}
</delete>
<insert id="addFingerprintResult" parameterType="String">
INSERT INTO dm_fingerprint (uuid,fingerprint,user_code) VALUES (#{uuid},#{fingerprint},#{user_code})
</insert>
<select id="getCodeByUuid" resultType="String">
SELECT user_code FROM dm_fingerprint where uuid =#{uuid}
<select id="getRoleListByUser" resultType="Map">
SELECT syuirp.GWDM as role_code from syuirp where yhdm=#{user_code}
</select>
<update id="updateFingerprint">
UPDATE sy_user SET fingerprint = #{fingerprint} WHERE fingerprint =#{uuid}
</update>
<select id="getUserInfo" resultType="java.util.Map" parameterType="String">
select
u.*,group_concat(sur.role_code) role
from
sy_user u left join sy_user_role sur on u.user_code = sur.user_code
where
u.user_code=#{userCode}
group by
u.user_code
</select>
<insert id="addRoleForUser" parameterType="Map">
INSERT INTO sy_user_role (user_code,role_code) VALUES (#{user_code},#{role_code})
</insert>
<update id="updateFingerprint1">
UPDATE sy_user SET fingerprint = #{fingerprint} WHERE user_code =#{userCode}
</update>
<update id="updateFingerprint2">
UPDATE sy_user SET fingerprint1 = #{fingerprint} WHERE user_code =#{userCode}
</update>
<update id="updateFingerprint3">
UPDATE sy_user SET fingerprint2 = #{fingerprint} WHERE user_code =#{userCode}
</update>
<delete id="deleteRoleForUser" parameterType="Map">
DELETE FROM sy_user_role WHERE user_code =#{user_code} AND role_code =#{role_code}
</delete>
</mapper>

Loading…
Cancel
Save