12 files modified
1 files added
| New file |
| | |
| | | package org.springblade.common.utils; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.util.EntityUtils; |
| | | |
| | | public class arg { |
| | | public static String url="http://192.168.0.109:80"; |
| | | public static String test01(String path,Object obj) throws Exception{ |
| | | CloseableHttpClient httpClient = HttpClients.createDefault(); |
| | | HttpPost httpPost = new HttpPost(path); |
| | | httpPost.setEntity(new StringEntity(JSON.toJSONString(obj), |
| | | ContentType.create("application/json", "UTF-8"))); |
| | | CloseableHttpResponse execute = httpClient.execute(httpPost); |
| | | HttpEntity entity = execute.getEntity(); |
| | | String str = EntityUtils.toString(entity); |
| | | httpPost.clone(); |
| | | httpClient.close(); |
| | | System.out.println(str); |
| | | return str; |
| | | } |
| | | } |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入dispatcher") |
| | | public R submit(@Valid @RequestBody Dispatcher dispatcher) { |
| | | if (null!=dispatcher.getUserIds() && dispatcher.getUserIds()!=""){ |
| | | //计算派遣人数 |
| | | dispatcher.setNum(Arrays.asList(dispatcher.getUserIds().split(",")).size()); |
| | | //查询派遣单位的信息,设置行政区 |
| | | dispatcher.setJurisdiction(dispatcherUnitService.getById(dispatcher.getDispatcherUnitId()).getJurisdiction().toString()); |
| | | public R submit(@Valid @RequestBody Dispatcher dispatcher) throws Exception { |
| | | if (dispatcher.getId()==null){ |
| | | if (null!=dispatcher.getUserIds() && dispatcher.getUserIds()!=""){ |
| | | //计算派遣人数 |
| | | dispatcher.setNum(Arrays.asList(dispatcher.getUserIds().split(",")).size()); |
| | | //查询派遣单位的信息,设置行政区 |
| | | dispatcher.setJurisdiction(dispatcherUnitService.getById(dispatcher.getDispatcherUnitId()).getJurisdiction().toString()); |
| | | } |
| | | arg arg = new arg(); |
| | | arg.test01(arg.url+"/dispatcher/save",dispatcher); |
| | | } |
| | | else { |
| | | if (null != dispatcher.getUserIds() && dispatcher.getUserIds() != "") { |
| | | //计算派遣人数 |
| | | dispatcher.setNum(Arrays.asList(dispatcher.getUserIds().split(",")).size()); |
| | | //查询派遣单位的信息,设置行政区 |
| | | dispatcher.setJurisdiction(dispatcherUnitService.getById(dispatcher.getDispatcherUnitId()).getJurisdiction().toString()); |
| | | } |
| | | } |
| | | return R.status(dispatcherService.saveOrUpdate(dispatcher)); |
| | | } |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | public R submit(@Valid @RequestBody DispatcherUnit dispatcherUnit) { |
| | | public R submit(@Valid @RequestBody DispatcherUnit dispatcherUnit) throws Exception { |
| | | if (dispatcherUnit.getId()==null){ |
| | | arg arg = new arg(); |
| | | arg.test01(arg.url+"/dispatcherUnit/save",dispatcherUnit); |
| | | } |
| | | if (null==dispatcherUnit.getId()){ |
| | | dispatcherUnit.setCreateTime(new Date()); |
| | | } |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.cache.DictCache; |
| | | import org.springblade.common.enums.DictEnum; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入information") |
| | | public R save(@Valid @RequestBody Information information) { |
| | | public R save(@Valid @RequestBody Information information) throws Exception { |
| | | Dept dept= new Dept(); |
| | | Long i = 1413470343230877697L; |
| | | dept.setParentId(i); |
| | |
| | | String id = kv.get("id").toString(); |
| | | information.setDepartmentid(id); |
| | | } |
| | | arg arg = new arg(); |
| | | arg.test01(arg.url+"/information/save",information); |
| | | return R.status(informationService.save(information)); |
| | | } |
| | | |
| | |
| | | </delete> |
| | | |
| | | <select id="selectCount" resultType="java.util.HashMap"> |
| | | SELECT |
| | | isnull( B.confess, 0 ) AS confess, |
| | | isnull( C.staff, 0 ) AS staff, |
| | | isnull( D.security, 0 ) AS security, |
| | | isnull( E.armed, 0 ) AS armed |
| | | FROM |
| | | ( SELECT jurisdiction FROM sys_information GROUP BY jurisdiction ) A |
| | | FULL JOIN ( SELECT COUNT ( stats ) AS confess, jurisdiction FROM sys_information WHERE stats = 0 GROUP BY jurisdiction ) B ON A.jurisdiction = B.jurisdiction |
| | | FULL JOIN ( SELECT COUNT ( stats ) AS staff, jurisdiction FROM sys_information WHERE stats = 1 GROUP BY jurisdiction ) C ON A.jurisdiction = C.jurisdiction |
| | | FULL JOIN ( SELECT COUNT ( stats ) AS security, jurisdiction FROM sys_information WHERE stats = 2 GROUP BY jurisdiction ) D ON A.jurisdiction = D.jurisdiction |
| | | FULL JOIN ( SELECT COUNT ( stats ) AS armed, jurisdiction FROM sys_information WHERE stats = 3 GROUP BY jurisdiction ) E ON A.jurisdiction = E.jurisdiction |
| | | WHERE |
| | | A.jurisdiction = #{departmentid} |
| | | SELECT isnull(B.confess, 0) AS confess, |
| | | isnull(C.staff, 0) AS staff, |
| | | isnull(D.security, 0) AS security, |
| | | isnull(E.armed, 0) AS armed |
| | | FROM (SELECT jurisdiction FROM sys_information GROUP BY jurisdiction) A |
| | | FULL JOIN (SELECT COUNT(stats) AS confess, jurisdiction |
| | | FROM sys_information |
| | | WHERE stats = 0 |
| | | GROUP BY jurisdiction) B ON A.jurisdiction = B.jurisdiction |
| | | FULL JOIN (SELECT COUNT(stats) AS staff, jurisdiction |
| | | FROM sys_information |
| | | WHERE stats = 1 |
| | | GROUP BY jurisdiction) C ON A.jurisdiction = C.jurisdiction |
| | | FULL JOIN (SELECT COUNT(stats) AS security, jurisdiction |
| | | FROM sys_information |
| | | WHERE stats = 2 |
| | | GROUP BY jurisdiction) D ON A.jurisdiction = D.jurisdiction |
| | | FULL JOIN (SELECT COUNT(stats) AS armed, jurisdiction |
| | | FROM sys_information |
| | | WHERE stats = 3 |
| | | GROUP BY jurisdiction) E ON A.jurisdiction = E.jurisdiction |
| | | WHERE A.jurisdiction = #{departmentid} |
| | | </select> |
| | | |
| | | <select id="selectInCount" resultType="java.util.HashMap"> |
| | | SELECT COUNT(u.dept_id) AS number,d.dept_name FROM blade_user u LEFT JOIN blade_dept d ON d.id=u.dept_id WHERE u.hold=1 GROUP BY u.dept_id,d.dept_name |
| | | SELECT COUNT(u.dept_id) AS number, d.dept_name |
| | | FROM blade_user u |
| | | LEFT JOIN blade_dept d ON d.id = u.dept_id |
| | | WHERE u.hold = 1 |
| | | GROUP BY u.dept_id, d.dept_name |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入member") |
| | | public R save(@Valid @RequestBody Member member) { |
| | | public R save(@Valid @RequestBody Member member) throws Exception { |
| | | arg arg = new arg(); |
| | | arg.test01(arg.url+"/member/save",member); |
| | | return R.status(memberService.save(member)); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 实体类 |
| | |
| | | @ApiModelProperty(value = "统一社会信用代码") |
| | | @TableField("creditCode") |
| | | private String creditcode; |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date rtime; |
| | | } |
| | |
| | | <result column="cell" property="cell"/> |
| | | <result column="shareholdingratio" property="shareholdingratio"/> |
| | | <result column="creditCode" property="creditcode"/> |
| | | <result column="rtime" property="rtime"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.oss.model.BladeFile; |
| | | import org.springblade.core.oss.model.OssFile; |
| | |
| | | attach.setDeptid(deptid); |
| | | attach.setType(type); |
| | | attachService.save(attach); |
| | | test01("http://192.168.0.104:80/blade-resource/attach/save",attach); |
| | | arg.test01(arg.url+"/blade-resource/attach/save",attach); |
| | | return attach.getId(); |
| | | } |
| | | |
| | | public static String test01(String path,Object obj) throws Exception{ |
| | | CloseableHttpClient httpClient = HttpClients.createDefault(); |
| | | HttpPost httpPost = new HttpPost(path); |
| | | httpPost.setEntity(new StringEntity(JSON.toJSONString(obj), |
| | | ContentType.create("application/json", "UTF-8"))); |
| | | CloseableHttpResponse execute = httpClient.execute(httpPost); |
| | | HttpEntity entity = execute.getEntity(); |
| | | String str = EntityUtils.toString(entity); |
| | | httpPost.clone(); |
| | | httpClient.close(); |
| | | System.out.println(str); |
| | | return str; |
| | | } |
| | | /** |
| | | * 删除文件 |
| | | * |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入shareholder") |
| | | public R save(@Valid @RequestBody Shareholder shareholder) { |
| | | public R save(@Valid @RequestBody Shareholder shareholder) throws Exception { |
| | | arg arg = new arg(); |
| | | arg.test01(arg.url+"/shareholder/save",shareholder); |
| | | return R.status(shareholderService.save(shareholder)); |
| | | } |
| | | |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增或修改", notes = "传入User") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R submit(@Valid @RequestBody User user) { |
| | | public R submit(@Valid @RequestBody User user) throws Exception { |
| | | CacheUtil.clear(USER_CACHE); |
| | | arg arg = new arg(); |
| | | arg.test01(arg.url+"/blade-user/save",user); |
| | | return R.status(userService.submit(user)); |
| | | } |
| | | |
| | |
| | | * 是否采集照片 |
| | | */ |
| | | private String photo; |
| | | private String dispatch; |
| | | |
| | | } |
| | |
| | | <result column="hold" property="hold"/> |
| | | <result column="jurisdiction" property="jurisdiction"/> |
| | | <result column="securitynumber" property="securitynumber"/> |
| | | <result column="dispatch" property="dispatch"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectUserPage" resultMap="userResultMap"> |