Commit 82cad570 authored by gu-jinli1118's avatar gu-jinli1118
Browse files

Test

parents
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.entities.Msg;
import com.jsh.erp.datasource.entities.MsgEx;
import com.jsh.erp.service.msg.MsgService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author ji sheng hua jshERP
*/
@RestController
@RequestMapping(value = "/msg")
@Api(tags = {"消息管理"})
public class MsgController {
private Logger logger = LoggerFactory.getLogger(MsgController.class);
@Resource
private MsgService msgService;
/**
* 根据状态查询消息
* @param status
* @param request
* @return
* @throws Exception
*/
@GetMapping("/getMsgByStatus")
@ApiOperation(value = "根据状态查询消息")
public BaseResponseInfo getMsgByStatus(@RequestParam("status") String status,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
List<MsgEx> list = msgService.getMsgByStatus(status);
res.code = 200;
res.data = list;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 批量更新状态
* @param jsonObject
* @param request
* @return
* @throws Exception
*/
@PostMapping("/batchUpdateStatus")
@ApiOperation(value = "批量更新状态")
public BaseResponseInfo batchUpdateStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
String ids = jsonObject.getString("ids");
String status = jsonObject.getString("status");
msgService.batchUpdateStatus(ids, status);
res.code = 200;
res.data = "更新成功";
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 根据状态查询数量
* @param status
* @param request
* @return
* @throws Exception
*/
@GetMapping("/getMsgCountByStatus")
@ApiOperation(value = "根据状态查询数量")
public BaseResponseInfo getMsgCountByStatus(@RequestParam("status") String status,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Long> map = new HashMap<String, Long>();
Long count = msgService.getMsgCountByStatus(status);
map.put("count", count);
res.code = 200;
res.data = map;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 根据类型查询数量
* @param type
* @param request
* @return
* @throws Exception
*/
@GetMapping("/getMsgCountByType")
@ApiOperation(value = "根据类型查询数量")
public BaseResponseInfo getMsgCountByType(@RequestParam("type") String type,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Integer> map = new HashMap<>();
Integer count = msgService.getMsgCountByType(type);
map.put("count", count);
res.code = 200;
res.data = map;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 全部设置未已读
* @param request
* @return
* @throws Exception
*/
@PostMapping("/readAllMsg")
@ApiOperation(value = "全部设置未已读")
public BaseResponseInfo readAllMsg(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
msgService.readAllMsg();
res.code = 200;
res.data = "操作成功!";
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.MaterialCategory;
import com.jsh.erp.datasource.entities.Organization;
import com.jsh.erp.datasource.vo.TreeNode;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.materialCategory.MaterialCategoryService;
import com.jsh.erp.service.organization.OrganizationService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.List;
/**
* create by: cjl
* description:
*
* create time: 2019/3/6 10:54
*/
@RestController
@RequestMapping(value = "/organization")
@Api(tags = {"机构管理"})
public class OrganizationController {
private Logger logger = LoggerFactory.getLogger(OrganizationController.class);
@Resource
private OrganizationService organizationService;
/**
* 根据id来查询机构信息
* @param id
* @param request
* @return
*/
@GetMapping(value = "/findById")
@ApiOperation(value = "根据id来查询机构信息")
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<Organization> dataList = organizationService.findById(id);
JSONObject outer = new JSONObject();
if (null != dataList) {
for (Organization org : dataList) {
outer.put("id", org.getId());
outer.put("orgAbr", org.getOrgAbr());
outer.put("parentId", org.getParentId());
List<Organization> dataParentList = organizationService.findByParentId(org.getParentId());
if(dataParentList!=null&&dataParentList.size()>0){
//父级机构名称显示简称
outer.put("orgParentName", dataParentList.get(0).getOrgAbr());
}
outer.put("orgNo", org.getOrgNo());
outer.put("sort", org.getSort());
outer.put("remark", org.getRemark());
}
}
res.code = 200;
res.data = outer;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* create by: cjl
* description:
* 获取机构树数据
* create time: 2019/2/19 11:49
* @Param:
* @return com.alibaba.fastjson.JSONArray
*/
@RequestMapping(value = "/getOrganizationTree")
@ApiOperation(value = "获取机构树数据")
public JSONArray getOrganizationTree(@RequestParam("id") Long id) throws Exception{
JSONArray arr=new JSONArray();
List<TreeNode> organizationTree= organizationService.getOrganizationTree(id);
if(organizationTree!=null&&organizationTree.size()>0){
for(TreeNode node:organizationTree){
String str=JSON.toJSONString(node);
JSONObject obj=JSON.parseObject(str);
arr.add(obj);
}
}
return arr;
}
/**
* create by: cjl
* description:
* 新增机构信息
* create time: 2019/2/19 17:17
* @Param: beanJson
* @return java.lang.Object
*/
@PostMapping(value = "/addOrganization")
@ApiOperation(value = "新增机构信息")
public Object addOrganization(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess();
Organization org= JSON.parseObject(beanJson, Organization.class);
int i= organizationService.addOrganization(org);
if(i<1){
throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_ADD_FAILED_CODE,
ExceptionConstants.ORGANIZATION_ADD_FAILED_MSG);
}
return result;
}
/**
* create by: cjl
* description:
* 修改机构信息
* create time: 2019/2/20 9:30
* @Param: beanJson
* @return java.lang.Object
*/
@PostMapping(value = "/editOrganization")
@ApiOperation(value = "修改机构信息")
public Object editOrganization(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess();
Organization org= JSON.parseObject(beanJson, Organization.class);
int i= organizationService.editOrganization(org);
if(i<1){
throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_EDIT_FAILED_CODE,
ExceptionConstants.ORGANIZATION_EDIT_FAILED_MSG);
}
return result;
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.entities.Person;
import com.jsh.erp.service.person.PersonService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* @author ji|sheng|hua 华夏erp
*/
@RestController
@RequestMapping(value = "/person")
@Api(tags = {"经手人管理"})
public class PersonController {
private Logger logger = LoggerFactory.getLogger(PersonController.class);
@Resource
private PersonService personService;
/**
* 全部数据列表
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getAllList")
@ApiOperation(value = "全部数据列表")
public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {
List<Person> personList = personService.getPerson();
map.put("personList", personList);
res.code = 200;
res.data = personList;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 根据Id获取经手人信息
* @param personIds
* @param request
* @return
*/
@GetMapping(value = "/getPersonByIds")
@ApiOperation(value = "根据Id获取经手人信息")
public BaseResponseInfo getPersonByIds(@RequestParam("personIds") String personIds,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {
Map<Long,String> personMap = personService.getPersonMap();
String names = personService.getPersonByMapAndIds(personMap, personIds);
map.put("names", names);
res.code = 200;
res.data = map;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 根据类型获取经手人信息
* @param type
* @param request
* @return
*/
@GetMapping(value = "/getPersonByType")
@ApiOperation(value = "根据类型获取经手人信息")
public BaseResponseInfo getPersonByType(@RequestParam("type") String type,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {
List<Person> personList = personService.getPersonByType(type);
map.put("personList", personList);
res.code = 200;
res.data = map;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 根据类型获取经手人信息 1-业务员,2-仓管员,3-财务员
* @param typeNum
* @param request
* @return
*/
@GetMapping(value = "/getPersonByNumType")
@ApiOperation(value = "根据类型获取经手人信息1-业务员,2-仓管员,3-财务员")
public JSONArray getPersonByNumType(@RequestParam("type") String typeNum,
HttpServletRequest request)throws Exception {
JSONArray dataArray = new JSONArray();
try {
String type = "";
if (typeNum.equals("1")) {
type = "业务员";
} else if (typeNum.equals("2")) {
type = "仓管员";
} else if (typeNum.equals("3")) {
type = "财务员";
}
List<Person> personList = personService.getPersonByType(type);
if (null != personList) {
for (Person person : personList) {
JSONObject item = new JSONObject();
item.put("value", person.getId().toString());
item.put("text", person.getName());
dataArray.add(item);
}
}
} catch(Exception e){
e.printStackTrace();
}
return dataArray;
}
/**
* 批量设置状态-启用或者禁用
* @param jsonObject
* @param request
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
Boolean status = jsonObject.getBoolean("status");
String ids = jsonObject.getString("ids");
Map<String, Object> objectMap = new HashMap<>();
int res = personService.batchSetStatus(status, ids);
if(res > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.entities.PlatformConfig;
import com.jsh.erp.datasource.entities.User;
import com.jsh.erp.service.platformConfig.PlatformConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* @author ji|sheng|hua 华夏erp QQ7827-18920
*/
@RestController
@RequestMapping(value = "/platformConfig")
@Api(tags = {"平台参数"})
public class PlatformConfigController {
private Logger logger = LoggerFactory.getLogger(PlatformConfigController.class);
@Resource
private PlatformConfigService platformConfigService;
/**
* 获取平台名称
* @param request
* @return
*/
@GetMapping(value = "/getPlatform/name")
@ApiOperation(value = "获取平台名称")
public String getPlatformName(HttpServletRequest request)throws Exception {
String res;
try {
String platformKey = "platform_name";
PlatformConfig platformConfig = platformConfigService.getPlatformConfigByKey(platformKey);
res = platformConfig.getPlatformValue();
} catch(Exception e){
e.printStackTrace();
res = "ERP系统";
}
return res;
}
/**
* 获取官方网站地址
* @param request
* @return
*/
@GetMapping(value = "/getPlatform/url")
@ApiOperation(value = "获取官方网站地址")
public String getPlatformUrl(HttpServletRequest request)throws Exception {
String res;
try {
String platformKey = "platform_url";
PlatformConfig platformConfig = platformConfigService.getPlatformConfigByKey(platformKey);
res = platformConfig.getPlatformValue();
} catch(Exception e){
e.printStackTrace();
res = "#";
}
return res;
}
/**
* 根据platformKey更新platformValue
* @param object
* @param request
* @return
*/
@PostMapping(value = "/updatePlatformConfigByKey")
@ApiOperation(value = "根据platformKey更新platformValue")
public String updatePlatformConfigByKey(@RequestBody JSONObject object,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
String platformKey = object.getString("platformKey");
String platformValue = object.getString("platformValue");
int res = platformConfigService.updatePlatformConfigByKey(platformKey, platformValue);
if(res > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
/**
* 根据platformKey查询信息
* @param platformKey
* @param request
* @return
*/
@GetMapping(value = "/getPlatformConfigByKey")
@ApiOperation(value = "根据platformKey查询信息")
public BaseResponseInfo getPlatformConfigByKey(@RequestParam("platformKey") String platformKey,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
PlatformConfig platformConfig = platformConfigService.getPlatformConfigByKey(platformKey);
res.code = 200;
res.data = platformConfig;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
}
package com.jsh.erp.controller;
import com.gitee.starblues.integration.application.PluginApplication;
import com.gitee.starblues.integration.operator.PluginOperator;
import com.gitee.starblues.integration.operator.module.PluginInfo;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.User;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ComputerInfo;
import com.jsh.erp.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.nio.file.Paths;
import java.util.*;
/**
* 插件jar 包测试功能
* @author jishenghua
* @version 1.0
*/
@RestController
@RequestMapping("/plugin")
@Api(tags = {"插件管理"})
public class PluginController {
@Resource
private UserService userService;
// private final PluginOperator pluginOperator;
private PluginOperator pluginOperator;
@Autowired
public PluginController(PluginApplication pluginApplication) {
this.pluginOperator = pluginApplication.getPluginOperator();
}
/**
* 获取插件信息
* @return 返回插件信息
*/
@GetMapping(value = "/list")
@ApiOperation(value = "获取插件信息")
public BaseResponseInfo getPluginInfo(@RequestParam(value = "name",required = false) String name,
@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {
List<PluginInfo> resList = new ArrayList<>();
User userInfo = userService.getCurrentUser();
if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
List<PluginInfo> list = pluginOperator.getPluginInfo();
if (StringUtil.isEmpty(name)) {
resList = list;
} else {
for (PluginInfo pi : list) {
String desc = pi.getPluginDescriptor().getPluginDescription();
if (desc.contains(name)) {
resList.add(pi);
}
}
}
}
map.put("rows", resList);
map.put("total", resList.size());
res.code = 200;
res.data = map;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 获取插件jar文件名
* @return 获取插件文件名。只在生产环境显示
*/
@GetMapping("/files")
@ApiOperation(value = "获取插件jar文件名")
public Set<String> getPluginFilePaths(){
try {
User userInfo = userService.getCurrentUser();
if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
return pluginOperator.getPluginFilePaths();
} else {
return null;
}
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 根据插件id停止插件
* @param id 插件id
* @return 返回操作结果
*/
@PostMapping("/stop/{id}")
@ApiOperation(value = "根据插件id停止插件")
public BaseResponseInfo stop(@PathVariable("id") String id){
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
String message = "";
try {
User userInfo = userService.getCurrentUser();
if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
if (pluginOperator.stop(id)) {
message = "plugin '" + id + "' stop success";
} else {
message = "plugin '" + id + "' stop failure";
}
} else {
message = "power is limit";
}
map.put("message", message);
res.code = 200;
res.data = map;
} catch (Exception e) {
e.printStackTrace();
map.put("message", "plugin '" + id +"' stop failure. " + e.getMessage());
res.code = 500;
res.data = map;
}
return res;
}
/**
* 根据插件id启动插件
* @param id 插件id
* @return 返回操作结果
*/
@PostMapping("/start/{id}")
@ApiOperation(value = "根据插件id启动插件")
public BaseResponseInfo start(@PathVariable("id") String id){
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
String message = "";
try {
User userInfo = userService.getCurrentUser();
if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
if (pluginOperator.start(id)) {
message = "plugin '" + id + "' start success";
} else {
message = "plugin '" + id + "' start failure";
}
} else {
message = "power is limit";
}
map.put("message", message);
res.code = 200;
res.data = map;
} catch (Exception e) {
e.printStackTrace();
map.put("message", "plugin '" + id +"' start failure. " + e.getMessage());
res.code = 500;
res.data = map;
}
return res;
}
/**
* 根据插件id卸载插件
* @param id 插件id
* @return 返回操作结果
*/
@PostMapping("/uninstall/{id}")
@ApiOperation(value = "根据插件id卸载插件")
public BaseResponseInfo uninstall(@PathVariable("id") String id){
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
String message = "";
try {
User userInfo = userService.getCurrentUser();
if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
if (pluginOperator.uninstall(id, true)) {
message = "plugin '" + id + "' uninstall success";
} else {
message = "plugin '" + id + "' uninstall failure";
}
} else {
message = "power is limit";
}
map.put("message", message);
res.code = 200;
res.data = map;
} catch (Exception e) {
e.printStackTrace();
map.put("message", "plugin '" + id +"' uninstall failure. " + e.getMessage());
res.code = 500;
res.data = map;
}
return res;
}
/**
* 根据插件路径安装插件。该插件jar必须在服务器上存在。注意: 该操作只适用于生产环境
* @param path 插件路径名称
* @return 操作结果
*/
@PostMapping("/installByPath")
@ApiOperation(value = "根据插件路径安装插件")
public String install(@RequestParam("path") String path){
try {
User userInfo = userService.getCurrentUser();
if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
if (pluginOperator.install(Paths.get(path))) {
return "installByPath success";
} else {
return "installByPath failure";
}
} else {
return "installByPath failure";
}
} catch (Exception e) {
e.printStackTrace();
return "installByPath failure : " + e.getMessage();
}
}
/**
* 上传并安装插件。注意: 该操作只适用于生产环境
* @param file 上传文件 multipartFile
* @return 操作结果
*/
@PostMapping("/uploadInstallPluginJar")
@ApiOperation(value = "上传并安装插件")
public BaseResponseInfo install(MultipartFile file, HttpServletRequest request, HttpServletResponse response){
BaseResponseInfo res = new BaseResponseInfo();
try {
User userInfo = userService.getCurrentUser();
if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
pluginOperator.uploadPluginAndStart(file);
res.code = 200;
res.data = "导入成功";
} else {
res.code = 500;
res.data = "抱歉,无操作权限!";
}
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "导入失败";
}
return res;
}
/**
* 上传插件的配置文件。注意: 该操作只适用于生产环境
* @param multipartFile 上传文件 multipartFile
* @return 操作结果
*/
@PostMapping("/uploadPluginConfigFile")
@ApiOperation(value = "上传插件的配置文件")
public String uploadConfig(@RequestParam("configFile") MultipartFile multipartFile){
try {
User userInfo = userService.getCurrentUser();
if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
if (pluginOperator.uploadConfigFile(multipartFile)) {
return "uploadConfig success";
} else {
return "uploadConfig failure";
}
} else {
return "installByPath failure";
}
} catch (Exception e) {
e.printStackTrace();
return "uploadConfig failure : " + e.getMessage();
}
}
/**
* 备份插件。注意: 该操作只适用于生产环境
* @param pluginId 插件id
* @return 操作结果
*/
@PostMapping("/back/{pluginId}")
@ApiOperation(value = "备份插件")
public String backupPlugin(@PathVariable("pluginId") String pluginId){
try {
User userInfo = userService.getCurrentUser();
if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
if (pluginOperator.backupPlugin(pluginId, "testBack")) {
return "backupPlugin success";
} else {
return "backupPlugin failure";
}
} else {
return "backupPlugin failure";
}
} catch (Exception e) {
e.printStackTrace();
return "backupPlugin failure : " + e.getMessage();
}
}
/**
* 获取加密后的mac
* @return
*/
@GetMapping("/getMacWithSecret")
@ApiOperation(value = "获取加密后的mac")
public BaseResponseInfo getMacWithSecret(){
BaseResponseInfo res = new BaseResponseInfo();
try {
String mac = ComputerInfo.getMacAddress();
res.code = 200;
res.data = DigestUtils.md5DigestAsHex(mac.getBytes());
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.service.CommonQueryManager;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* by jishenghua 2018-9-12 23:58:10 华夏erp
*/
@RestController
@Api(tags = {"资源接口"})
public class ResourceController {
@Resource
private CommonQueryManager configResourceManager;
@GetMapping(value = "/{apiName}/info")
@ApiOperation(value = "根据id获取信息")
public String getList(@PathVariable("apiName") String apiName,
@RequestParam("id") Long id,
HttpServletRequest request) throws Exception {
Object obj = configResourceManager.selectOne(apiName, id);
Map<String, Object> objectMap = new HashMap<String, Object>();
if(obj != null) {
objectMap.put("info", obj);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@GetMapping(value = "/{apiName}/list")
@ApiOperation(value = "获取信息列表")
public String getList(@PathVariable("apiName") String apiName,
@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
Map<String, String> parameterMap = ParamUtils.requestToMap(request);
parameterMap.put(Constants.SEARCH, search);
Map<String, Object> objectMap = new HashMap<String, Object>();
if (pageSize != null && pageSize <= 0) {
pageSize = 10;
}
String offset = ParamUtils.getPageOffset(currentPage, pageSize);
if (StringUtil.isNotEmpty(offset)) {
parameterMap.put(Constants.OFFSET, offset);
}
List<?> list = configResourceManager.select(apiName, parameterMap);
if (list != null) {
objectMap.put("total", configResourceManager.counts(apiName, parameterMap));
objectMap.put("rows", list);
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER);
objectMap.put("rows", new ArrayList<Object>());
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
}
@PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "新增")
public String addResource(@PathVariable("apiName") String apiName,
@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int insert = configResourceManager.insert(apiName, obj, request);
if(insert > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else if(insert == -1) {
return returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@PutMapping(value = "/{apiName}/update", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "修改")
public String updateResource(@PathVariable("apiName") String apiName,
@RequestBody JSONObject obj, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int update = configResourceManager.update(apiName, obj, request);
if(update > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else if(update == -1) {
return returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@DeleteMapping(value = "/{apiName}/delete", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "删除")
public String deleteResource(@PathVariable("apiName") String apiName,
@RequestParam("id") Long id, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int delete = configResourceManager.delete(apiName, id, request);
if(delete > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else if(delete == -1) {
return returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@DeleteMapping(value = "/{apiName}/deleteBatch", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "批量删除")
public String batchDeleteResource(@PathVariable("apiName") String apiName,
@RequestParam("ids") String ids, HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int delete = configResourceManager.deleteBatch(apiName, ids, request);
if(delete > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else if(delete == -1) {
return returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
@GetMapping(value = "/{apiName}/checkIsNameExist")
@ApiOperation(value = "检查名称是否存在")
public String checkIsNameExist(@PathVariable("apiName") String apiName,
@RequestParam Long id, @RequestParam(value ="name", required = false) String name,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
int exist = configResourceManager.checkIsNameExist(apiName, id, name);
if(exist > 0) {
objectMap.put("status", true);
} else {
objectMap.put("status", false);
}
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.entities.Role;
import com.jsh.erp.service.role.RoleService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* @author ji sheng hua jshERP
*/
@RestController
@RequestMapping(value = "/role")
@Api(tags = {"角色管理"})
public class RoleController {
private Logger logger = LoggerFactory.getLogger(RoleController.class);
@Resource
private RoleService roleService;
@Resource
private UserBusinessService userBusinessService;
/**
* 角色对应应用显示
* @param request
* @return
*/
@GetMapping(value = "/findUserRole")
@ApiOperation(value = "查询用户的角色")
public JSONArray findUserRole(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray();
try {
//获取权限信息
String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId);
List<Role> dataList = roleService.findUserRole();
if (null != dataList) {
for (Role role : dataList) {
JSONObject item = new JSONObject();
item.put("id", role.getId());
item.put("text", role.getName());
Boolean flag = ubValue.contains("[" + role.getId().toString() + "]");
if (flag) {
item.put("checked", true);
}
arr.add(item);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return arr;
}
@GetMapping(value = "/allList")
@ApiOperation(value = "查询全部角色列表")
public List<Role> allList(HttpServletRequest request)throws Exception {
return roleService.allList();
}
/**
* 批量设置状态-启用或者禁用
* @param jsonObject
* @param request
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
Boolean status = jsonObject.getBoolean("status");
String ids = jsonObject.getString("ids");
Map<String, Object> objectMap = new HashMap<>();
int res = roleService.batchSetStatus(status, ids);
if(res > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
}
package com.jsh.erp.controller;
import com.jsh.erp.service.depotHead.DepotHeadService;
import com.jsh.erp.service.sequence.SequenceService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* @author ji-sheng-hua 752*718*920
*/
@RestController
@RequestMapping(value = "/sequence")
@Api(tags = {"单据编号"})
public class SequenceController {
private Logger logger = LoggerFactory.getLogger(SequenceController.class);
@Resource
private SequenceService sequenceService;
/**
* 单据编号生成接口
* @param request
* @return
*/
@GetMapping(value = "/buildNumber")
@ApiOperation(value = "单据编号生成接口")
public BaseResponseInfo buildNumber(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {
String number = sequenceService.buildOnlyNumber();
map.put("defaultNumber", number);
res.code = 200;
res.data = map;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.entities.DepotItem;
import com.jsh.erp.datasource.entities.SerialNumberEx;
import com.jsh.erp.service.depotHead.DepotHeadService;
import com.jsh.erp.service.depotItem.DepotItemService;
import com.jsh.erp.service.serialNumber.SerialNumberService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import com.jsh.erp.utils.Tools;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* Description
*
* @Author: cjl
* @Date: 2019/1/22 10:29
*/
@RestController
@RequestMapping(value = "/serialNumber")
@Api(tags = {"序列号管理"})
public class SerialNumberController {
private Logger logger = LoggerFactory.getLogger(SerialNumberController.class);
@Resource
private SerialNumberService serialNumberService;
@Resource
private DepotHeadService depotHeadService;
@Resource
private DepotItemService depotItemService;
/**
* create by: cjl
* description:
*批量添加序列号
* create time: 2019/1/29 15:11
* @Param: materialName
* @Param: serialNumberPrefix
* @Param: batAddTotal
* @Param: remark
* @return java.lang.Object
*/
@PostMapping("/batAddSerialNumber")
@ApiOperation(value = "批量添加序列号")
public String batAddSerialNumber(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception{
Map<String, Object> objectMap = new HashMap<>();
String materialCode = jsonObject.getString("materialCode");
String serialNumberPrefix = jsonObject.getString("serialNumberPrefix");
Integer batAddTotal = jsonObject.getInteger("batAddTotal");
String remark = jsonObject.getString("remark");
int insert = serialNumberService.batAddSerialNumber(materialCode,serialNumberPrefix,batAddTotal,remark);
if(insert > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else if(insert == -1) {
return returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
/**
* 获取序列号商品
* @param name
* @param depotId
* @param barCode
* @param currentPage
* @param pageSize
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getEnableSerialNumberList")
@ApiOperation(value = "获取序列号商品")
public BaseResponseInfo getEnableSerialNumberList(@RequestParam("name") String name,
@RequestParam("depotItemId") Long depotItemId,
@RequestParam("depotId") Long depotId,
@RequestParam("barCode") String barCode,
@RequestParam("page") Integer currentPage,
@RequestParam("rows") Integer pageSize,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<>();
try {
String number = "";
if(depotItemId != null) {
DepotItem depotItem = depotItemService.getDepotItem(depotItemId);
number = depotHeadService.getDepotHead(depotItem.getHeaderId()).getNumber();
}
List<SerialNumberEx> list = serialNumberService.getEnableSerialNumberList(number, name, depotId, barCode, (currentPage-1)*pageSize, pageSize);
for(SerialNumberEx serialNumberEx: list) {
serialNumberEx.setCreateTimeStr(Tools.getCenternTime(serialNumberEx.getCreateTime()));
}
Long total = serialNumberService.getEnableSerialNumberCount(number, name, depotId, barCode);
map.put("rows", list);
map.put("total", total);
res.code = 200;
res.data = map;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Supplier;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.supplier.SupplierService;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jxl.Sheet;
import jxl.Workbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DataAccessException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* @author ji|sheng|hua 华夏erp
*/
@RestController
@RequestMapping(value = "/supplier")
@Api(tags = {"商家管理"})
public class SupplierController {
private Logger logger = LoggerFactory.getLogger(SupplierController.class);
@Resource
private SupplierService supplierService;
@Resource
private UserBusinessService userBusinessService;
@Resource
private SystemConfigService systemConfigService;
@Resource
private UserService userService;
@GetMapping(value = "/checkIsNameAndTypeExist")
@ApiOperation(value = "检查名称和类型是否存在")
public String checkIsNameAndTypeExist(@RequestParam Long id,
@RequestParam(value ="name", required = false) String name,
@RequestParam(value ="type") String type,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<>();
int exist = supplierService.checkIsNameAndTypeExist(id, name, type);
if(exist > 0) {
objectMap.put("status", true);
} else {
objectMap.put("status", false);
}
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
/**
* 查找客户信息-下拉框
* @param request
* @return
*/
@PostMapping(value = "/findBySelect_cus")
@ApiOperation(value = "查找客户信息")
public JSONArray findBySelectCus(HttpServletRequest request) {
JSONArray arr = new JSONArray();
try {
String type = "UserCustomer";
Long userId = userService.getUserId(request);
//获取权限信息
String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString());
List<Supplier> supplierList = supplierService.findBySelectCus();
JSONArray dataArray = new JSONArray();
if (null != supplierList) {
boolean customerFlag = systemConfigService.getCustomerFlag();
for (Supplier supplier : supplierList) {
JSONObject item = new JSONObject();
Boolean flag = ubValue.contains("[" + supplier.getId().toString() + "]");
if (!customerFlag || flag) {
item.put("id", supplier.getId());
item.put("supplier", supplier.getSupplier()); //客户名称
dataArray.add(item);
}
}
}
arr = dataArray;
} catch(Exception e){
e.printStackTrace();
}
return arr;
}
/**
* 查找供应商信息-下拉框
* @param request
* @return
*/
@PostMapping(value = "/findBySelect_sup")
@ApiOperation(value = "查找供应商信息")
public JSONArray findBySelectSup(HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray();
try {
List<Supplier> supplierList = supplierService.findBySelectSup();
JSONArray dataArray = new JSONArray();
if (null != supplierList) {
for (Supplier supplier : supplierList) {
JSONObject item = new JSONObject();
item.put("id", supplier.getId());
//供应商名称
item.put("supplier", supplier.getSupplier());
dataArray.add(item);
}
}
arr = dataArray;
} catch(Exception e){
e.printStackTrace();
}
return arr;
}
/**
* 查找往来单位,含供应商和客户信息-下拉框
* @param request
* @return
*/
@PostMapping(value = "/findBySelect_organ")
@ApiOperation(value = "查找往来单位,含供应商和客户信息")
public JSONArray findBySelectOrgan(HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray();
try {
JSONArray dataArray = new JSONArray();
//1、获取供应商信息
List<Supplier> supplierList = supplierService.findBySelectSup();
if (null != supplierList) {
for (Supplier supplier : supplierList) {
JSONObject item = new JSONObject();
item.put("id", supplier.getId());
item.put("supplier", supplier.getSupplier() + "[供应商]"); //供应商名称
dataArray.add(item);
}
}
//2、获取客户信息
String type = "UserCustomer";
Long userId = userService.getUserId(request);
String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString());
List<Supplier> customerList = supplierService.findBySelectCus();
if (null != customerList) {
boolean customerFlag = systemConfigService.getCustomerFlag();
for (Supplier supplier : customerList) {
JSONObject item = new JSONObject();
Boolean flag = ubValue.contains("[" + supplier.getId().toString() + "]");
if (!customerFlag || flag) {
item.put("id", supplier.getId());
item.put("supplier", supplier.getSupplier() + "[客户]"); //客户名称
dataArray.add(item);
}
}
}
arr = dataArray;
} catch(Exception e){
e.printStackTrace();
}
return arr;
}
/**
* 查找会员信息-下拉框
* @param request
* @return
*/
@PostMapping(value = "/findBySelect_retail")
@ApiOperation(value = "查找会员信息")
public JSONArray findBySelectRetail(HttpServletRequest request)throws Exception {
JSONArray arr = new JSONArray();
try {
List<Supplier> supplierList = supplierService.findBySelectRetail();
JSONArray dataArray = new JSONArray();
if (null != supplierList) {
for (Supplier supplier : supplierList) {
JSONObject item = new JSONObject();
item.put("id", supplier.getId());
//客户名称
item.put("supplier", supplier.getSupplier());
item.put("advanceIn", supplier.getAdvanceIn()); //预付款金额
dataArray.add(item);
}
}
arr = dataArray;
} catch(Exception e){
e.printStackTrace();
}
return arr;
}
/**
* 批量设置状态-启用或者禁用
* @param jsonObject
* @param request
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
Boolean status = jsonObject.getBoolean("status");
String ids = jsonObject.getString("ids");
Map<String, Object> objectMap = new HashMap<>();
int res = supplierService.batchSetStatus(status, ids);
if(res > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
/**
* 用户对应客户显示
* @param type
* @param keyId
* @param request
* @return
*/
@GetMapping(value = "/findUserCustomer")
@ApiOperation(value = "用户对应客户显示")
public JSONArray findUserCustomer(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray();
try {
//获取权限信息
String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId);
List<Supplier> dataList = supplierService.findUserCustomer();
//开始拼接json数据
JSONObject outer = new JSONObject();
outer.put("id", 0);
outer.put("key", 0);
outer.put("value", 0);
outer.put("title", "客户列表");
outer.put("attributes", "客户列表");
//存放数据json数组
JSONArray dataArray = new JSONArray();
if (null != dataList) {
for (Supplier supplier : dataList) {
JSONObject item = new JSONObject();
item.put("id", supplier.getId());
item.put("key", supplier.getId());
item.put("value", supplier.getId());
item.put("title", supplier.getSupplier());
item.put("attributes", supplier.getSupplier());
Boolean flag = ubValue.contains("[" + supplier.getId().toString() + "]");
if (flag) {
item.put("checked", true);
}
dataArray.add(item);
}
}
outer.put("children", dataArray);
arr.add(outer);
} catch (Exception e) {
e.printStackTrace();
}
return arr;
}
/**
* 导入供应商
* @param file
* @param request
* @param response
* @return
*/
@PostMapping(value = "/importVendor")
@ApiOperation(value = "导入供应商")
public BaseResponseInfo importVendor(MultipartFile file,
HttpServletRequest request, HttpServletResponse response) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
supplierService.importVendor(file, request);
res.code = 200;
res.data = "导入成功";
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "导入失败";
}
return res;
}
/**
* 导入客户
* @param file
* @param request
* @param response
* @return
*/
@PostMapping(value = "/importCustomer")
@ApiOperation(value = "导入客户")
public BaseResponseInfo importCustomer(MultipartFile file,
HttpServletRequest request, HttpServletResponse response) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
supplierService.importCustomer(file, request);
res.code = 200;
res.data = "导入成功";
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "导入失败";
}
return res;
}
/**
* 导入会员
* @param file
* @param request
* @param response
* @return
*/
@PostMapping(value = "/importMember")
@ApiOperation(value = "导入会员")
public BaseResponseInfo importMember(MultipartFile file,
HttpServletRequest request, HttpServletResponse response) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
supplierService.importMember(file, request);
res.code = 200;
res.data = "导入成功";
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "导入失败";
}
return res;
}
/**
* 生成excel表格
* @param supplier
* @param type
* @param phonenum
* @param telephone
* @param request
* @param response
* @return
*/
@GetMapping(value = "/exportExcel")
public void exportExcel(@RequestParam(value = "supplier", required = false) String supplier,
@RequestParam("type") String type,
@RequestParam(value = "phonenum", required = false) String phonenum,
@RequestParam(value = "telephone", required = false) String telephone,
HttpServletRequest request, HttpServletResponse response) {
try {
List<Supplier> dataList = supplierService.findByAll(supplier, type, phonenum, telephone);
File file = supplierService.exportExcel(dataList, type);
ExportExecUtil.showExec(file, file.getName(), response);
} catch (Exception e) {
e.printStackTrace();
}
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Depot;
import com.jsh.erp.datasource.entities.SystemConfig;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.depot.DepotService;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.FileUtils;
import com.jsh.erp.utils.StringUtil;
import com.jsh.erp.utils.Tools;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.DataAccessException;
import org.springframework.util.AntPathMatcher;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.HandlerMapping;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.List;
/**
* Description
* @Author: jishenghua
* @Date: 2021-3-13 0:01
*/
@RestController
@RequestMapping(value = "/systemConfig")
@Api(tags = {"系统参数"})
public class SystemConfigController {
private Logger logger = LoggerFactory.getLogger(SystemConfigController.class);
@Resource
private UserService userService;
@Resource
private DepotService depotService;
@Resource
private UserBusinessService userBusinessService;
@Resource
private SystemConfigService systemConfigService;
@Value(value="${file.path}")
private String filePath;
@Value(value="${spring.servlet.multipart.max-file-size}")
private Long maxFileSize;
@Value(value="${spring.servlet.multipart.max-request-size}")
private Long maxRequestSize;
/**
* 获取当前租户的配置信息
* @param request
* @return
*/
@GetMapping(value = "/getCurrentInfo")
@ApiOperation(value = "获取当前租户的配置信息")
public BaseResponseInfo getCurrentInfo(HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try{
List<SystemConfig> list = systemConfigService.getSystemConfig();
res.code = 200;
if(list.size()>0) {
res.data = list.get(0);
}
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 获取文件大小限制
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/fileSizeLimit")
@ApiOperation(value = "获取文件大小限制")
public BaseResponseInfo fileSizeLimit(HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try{
Long limit = 0L;
if(maxFileSize<maxRequestSize) {
limit = maxFileSize;
} else {
limit = maxRequestSize;
}
res.code = 200;
res.data = limit;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 文件上传统一方法
* @param request
* @param response
* @return
*/
@PostMapping(value = "/upload")
@ApiOperation(value = "文件上传统一方法")
public BaseResponseInfo upload(HttpServletRequest request, HttpServletResponse response) {
BaseResponseInfo res = new BaseResponseInfo();
try {
String savePath = "";
String bizPath = request.getParameter("biz");
String name = request.getParameter("name");
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象
if(StringUtil.isEmpty(bizPath)){
bizPath = "";
}
String token = request.getHeader("X-Access-Token");
Long tenantId = Tools.getTenantIdByToken(token);
bizPath = bizPath + File.separator + tenantId;
savePath = this.uploadLocal(file, bizPath, name);
if(StringUtil.isNotEmpty(savePath)){
res.code = 200;
res.data = savePath;
}else {
res.code = 500;
res.data = "上传失败!";
}
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "上传失败!";
}
return res;
}
/**
* 本地文件上传
* @param mf 文件
* @param bizPath 自定义路径
* @return
*/
private String uploadLocal(MultipartFile mf,String bizPath,String name){
try {
String ctxPath = filePath;
String fileName = null;
File file = new File(ctxPath + File.separator + bizPath + File.separator );
if (!file.exists()) {
file.mkdirs();// 创建文件根目录
}
String orgName = mf.getOriginalFilename();// 获取文件名
orgName = FileUtils.getFileName(orgName);
if(orgName.indexOf(".")!=-1){
if(StringUtil.isNotEmpty(name)) {
fileName = name.substring(0, name.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf("."));
} else {
fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf("."));
}
}else{
fileName = orgName+ "_" + System.currentTimeMillis();
}
String savePath = file.getPath() + File.separator + fileName;
File savefile = new File(savePath);
FileCopyUtils.copy(mf.getBytes(), savefile);
String dbpath = null;
if(StringUtil.isNotEmpty(bizPath)){
dbpath = bizPath + File.separator + fileName;
}else{
dbpath = fileName;
}
if (dbpath.contains("\\")) {
dbpath = dbpath.replace("\\", "/");
}
return dbpath;
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
return "";
}
/**
* 预览图片&下载文件
* 请求地址:http://localhost:8080/common/static/{financial/afsdfasdfasdf_1547866868179.txt}
*
* @param request
* @param response
*/
@GetMapping(value = "/static/**")
@ApiOperation(value = "预览图片&下载文件")
public void view(HttpServletRequest request, HttpServletResponse response) {
// ISO-8859-1 ==> UTF-8 进行编码转换
String imgPath = extractPathFromPattern(request);
if(StringUtil.isEmpty(imgPath) || imgPath=="null"){
return;
}
// 其余处理略
InputStream inputStream = null;
OutputStream outputStream = null;
try {
imgPath = imgPath.replace("..", "");
if (imgPath.endsWith(",")) {
imgPath = imgPath.substring(0, imgPath.length() - 1);
}
String fileUrl = filePath + File.separator + imgPath;
File file = new File(fileUrl);
if(!file.exists()){
response.setStatus(404);
throw new RuntimeException("文件不存在..");
}
response.setContentType("application/force-download");// 设置强制下载不打开
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1"));
inputStream = new BufferedInputStream(new FileInputStream(fileUrl));
outputStream = response.getOutputStream();
byte[] buf = new byte[1024];
int len;
while ((len = inputStream.read(buf)) > 0) {
outputStream.write(buf, 0, len);
}
response.flushBuffer();
} catch (IOException e) {
logger.error("预览文件失败" + e.getMessage());
response.setStatus(404);
e.printStackTrace();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}
}
}
/**
* 把指定URL后的字符串全部截断当成参数
* 这么做是为了防止URL中包含中文或者特殊字符(/等)时,匹配不了的问题
* @param request
* @return
*/
private static String extractPathFromPattern(final HttpServletRequest request) {
String path = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
String bestMatchPattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);
return new AntPathMatcher().extractPathWithinPattern(bestMatchPattern, path);
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Tenant;
import com.jsh.erp.datasource.entities.User;
import com.jsh.erp.datasource.entities.UserEx;
import com.jsh.erp.datasource.vo.TreeNodeEx;
import com.jsh.erp.exception.BusinessParamCheckingException;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.tenant.TenantService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* @author ji_sheng_hua 华夏erp
*/
@RestController
@RequestMapping(value = "/tenant")
@Api(tags = {"租户管理"})
public class TenantController {
private Logger logger = LoggerFactory.getLogger(TenantController.class);
@Resource
private TenantService tenantService;
/**
* 批量设置状态-启用或者禁用
* @param jsonObject
* @param request
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
Boolean status = jsonObject.getBoolean("status");
String ids = jsonObject.getString("ids");
Map<String, Object> objectMap = new HashMap<>();
int res = tenantService.batchSetStatus(status, ids);
if(res > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.entities.Unit;
import com.jsh.erp.service.unit.UnitService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* Description
*
* @Author: qiankunpingtai
* @Date: 2019/4/1 15:38
*/
@RestController
@RequestMapping(value = "/unit")
@Api(tags = {"单位管理"})
public class UnitController {
@Resource
private UnitService unitService;
/**
* 单位列表
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getAllList")
@ApiOperation(value = "单位列表")
public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
List<Unit> unitList = unitService.getUnit();
res.code = 200;
res.data = unitList;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/**
* 批量设置状态-启用或者禁用
* @param jsonObject
* @param request
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
Boolean status = jsonObject.getBoolean("status");
String ids = jsonObject.getString("ids");
Map<String, Object> objectMap = new HashMap<>();
int res = unitService.batchSetStatus(status, ids);
if(res > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.UserBusiness;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import com.jsh.erp.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* @author ji_sheng_hua jshERP
*/
@RestController
@RequestMapping(value = "/userBusiness")
@Api(tags = {"用户角色模块的关系"})
public class UserBusinessController {
private Logger logger = LoggerFactory.getLogger(UserBusinessController.class);
@Resource
private UserBusinessService userBusinessService;
@Resource
private UserService userService;
/**
* 获取信息
* @param keyId
* @param type
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getBasicData")
@ApiOperation(value = "获取信息")
public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId,
@RequestParam(value = "Type") String type,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
List<UserBusiness> list = userBusinessService.getBasicData(keyId, type);
Map<String, List> mapData = new HashMap<String, List>();
mapData.put("userBusinessList", list);
res.code = 200;
res.data = mapData;
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "查询权限失败";
}
return res;
}
/**
* 校验存在
* @param type
* @param keyId
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/checkIsValueExist")
@ApiOperation(value = "校验存在")
public String checkIsValueExist(@RequestParam(value ="type", required = false) String type,
@RequestParam(value ="keyId", required = false) String keyId,
HttpServletRequest request)throws Exception {
Map<String, Object> objectMap = new HashMap<String, Object>();
Long id = userBusinessService.checkIsValueExist(type, keyId);
if(id != null) {
objectMap.put("id", id);
} else {
objectMap.put("id", null);
}
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
/**
* 更新角色的按钮权限
* @param jsonObject
* @param request
* @return
*/
@PostMapping(value = "/updateBtnStr")
@ApiOperation(value = "更新角色的按钮权限")
public BaseResponseInfo updateBtnStr(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
String roleId = jsonObject.getString("roleId");
String btnStr = jsonObject.getString("btnStr");
String keyId = roleId;
String type = "RoleFunctions";
int back = userBusinessService.updateBtnStr(keyId, type, btnStr);
if(back > 0) {
res.code = 200;
res.data = "成功";
}
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "更新权限失败";
}
return res;
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.SysLoginModel;
import com.jsh.erp.datasource.entities.Tenant;
import com.jsh.erp.datasource.entities.User;
import com.jsh.erp.datasource.entities.UserEx;
import com.jsh.erp.datasource.vo.TreeNodeEx;
import com.jsh.erp.exception.BusinessParamCheckingException;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.redis.RedisService;
import com.jsh.erp.service.role.RoleService;
import com.jsh.erp.service.tenant.TenantService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* @author ji_sheng_hua 华夏erp
*/
@RestController
@RequestMapping(value = "/user")
@Api(tags = {"用户管理"})
public class UserController {
private Logger logger = LoggerFactory.getLogger(UserController.class);
@Value("${manage.roleId}")
private Integer manageRoleId;
@Resource
private UserService userService;
@Resource
private RoleService roleService;
@Resource
private TenantService tenantService;
@Resource
private LogService logService;
@Resource
private RedisService redisService;
private static final String TEST_USER = "jsh";
private static String SUCCESS = "操作成功";
private static String ERROR = "操作失败";
private static final String HTTP = "http://";
private static final String CODE_OK = "200";
private static final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
@PostMapping(value = "/login")
@ApiOperation(value = "登录")
public BaseResponseInfo login(@RequestBody User userParam,
HttpServletRequest request)throws Exception {
logger.info("============用户登录 login 方法调用开始==============");
String msgTip = "";
User user=null;
BaseResponseInfo res = new BaseResponseInfo();
try {
String loginName = userParam.getLoginName().trim();
String password = userParam.getPassword().trim();
//判断用户是否已经登录过,登录过不再处理
Object userId = redisService.getObjectFromSessionByKey(request,"userId");
if (userId != null) {
logger.info("====用户已经登录过, login 方法调用结束====");
msgTip = "user already login";
}
//获取用户状态
int userStatus = -1;
try {
redisService.deleteObjectBySession(request,"userId");
userStatus = userService.validateUser(loginName, password);
} catch (Exception e) {
e.printStackTrace();
logger.error(">>>>>>>>>>>>>用户 " + loginName + " 登录 login 方法 访问服务层异常====", e);
msgTip = "access service exception";
}
String token = UUID.randomUUID().toString().replaceAll("-", "") + "";
switch (userStatus) {
case ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST:
msgTip = "user is not exist";
break;
case ExceptionCodeConstants.UserExceptionCode.USER_PASSWORD_ERROR:
msgTip = "user password error";
break;
case ExceptionCodeConstants.UserExceptionCode.BLACK_USER:
msgTip = "user is black";
break;
case ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION:
msgTip = "access service error";
break;
case ExceptionCodeConstants.UserExceptionCode.BLACK_TENANT:
msgTip = "tenant is black";
break;
case ExceptionCodeConstants.UserExceptionCode.EXPIRE_TENANT:
msgTip = "tenant is expire";
break;
case ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT:
msgTip = "user can login";
//验证通过 ,可以登录,放入session,记录登录日志
user = userService.getUserByLoginName(loginName);
if(user.getTenantId()!=null) {
token = token + "_" + user.getTenantId();
}
redisService.storageObjectBySession(token,"userId",user.getId());
if(user.getTenantId()!=null) {
Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId());
if(tenant!=null) {
Long tenantId = tenant.getTenantId();
Integer userNumLimit = tenant.getUserNumLimit();
if(tenantId!=null) {
redisService.storageObjectBySession(token,"userNumLimit",userNumLimit); //用户限制数
}
}
}
break;
default:
break;
}
Map<String, Object> data = new HashMap<String, Object>();
data.put("msgTip", msgTip);
if(user!=null){
String roleType = userService.getRoleTypeByUserId(user.getId()).getType(); //角色类型
redisService.storageObjectBySession(token,"roleType",roleType);
redisService.storageObjectBySession(token,"clientIp", Tools.getLocalIp(request));
logService.insertLogWithUserId(user.getId(), user.getTenantId(), "用户",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_LOGIN).append(user.getLoginName()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
JSONArray btnStrArr = userService.getBtnStrArrById(user.getId());
data.put("token", token);
data.put("user", user);
//用户的按钮权限
if(!"admin".equals(user.getLoginName())){
data.put("userBtn", btnStrArr);
}
data.put("roleType", roleType);
}
res.code = 200;
res.data = data;
logger.info("===============用户登录 login 方法调用结束===============");
} catch(Exception e){
e.printStackTrace();
logger.error(e.getMessage());
res.code = 500;
res.data = "用户登录失败";
}
return res;
}
@GetMapping(value = "/getUserSession")
@ApiOperation(value = "获取用户信息")
public BaseResponseInfo getSessionUser(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Object> data = new HashMap<>();
Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString());
User user = userService.getUser(userId);
user.setPassword(null);
data.put("user", user);
res.code = 200;
res.data = data;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取session失败";
}
return res;
}
@GetMapping(value = "/logout")
@ApiOperation(value = "退出")
public BaseResponseInfo logout(HttpServletRequest request, HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
redisService.deleteObjectBySession(request,"userId");
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "退出失败";
}
return res;
}
@PostMapping(value = "/resetPwd")
@ApiOperation(value = "重置密码")
public String resetPwd(@RequestBody JSONObject jsonObject,
HttpServletRequest request) throws Exception {
Map<String, Object> objectMap = new HashMap<>();
Long id = jsonObject.getLong("id");
String password = "123456";
String md5Pwd = Tools.md5Encryp(password);
int update = userService.resetPwd(md5Pwd, id);
if(update > 0) {
return returnJson(objectMap, SUCCESS, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ERROR, ErpInfo.ERROR.code);
}
}
@PutMapping(value = "/updatePwd")
@ApiOperation(value = "更新密码")
public String updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception {
Integer flag = 0;
Map<String, Object> objectMap = new HashMap<String, Object>();
try {
String info = "";
Long userId = jsonObject.getLong("userId");
String oldpwd = jsonObject.getString("oldpassword");
String password = jsonObject.getString("password");
User user = userService.getUser(userId);
//必须和原始密码一致才可以更新密码
if (oldpwd.equalsIgnoreCase(user.getPassword())) {
user.setPassword(password);
flag = userService.updateUserByObj(user); //1-成功
info = "修改成功";
} else {
flag = 2; //原始密码输入错误
info = "原始密码输入错误";
}
objectMap.put("status", flag);
if(flag > 0) {
return returnJson(objectMap, info, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ERROR, ErpInfo.ERROR.code);
}
} catch (Exception e) {
logger.error(">>>>>>>>>>>>>修改用户ID为 : " + jsonObject.getLong("userId") + "密码信息失败", e);
flag = 3;
objectMap.put("status", flag);
return returnJson(objectMap, ERROR, ErpInfo.ERROR.code);
}
}
/**
* 获取全部用户数据列表
* @param request
* @return
*/
@GetMapping(value = "/getAllList")
@ApiOperation(value = "获取全部用户数据列表")
public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Object> data = new HashMap<String, Object>();
List<User> dataList = userService.getUser();
if(dataList!=null) {
data.put("userList", dataList);
}
res.code = 200;
res.data = data;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取失败";
}
return res;
}
/**
* 用户列表,用于用户下拉框
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getUserList")
@ApiOperation(value = "用户列表")
public JSONArray getUserList(HttpServletRequest request)throws Exception {
JSONArray dataArray = new JSONArray();
try {
List<User> dataList = userService.getUser();
if (null != dataList) {
for (User user : dataList) {
JSONObject item = new JSONObject();
item.put("id", user.getId());
item.put("userName", user.getUsername());
dataArray.add(item);
}
}
} catch(Exception e){
e.printStackTrace();
}
return dataArray;
}
/**
* create by: cjl
* description:
* 新增用户及机构和用户关系
* create time: 2019/3/8 16:06
* @Param: beanJson
* @return java.lang.Object
*/
@PostMapping("/addUser")
@ApiOperation(value = "新增用户")
@ResponseBody
public Object addUser(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
Long userNumLimit = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userNumLimit").toString());
Long count = userService.countUser(null,null);
if(count>= userNumLimit) {
throw new BusinessParamCheckingException(ExceptionConstants.USER_OVER_LIMIT_FAILED_CODE,
ExceptionConstants.USER_OVER_LIMIT_FAILED_MSG);
} else {
UserEx ue= JSONObject.parseObject(obj.toJSONString(), UserEx.class);
userService.addUserAndOrgUserRel(ue, request);
}
return result;
}
/**
* create by: cjl
* description:
* 修改用户及机构和用户关系
* create time: 2019/3/8 16:06
* @Param: beanJson
* @return java.lang.Object
*/
@PutMapping("/updateUser")
@ApiOperation(value = "修改用户")
@ResponseBody
public Object updateUser(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
UserEx ue= JSONObject.parseObject(obj.toJSONString(), UserEx.class);
userService.updateUserAndOrgUserRel(ue, request);
return result;
}
/**
* 注册用户
* @param ue
* @return
* @throws Exception
*/
@PostMapping(value = "/registerUser")
@ApiOperation(value = "注册用户")
public Object registerUser(@RequestBody UserEx ue,
HttpServletRequest request)throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
ue.setUsername(ue.getLoginName());
userService.checkUserNameAndLoginName(ue); //检查用户名和登录名
ue = userService.registerUser(ue,manageRoleId,request);
return result;
}
/**
* 获取机构用户树
* @return
* @throws Exception
*/
@RequestMapping("/getOrganizationUserTree")
@ApiOperation(value = "获取机构用户树")
public JSONArray getOrganizationUserTree()throws Exception{
JSONArray arr=new JSONArray();
List<TreeNodeEx> organizationUserTree= userService.getOrganizationUserTree();
if(organizationUserTree!=null&&organizationUserTree.size()>0){
for(TreeNodeEx node:organizationUserTree){
String str=JSON.toJSONString(node);
JSONObject obj=JSON.parseObject(str);
arr.add(obj) ;
}
}
return arr;
}
@GetMapping(value = "/getCurrentPriceLimit")
@ApiOperation(value = "查询当前用户的价格屏蔽")
public BaseResponseInfo getCurrentPriceLimit(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Object> data = new HashMap<>();
String priceLimit = roleService.getCurrentPriceLimit(request);
data.put("priceLimit", priceLimit);
res.code = 200;
res.data = data;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取session失败";
}
return res;
}
/**
* 获取当前用户的角色类型
* @param request
* @return
*/
@GetMapping("/getRoleTypeByCurrentUser")
@ApiOperation(value = "获取当前用户的角色类型")
public BaseResponseInfo getRoleTypeByCurrentUser(HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Object> data = new HashMap<String, Object>();
String roleType = redisService.getObjectFromSessionByKey(request,"roleType").toString();
data.put("roleType", roleType);
res.code = 200;
res.data = data;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取失败";
}
return res;
}
/**
* 获取随机校验码
* @param response
* @param key
* @return
*/
@GetMapping(value = "/randomImage/{key}")
@ApiOperation(value = "获取随机校验码")
public BaseResponseInfo randomImage(HttpServletResponse response,@PathVariable String key){
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Object> data = new HashMap<>();
String codeNum = Tools.getCharAndNum(4);
String base64 = RandImageUtil.generate(codeNum);
data.put("codeNum", codeNum);
data.put("base64", base64);
res.code = 200;
res.data = data;
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "获取失败";
}
return res;
}
/**
* 批量设置状态-启用或者禁用
* @param jsonObject
* @param request
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request)throws Exception {
Byte status = jsonObject.getByte("status");
String ids = jsonObject.getString("ids");
Map<String, Object> objectMap = new HashMap<>();
int res = userService.batchSetStatus(status, ids, request);
if(res > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}
/**
* 获取当前用户的用户数量和租户信息
* @param request
* @return
*/
@GetMapping(value = "/infoWithTenant")
@ApiOperation(value = "获取当前用户的用户数量和租户信息")
public BaseResponseInfo randomImage(HttpServletRequest request){
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Object> data = new HashMap<>();
Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString());
User user = userService.getUser(userId);
//获取当前用户数
int userCurrentNum = userService.getUser().size();
Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId());
data.put("type", tenant.getType()); //租户类型,0免费租户,1付费租户
data.put("expireTime", Tools.parseDateToStr(tenant.getExpireTime()));
data.put("userCurrentNum", userCurrentNum);
data.put("userNumLimit", tenant.getUserNumLimit());
res.code = 200;
res.data = data;
} catch (Exception e) {
e.printStackTrace();
res.code = 500;
res.data = "获取失败";
}
return res;
}
}
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
public class Account {
private Long id;
private String name;
private String serialNo;
private BigDecimal initialAmount;
private BigDecimal currentAmount;
private String remark;
private Boolean enabled;
private String sort;
private Boolean isDefault;
private Long tenantId;
private String deleteFlag;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo == null ? null : serialNo.trim();
}
public BigDecimal getInitialAmount() {
return initialAmount;
}
public void setInitialAmount(BigDecimal initialAmount) {
this.initialAmount = initialAmount;
}
public BigDecimal getCurrentAmount() {
return currentAmount;
}
public void setCurrentAmount(BigDecimal currentAmount) {
this.currentAmount = currentAmount;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort == null ? null : sort.trim();
}
public Boolean getIsDefault() {
return isDefault;
}
public void setIsDefault(Boolean isDefault) {
this.isDefault = isDefault;
}
public Long getTenantId() {
return tenantId;
}
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;
}
public String getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(String deleteFlag) {
this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim();
}
}
\ No newline at end of file
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class AccountExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public AccountExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andSerialNoIsNull() {
addCriterion("serial_no is null");
return (Criteria) this;
}
public Criteria andSerialNoIsNotNull() {
addCriterion("serial_no is not null");
return (Criteria) this;
}
public Criteria andSerialNoEqualTo(String value) {
addCriterion("serial_no =", value, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoNotEqualTo(String value) {
addCriterion("serial_no <>", value, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoGreaterThan(String value) {
addCriterion("serial_no >", value, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoGreaterThanOrEqualTo(String value) {
addCriterion("serial_no >=", value, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoLessThan(String value) {
addCriterion("serial_no <", value, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoLessThanOrEqualTo(String value) {
addCriterion("serial_no <=", value, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoLike(String value) {
addCriterion("serial_no like", value, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoNotLike(String value) {
addCriterion("serial_no not like", value, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoIn(List<String> values) {
addCriterion("serial_no in", values, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoNotIn(List<String> values) {
addCriterion("serial_no not in", values, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoBetween(String value1, String value2) {
addCriterion("serial_no between", value1, value2, "serialNo");
return (Criteria) this;
}
public Criteria andSerialNoNotBetween(String value1, String value2) {
addCriterion("serial_no not between", value1, value2, "serialNo");
return (Criteria) this;
}
public Criteria andInitialAmountIsNull() {
addCriterion("initial_amount is null");
return (Criteria) this;
}
public Criteria andInitialAmountIsNotNull() {
addCriterion("initial_amount is not null");
return (Criteria) this;
}
public Criteria andInitialAmountEqualTo(BigDecimal value) {
addCriterion("initial_amount =", value, "initialAmount");
return (Criteria) this;
}
public Criteria andInitialAmountNotEqualTo(BigDecimal value) {
addCriterion("initial_amount <>", value, "initialAmount");
return (Criteria) this;
}
public Criteria andInitialAmountGreaterThan(BigDecimal value) {
addCriterion("initial_amount >", value, "initialAmount");
return (Criteria) this;
}
public Criteria andInitialAmountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("initial_amount >=", value, "initialAmount");
return (Criteria) this;
}
public Criteria andInitialAmountLessThan(BigDecimal value) {
addCriterion("initial_amount <", value, "initialAmount");
return (Criteria) this;
}
public Criteria andInitialAmountLessThanOrEqualTo(BigDecimal value) {
addCriterion("initial_amount <=", value, "initialAmount");
return (Criteria) this;
}
public Criteria andInitialAmountIn(List<BigDecimal> values) {
addCriterion("initial_amount in", values, "initialAmount");
return (Criteria) this;
}
public Criteria andInitialAmountNotIn(List<BigDecimal> values) {
addCriterion("initial_amount not in", values, "initialAmount");
return (Criteria) this;
}
public Criteria andInitialAmountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("initial_amount between", value1, value2, "initialAmount");
return (Criteria) this;
}
public Criteria andInitialAmountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("initial_amount not between", value1, value2, "initialAmount");
return (Criteria) this;
}
public Criteria andCurrentAmountIsNull() {
addCriterion("current_amount is null");
return (Criteria) this;
}
public Criteria andCurrentAmountIsNotNull() {
addCriterion("current_amount is not null");
return (Criteria) this;
}
public Criteria andCurrentAmountEqualTo(BigDecimal value) {
addCriterion("current_amount =", value, "currentAmount");
return (Criteria) this;
}
public Criteria andCurrentAmountNotEqualTo(BigDecimal value) {
addCriterion("current_amount <>", value, "currentAmount");
return (Criteria) this;
}
public Criteria andCurrentAmountGreaterThan(BigDecimal value) {
addCriterion("current_amount >", value, "currentAmount");
return (Criteria) this;
}
public Criteria andCurrentAmountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("current_amount >=", value, "currentAmount");
return (Criteria) this;
}
public Criteria andCurrentAmountLessThan(BigDecimal value) {
addCriterion("current_amount <", value, "currentAmount");
return (Criteria) this;
}
public Criteria andCurrentAmountLessThanOrEqualTo(BigDecimal value) {
addCriterion("current_amount <=", value, "currentAmount");
return (Criteria) this;
}
public Criteria andCurrentAmountIn(List<BigDecimal> values) {
addCriterion("current_amount in", values, "currentAmount");
return (Criteria) this;
}
public Criteria andCurrentAmountNotIn(List<BigDecimal> values) {
addCriterion("current_amount not in", values, "currentAmount");
return (Criteria) this;
}
public Criteria andCurrentAmountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("current_amount between", value1, value2, "currentAmount");
return (Criteria) this;
}
public Criteria andCurrentAmountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("current_amount not between", value1, value2, "currentAmount");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andEnabledIsNull() {
addCriterion("enabled is null");
return (Criteria) this;
}
public Criteria andEnabledIsNotNull() {
addCriterion("enabled is not null");
return (Criteria) this;
}
public Criteria andEnabledEqualTo(Boolean value) {
addCriterion("enabled =", value, "enabled");
return (Criteria) this;
}
public Criteria andEnabledNotEqualTo(Boolean value) {
addCriterion("enabled <>", value, "enabled");
return (Criteria) this;
}
public Criteria andEnabledGreaterThan(Boolean value) {
addCriterion("enabled >", value, "enabled");
return (Criteria) this;
}
public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) {
addCriterion("enabled >=", value, "enabled");
return (Criteria) this;
}
public Criteria andEnabledLessThan(Boolean value) {
addCriterion("enabled <", value, "enabled");
return (Criteria) this;
}
public Criteria andEnabledLessThanOrEqualTo(Boolean value) {
addCriterion("enabled <=", value, "enabled");
return (Criteria) this;
}
public Criteria andEnabledIn(List<Boolean> values) {
addCriterion("enabled in", values, "enabled");
return (Criteria) this;
}
public Criteria andEnabledNotIn(List<Boolean> values) {
addCriterion("enabled not in", values, "enabled");
return (Criteria) this;
}
public Criteria andEnabledBetween(Boolean value1, Boolean value2) {
addCriterion("enabled between", value1, value2, "enabled");
return (Criteria) this;
}
public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) {
addCriterion("enabled not between", value1, value2, "enabled");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;
}
public Criteria andSortIsNotNull() {
addCriterion("sort is not null");
return (Criteria) this;
}
public Criteria andSortEqualTo(String value) {
addCriterion("sort =", value, "sort");
return (Criteria) this;
}
public Criteria andSortNotEqualTo(String value) {
addCriterion("sort <>", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThan(String value) {
addCriterion("sort >", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThanOrEqualTo(String value) {
addCriterion("sort >=", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThan(String value) {
addCriterion("sort <", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThanOrEqualTo(String value) {
addCriterion("sort <=", value, "sort");
return (Criteria) this;
}
public Criteria andSortLike(String value) {
addCriterion("sort like", value, "sort");
return (Criteria) this;
}
public Criteria andSortNotLike(String value) {
addCriterion("sort not like", value, "sort");
return (Criteria) this;
}
public Criteria andSortIn(List<String> values) {
addCriterion("sort in", values, "sort");
return (Criteria) this;
}
public Criteria andSortNotIn(List<String> values) {
addCriterion("sort not in", values, "sort");
return (Criteria) this;
}
public Criteria andSortBetween(String value1, String value2) {
addCriterion("sort between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andSortNotBetween(String value1, String value2) {
addCriterion("sort not between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andIsDefaultIsNull() {
addCriterion("is_default is null");
return (Criteria) this;
}
public Criteria andIsDefaultIsNotNull() {
addCriterion("is_default is not null");
return (Criteria) this;
}
public Criteria andIsDefaultEqualTo(Boolean value) {
addCriterion("is_default =", value, "isDefault");
return (Criteria) this;
}
public Criteria andIsDefaultNotEqualTo(Boolean value) {
addCriterion("is_default <>", value, "isDefault");
return (Criteria) this;
}
public Criteria andIsDefaultGreaterThan(Boolean value) {
addCriterion("is_default >", value, "isDefault");
return (Criteria) this;
}
public Criteria andIsDefaultGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_default >=", value, "isDefault");
return (Criteria) this;
}
public Criteria andIsDefaultLessThan(Boolean value) {
addCriterion("is_default <", value, "isDefault");
return (Criteria) this;
}
public Criteria andIsDefaultLessThanOrEqualTo(Boolean value) {
addCriterion("is_default <=", value, "isDefault");
return (Criteria) this;
}
public Criteria andIsDefaultIn(List<Boolean> values) {
addCriterion("is_default in", values, "isDefault");
return (Criteria) this;
}
public Criteria andIsDefaultNotIn(List<Boolean> values) {
addCriterion("is_default not in", values, "isDefault");
return (Criteria) this;
}
public Criteria andIsDefaultBetween(Boolean value1, Boolean value2) {
addCriterion("is_default between", value1, value2, "isDefault");
return (Criteria) this;
}
public Criteria andIsDefaultNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_default not between", value1, value2, "isDefault");
return (Criteria) this;
}
public Criteria andTenantIdIsNull() {
addCriterion("tenant_id is null");
return (Criteria) this;
}
public Criteria andTenantIdIsNotNull() {
addCriterion("tenant_id is not null");
return (Criteria) this;
}
public Criteria andTenantIdEqualTo(Long value) {
addCriterion("tenant_id =", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdNotEqualTo(Long value) {
addCriterion("tenant_id <>", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdGreaterThan(Long value) {
addCriterion("tenant_id >", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdGreaterThanOrEqualTo(Long value) {
addCriterion("tenant_id >=", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdLessThan(Long value) {
addCriterion("tenant_id <", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdLessThanOrEqualTo(Long value) {
addCriterion("tenant_id <=", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdIn(List<Long> values) {
addCriterion("tenant_id in", values, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdNotIn(List<Long> values) {
addCriterion("tenant_id not in", values, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdBetween(Long value1, Long value2) {
addCriterion("tenant_id between", value1, value2, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdNotBetween(Long value1, Long value2) {
addCriterion("tenant_id not between", value1, value2, "tenantId");
return (Criteria) this;
}
public Criteria andDeleteFlagIsNull() {
addCriterion("delete_flag is null");
return (Criteria) this;
}
public Criteria andDeleteFlagIsNotNull() {
addCriterion("delete_flag is not null");
return (Criteria) this;
}
public Criteria andDeleteFlagEqualTo(String value) {
addCriterion("delete_flag =", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotEqualTo(String value) {
addCriterion("delete_flag <>", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagGreaterThan(String value) {
addCriterion("delete_flag >", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) {
addCriterion("delete_flag >=", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagLessThan(String value) {
addCriterion("delete_flag <", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagLessThanOrEqualTo(String value) {
addCriterion("delete_flag <=", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagLike(String value) {
addCriterion("delete_flag like", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotLike(String value) {
addCriterion("delete_flag not like", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagIn(List<String> values) {
addCriterion("delete_flag in", values, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotIn(List<String> values) {
addCriterion("delete_flag not in", values, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagBetween(String value1, String value2) {
addCriterion("delete_flag between", value1, value2, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotBetween(String value1, String value2) {
addCriterion("delete_flag not between", value1, value2, "deleteFlag");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.Date;
public class AccountHead {
private Long id;
private String type;
private Long organId;
private Long handsPersonId;
private Long creator;
private BigDecimal changeAmount;
private BigDecimal discountMoney;
private BigDecimal totalPrice;
private Long accountId;
private String billNo;
private Date billTime;
private String remark;
private String fileName;
private String status;
private Long tenantId;
private String deleteFlag;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public Long getOrganId() {
return organId;
}
public void setOrganId(Long organId) {
this.organId = organId;
}
public Long getHandsPersonId() {
return handsPersonId;
}
public void setHandsPersonId(Long handsPersonId) {
this.handsPersonId = handsPersonId;
}
public Long getCreator() {
return creator;
}
public void setCreator(Long creator) {
this.creator = creator;
}
public BigDecimal getChangeAmount() {
return changeAmount;
}
public void setChangeAmount(BigDecimal changeAmount) {
this.changeAmount = changeAmount;
}
public BigDecimal getDiscountMoney() {
return discountMoney;
}
public void setDiscountMoney(BigDecimal discountMoney) {
this.discountMoney = discountMoney;
}
public BigDecimal getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(BigDecimal totalPrice) {
this.totalPrice = totalPrice;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo == null ? null : billNo.trim();
}
public Date getBillTime() {
return billTime;
}
public void setBillTime(Date billTime) {
this.billTime = billTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName == null ? null : fileName.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public Long getTenantId() {
return tenantId;
}
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;
}
public String getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(String deleteFlag) {
this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim();
}
}
\ No newline at end of file
package com.jsh.erp.datasource.entities;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class AccountHeadExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public AccountHeadExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(String value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(String value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(String value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(String value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(String value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(String value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLike(String value) {
addCriterion("type like", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotLike(String value) {
addCriterion("type not like", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<String> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<String> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(String value1, String value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(String value1, String value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andOrganIdIsNull() {
addCriterion("organ_id is null");
return (Criteria) this;
}
public Criteria andOrganIdIsNotNull() {
addCriterion("organ_id is not null");
return (Criteria) this;
}
public Criteria andOrganIdEqualTo(Long value) {
addCriterion("organ_id =", value, "organId");
return (Criteria) this;
}
public Criteria andOrganIdNotEqualTo(Long value) {
addCriterion("organ_id <>", value, "organId");
return (Criteria) this;
}
public Criteria andOrganIdGreaterThan(Long value) {
addCriterion("organ_id >", value, "organId");
return (Criteria) this;
}
public Criteria andOrganIdGreaterThanOrEqualTo(Long value) {
addCriterion("organ_id >=", value, "organId");
return (Criteria) this;
}
public Criteria andOrganIdLessThan(Long value) {
addCriterion("organ_id <", value, "organId");
return (Criteria) this;
}
public Criteria andOrganIdLessThanOrEqualTo(Long value) {
addCriterion("organ_id <=", value, "organId");
return (Criteria) this;
}
public Criteria andOrganIdIn(List<Long> values) {
addCriterion("organ_id in", values, "organId");
return (Criteria) this;
}
public Criteria andOrganIdNotIn(List<Long> values) {
addCriterion("organ_id not in", values, "organId");
return (Criteria) this;
}
public Criteria andOrganIdBetween(Long value1, Long value2) {
addCriterion("organ_id between", value1, value2, "organId");
return (Criteria) this;
}
public Criteria andOrganIdNotBetween(Long value1, Long value2) {
addCriterion("organ_id not between", value1, value2, "organId");
return (Criteria) this;
}
public Criteria andHandsPersonIdIsNull() {
addCriterion("hands_person_id is null");
return (Criteria) this;
}
public Criteria andHandsPersonIdIsNotNull() {
addCriterion("hands_person_id is not null");
return (Criteria) this;
}
public Criteria andHandsPersonIdEqualTo(Long value) {
addCriterion("hands_person_id =", value, "handsPersonId");
return (Criteria) this;
}
public Criteria andHandsPersonIdNotEqualTo(Long value) {
addCriterion("hands_person_id <>", value, "handsPersonId");
return (Criteria) this;
}
public Criteria andHandsPersonIdGreaterThan(Long value) {
addCriterion("hands_person_id >", value, "handsPersonId");
return (Criteria) this;
}
public Criteria andHandsPersonIdGreaterThanOrEqualTo(Long value) {
addCriterion("hands_person_id >=", value, "handsPersonId");
return (Criteria) this;
}
public Criteria andHandsPersonIdLessThan(Long value) {
addCriterion("hands_person_id <", value, "handsPersonId");
return (Criteria) this;
}
public Criteria andHandsPersonIdLessThanOrEqualTo(Long value) {
addCriterion("hands_person_id <=", value, "handsPersonId");
return (Criteria) this;
}
public Criteria andHandsPersonIdIn(List<Long> values) {
addCriterion("hands_person_id in", values, "handsPersonId");
return (Criteria) this;
}
public Criteria andHandsPersonIdNotIn(List<Long> values) {
addCriterion("hands_person_id not in", values, "handsPersonId");
return (Criteria) this;
}
public Criteria andHandsPersonIdBetween(Long value1, Long value2) {
addCriterion("hands_person_id between", value1, value2, "handsPersonId");
return (Criteria) this;
}
public Criteria andHandsPersonIdNotBetween(Long value1, Long value2) {
addCriterion("hands_person_id not between", value1, value2, "handsPersonId");
return (Criteria) this;
}
public Criteria andCreatorIsNull() {
addCriterion("creator is null");
return (Criteria) this;
}
public Criteria andCreatorIsNotNull() {
addCriterion("creator is not null");
return (Criteria) this;
}
public Criteria andCreatorEqualTo(Long value) {
addCriterion("creator =", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotEqualTo(Long value) {
addCriterion("creator <>", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorGreaterThan(Long value) {
addCriterion("creator >", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorGreaterThanOrEqualTo(Long value) {
addCriterion("creator >=", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorLessThan(Long value) {
addCriterion("creator <", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorLessThanOrEqualTo(Long value) {
addCriterion("creator <=", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorIn(List<Long> values) {
addCriterion("creator in", values, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotIn(List<Long> values) {
addCriterion("creator not in", values, "creator");
return (Criteria) this;
}
public Criteria andCreatorBetween(Long value1, Long value2) {
addCriterion("creator between", value1, value2, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotBetween(Long value1, Long value2) {
addCriterion("creator not between", value1, value2, "creator");
return (Criteria) this;
}
public Criteria andChangeAmountIsNull() {
addCriterion("change_amount is null");
return (Criteria) this;
}
public Criteria andChangeAmountIsNotNull() {
addCriterion("change_amount is not null");
return (Criteria) this;
}
public Criteria andChangeAmountEqualTo(BigDecimal value) {
addCriterion("change_amount =", value, "changeAmount");
return (Criteria) this;
}
public Criteria andChangeAmountNotEqualTo(BigDecimal value) {
addCriterion("change_amount <>", value, "changeAmount");
return (Criteria) this;
}
public Criteria andChangeAmountGreaterThan(BigDecimal value) {
addCriterion("change_amount >", value, "changeAmount");
return (Criteria) this;
}
public Criteria andChangeAmountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("change_amount >=", value, "changeAmount");
return (Criteria) this;
}
public Criteria andChangeAmountLessThan(BigDecimal value) {
addCriterion("change_amount <", value, "changeAmount");
return (Criteria) this;
}
public Criteria andChangeAmountLessThanOrEqualTo(BigDecimal value) {
addCriterion("change_amount <=", value, "changeAmount");
return (Criteria) this;
}
public Criteria andChangeAmountIn(List<BigDecimal> values) {
addCriterion("change_amount in", values, "changeAmount");
return (Criteria) this;
}
public Criteria andChangeAmountNotIn(List<BigDecimal> values) {
addCriterion("change_amount not in", values, "changeAmount");
return (Criteria) this;
}
public Criteria andChangeAmountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("change_amount between", value1, value2, "changeAmount");
return (Criteria) this;
}
public Criteria andChangeAmountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("change_amount not between", value1, value2, "changeAmount");
return (Criteria) this;
}
public Criteria andDiscountMoneyIsNull() {
addCriterion("discount_money is null");
return (Criteria) this;
}
public Criteria andDiscountMoneyIsNotNull() {
addCriterion("discount_money is not null");
return (Criteria) this;
}
public Criteria andDiscountMoneyEqualTo(BigDecimal value) {
addCriterion("discount_money =", value, "discountMoney");
return (Criteria) this;
}
public Criteria andDiscountMoneyNotEqualTo(BigDecimal value) {
addCriterion("discount_money <>", value, "discountMoney");
return (Criteria) this;
}
public Criteria andDiscountMoneyGreaterThan(BigDecimal value) {
addCriterion("discount_money >", value, "discountMoney");
return (Criteria) this;
}
public Criteria andDiscountMoneyGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("discount_money >=", value, "discountMoney");
return (Criteria) this;
}
public Criteria andDiscountMoneyLessThan(BigDecimal value) {
addCriterion("discount_money <", value, "discountMoney");
return (Criteria) this;
}
public Criteria andDiscountMoneyLessThanOrEqualTo(BigDecimal value) {
addCriterion("discount_money <=", value, "discountMoney");
return (Criteria) this;
}
public Criteria andDiscountMoneyIn(List<BigDecimal> values) {
addCriterion("discount_money in", values, "discountMoney");
return (Criteria) this;
}
public Criteria andDiscountMoneyNotIn(List<BigDecimal> values) {
addCriterion("discount_money not in", values, "discountMoney");
return (Criteria) this;
}
public Criteria andDiscountMoneyBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_money between", value1, value2, "discountMoney");
return (Criteria) this;
}
public Criteria andDiscountMoneyNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_money not between", value1, value2, "discountMoney");
return (Criteria) this;
}
public Criteria andTotalPriceIsNull() {
addCriterion("total_price is null");
return (Criteria) this;
}
public Criteria andTotalPriceIsNotNull() {
addCriterion("total_price is not null");
return (Criteria) this;
}
public Criteria andTotalPriceEqualTo(BigDecimal value) {
addCriterion("total_price =", value, "totalPrice");
return (Criteria) this;
}
public Criteria andTotalPriceNotEqualTo(BigDecimal value) {
addCriterion("total_price <>", value, "totalPrice");
return (Criteria) this;
}
public Criteria andTotalPriceGreaterThan(BigDecimal value) {
addCriterion("total_price >", value, "totalPrice");
return (Criteria) this;
}
public Criteria andTotalPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("total_price >=", value, "totalPrice");
return (Criteria) this;
}
public Criteria andTotalPriceLessThan(BigDecimal value) {
addCriterion("total_price <", value, "totalPrice");
return (Criteria) this;
}
public Criteria andTotalPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("total_price <=", value, "totalPrice");
return (Criteria) this;
}
public Criteria andTotalPriceIn(List<BigDecimal> values) {
addCriterion("total_price in", values, "totalPrice");
return (Criteria) this;
}
public Criteria andTotalPriceNotIn(List<BigDecimal> values) {
addCriterion("total_price not in", values, "totalPrice");
return (Criteria) this;
}
public Criteria andTotalPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("total_price between", value1, value2, "totalPrice");
return (Criteria) this;
}
public Criteria andTotalPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("total_price not between", value1, value2, "totalPrice");
return (Criteria) this;
}
public Criteria andAccountIdIsNull() {
addCriterion("account_id is null");
return (Criteria) this;
}
public Criteria andAccountIdIsNotNull() {
addCriterion("account_id is not null");
return (Criteria) this;
}
public Criteria andAccountIdEqualTo(Long value) {
addCriterion("account_id =", value, "accountId");
return (Criteria) this;
}
public Criteria andAccountIdNotEqualTo(Long value) {
addCriterion("account_id <>", value, "accountId");
return (Criteria) this;
}
public Criteria andAccountIdGreaterThan(Long value) {
addCriterion("account_id >", value, "accountId");
return (Criteria) this;
}
public Criteria andAccountIdGreaterThanOrEqualTo(Long value) {
addCriterion("account_id >=", value, "accountId");
return (Criteria) this;
}
public Criteria andAccountIdLessThan(Long value) {
addCriterion("account_id <", value, "accountId");
return (Criteria) this;
}
public Criteria andAccountIdLessThanOrEqualTo(Long value) {
addCriterion("account_id <=", value, "accountId");
return (Criteria) this;
}
public Criteria andAccountIdIn(List<Long> values) {
addCriterion("account_id in", values, "accountId");
return (Criteria) this;
}
public Criteria andAccountIdNotIn(List<Long> values) {
addCriterion("account_id not in", values, "accountId");
return (Criteria) this;
}
public Criteria andAccountIdBetween(Long value1, Long value2) {
addCriterion("account_id between", value1, value2, "accountId");
return (Criteria) this;
}
public Criteria andAccountIdNotBetween(Long value1, Long value2) {
addCriterion("account_id not between", value1, value2, "accountId");
return (Criteria) this;
}
public Criteria andBillNoIsNull() {
addCriterion("bill_no is null");
return (Criteria) this;
}
public Criteria andBillNoIsNotNull() {
addCriterion("bill_no is not null");
return (Criteria) this;
}
public Criteria andBillNoEqualTo(String value) {
addCriterion("bill_no =", value, "billNo");
return (Criteria) this;
}
public Criteria andBillNoNotEqualTo(String value) {
addCriterion("bill_no <>", value, "billNo");
return (Criteria) this;
}
public Criteria andBillNoGreaterThan(String value) {
addCriterion("bill_no >", value, "billNo");
return (Criteria) this;
}
public Criteria andBillNoGreaterThanOrEqualTo(String value) {
addCriterion("bill_no >=", value, "billNo");
return (Criteria) this;
}
public Criteria andBillNoLessThan(String value) {
addCriterion("bill_no <", value, "billNo");
return (Criteria) this;
}
public Criteria andBillNoLessThanOrEqualTo(String value) {
addCriterion("bill_no <=", value, "billNo");
return (Criteria) this;
}
public Criteria andBillNoLike(String value) {
addCriterion("bill_no like", value, "billNo");
return (Criteria) this;
}
public Criteria andBillNoNotLike(String value) {
addCriterion("bill_no not like", value, "billNo");
return (Criteria) this;
}
public Criteria andBillNoIn(List<String> values) {
addCriterion("bill_no in", values, "billNo");
return (Criteria) this;
}
public Criteria andBillNoNotIn(List<String> values) {
addCriterion("bill_no not in", values, "billNo");
return (Criteria) this;
}
public Criteria andBillNoBetween(String value1, String value2) {
addCriterion("bill_no between", value1, value2, "billNo");
return (Criteria) this;
}
public Criteria andBillNoNotBetween(String value1, String value2) {
addCriterion("bill_no not between", value1, value2, "billNo");
return (Criteria) this;
}
public Criteria andBillTimeIsNull() {
addCriterion("bill_time is null");
return (Criteria) this;
}
public Criteria andBillTimeIsNotNull() {
addCriterion("bill_time is not null");
return (Criteria) this;
}
public Criteria andBillTimeEqualTo(Date value) {
addCriterion("bill_time =", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeNotEqualTo(Date value) {
addCriterion("bill_time <>", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeGreaterThan(Date value) {
addCriterion("bill_time >", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeGreaterThanOrEqualTo(Date value) {
addCriterion("bill_time >=", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeLessThan(Date value) {
addCriterion("bill_time <", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeLessThanOrEqualTo(Date value) {
addCriterion("bill_time <=", value, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeIn(List<Date> values) {
addCriterion("bill_time in", values, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeNotIn(List<Date> values) {
addCriterion("bill_time not in", values, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeBetween(Date value1, Date value2) {
addCriterion("bill_time between", value1, value2, "billTime");
return (Criteria) this;
}
public Criteria andBillTimeNotBetween(Date value1, Date value2) {
addCriterion("bill_time not between", value1, value2, "billTime");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andFileNameIsNull() {
addCriterion("file_name is null");
return (Criteria) this;
}
public Criteria andFileNameIsNotNull() {
addCriterion("file_name is not null");
return (Criteria) this;
}
public Criteria andFileNameEqualTo(String value) {
addCriterion("file_name =", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotEqualTo(String value) {
addCriterion("file_name <>", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameGreaterThan(String value) {
addCriterion("file_name >", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameGreaterThanOrEqualTo(String value) {
addCriterion("file_name >=", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLessThan(String value) {
addCriterion("file_name <", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLessThanOrEqualTo(String value) {
addCriterion("file_name <=", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLike(String value) {
addCriterion("file_name like", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotLike(String value) {
addCriterion("file_name not like", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameIn(List<String> values) {
addCriterion("file_name in", values, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotIn(List<String> values) {
addCriterion("file_name not in", values, "fileName");
return (Criteria) this;
}
public Criteria andFileNameBetween(String value1, String value2) {
addCriterion("file_name between", value1, value2, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotBetween(String value1, String value2) {
addCriterion("file_name not between", value1, value2, "fileName");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("status like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("status not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andTenantIdIsNull() {
addCriterion("tenant_id is null");
return (Criteria) this;
}
public Criteria andTenantIdIsNotNull() {
addCriterion("tenant_id is not null");
return (Criteria) this;
}
public Criteria andTenantIdEqualTo(Long value) {
addCriterion("tenant_id =", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdNotEqualTo(Long value) {
addCriterion("tenant_id <>", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdGreaterThan(Long value) {
addCriterion("tenant_id >", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdGreaterThanOrEqualTo(Long value) {
addCriterion("tenant_id >=", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdLessThan(Long value) {
addCriterion("tenant_id <", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdLessThanOrEqualTo(Long value) {
addCriterion("tenant_id <=", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdIn(List<Long> values) {
addCriterion("tenant_id in", values, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdNotIn(List<Long> values) {
addCriterion("tenant_id not in", values, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdBetween(Long value1, Long value2) {
addCriterion("tenant_id between", value1, value2, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdNotBetween(Long value1, Long value2) {
addCriterion("tenant_id not between", value1, value2, "tenantId");
return (Criteria) this;
}
public Criteria andDeleteFlagIsNull() {
addCriterion("delete_flag is null");
return (Criteria) this;
}
public Criteria andDeleteFlagIsNotNull() {
addCriterion("delete_flag is not null");
return (Criteria) this;
}
public Criteria andDeleteFlagEqualTo(String value) {
addCriterion("delete_flag =", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotEqualTo(String value) {
addCriterion("delete_flag <>", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagGreaterThan(String value) {
addCriterion("delete_flag >", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) {
addCriterion("delete_flag >=", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagLessThan(String value) {
addCriterion("delete_flag <", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagLessThanOrEqualTo(String value) {
addCriterion("delete_flag <=", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagLike(String value) {
addCriterion("delete_flag like", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotLike(String value) {
addCriterion("delete_flag not like", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagIn(List<String> values) {
addCriterion("delete_flag in", values, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotIn(List<String> values) {
addCriterion("delete_flag not in", values, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagBetween(String value1, String value2) {
addCriterion("delete_flag between", value1, value2, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotBetween(String value1, String value2) {
addCriterion("delete_flag not between", value1, value2, "deleteFlag");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
package com.jsh.erp.datasource.entities;
public class AccountHeadVo4Body {
private Long id;
private String info;
private String rows;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
public String getRows() {
return rows;
}
public void setRows(String rows) {
this.rows = rows;
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment