Commit 733fe89f authored by tianbo's avatar tianbo

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

# Conflicts: # amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/resources/application-dev.properties
parents 0a9e4cae 0daff60e
...@@ -68,7 +68,14 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc ...@@ -68,7 +68,14 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc
String street = address.substring(area.length()).substring(0,address.substring(area.length()).indexOf("号")+1); String street = address.substring(area.length()).substring(0,address.substring(area.length()).indexOf("号")+1);
String community = address.substring(area.length()+street.length()); String community = address.substring(area.length()+street.length());
String industry = getIndustry(data.getString("hydm")); String industry = "";
if(!ValidationUtil.isEmpty(data.get("hydm"))){
if(data.getString("hydm").length() > 2){
industry = getIndustry(data.getString("hydm"));
}
}
//所属行业 //所属行业
result.put("industry", industry); result.put("industry", industry);
......
...@@ -27,6 +27,8 @@ public class SpeUseUnit implements Serializable { ...@@ -27,6 +27,8 @@ public class SpeUseUnit implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "单位名称") @ApiModelProperty(value = "单位名称")
private String name; private String name;
...@@ -145,5 +147,8 @@ public class SpeUseUnit implements Serializable { ...@@ -145,5 +147,8 @@ public class SpeUseUnit implements Serializable {
@ApiModelProperty(value = "同步id") @ApiModelProperty(value = "同步id")
private String syncId; private String syncId;
@ApiModelProperty(value = "同步状态")
private Integer syncState;
} }
package com.yeejoin.amos.boot.module.ugp.api.Enum;
public enum ProjectInitiationEnum {
启动流程("启动流程", "/workflow/task/startTask", ""),
流程详情("流程详情", "/workflow/task/{taskId}", "taskId"),
合并启动流程("合并启动流程", "/workflow/task/startProcess", ""),
所有已执行任务详情("所有已执行任务详情","/workflow/activitiHistory/task/detail/{taskId}","taskId"),
流程任务("流程任务", "/workflow/task?processInstanceId={processInstanceId}", "processInstanceId"),
我的代办("我的代办", "/workflow/task/all-list?processDefinitionKey={processDefinitionKey}", "processDefinitionKey"),
我的代办有ID("我的代办有ID", "/workflow/task/all-list?processDefinitionKey={processDefinitionKey}&userId={userId}", "processDefinitionKey,userId"),
已执行任务("已执行任务", "/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}", "processDefinitionKey"),
已执行任务有ID("已执行任务有ID", "/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}&userId={userId}", "processDefinitionKey,userId"),
启动免登录流程("启动免登录流程", "/processes/{appKey}", "appKey"),
当前节点("当前节点", "/wf/taskstodo?processInstanceId={processInstanceId}", "processInstanceId"),
执行流程("执行流程", "/workflow/task/pickupAndCompleteTask/{taskId}", "taskId"),
终止流程("终止流程", "/wf/processes/{processInstanceId}?deleteReason={deleteReason}", "processInstanceId,deleteReason"),
当前子节点("当前子节点", "/wf/processes/{processInstanceId}/tasks?taskDefinitionKey={taskDefinitionKey}", "processInstanceId,taskDefinitionKey"),
工作流流水("工作流流水","/wf/processes/{processInstanceId}/tasks", "processInstanceId"),
子节点信息("子节点信息","/workflow/task/list/all/{instanceId}", "instanceId");
private String desc;
private String uri;
private String params;
ProjectInitiationEnum(String desc, String uri, String params) {
this.desc = desc;
this.uri = uri;
this.params = params;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
}
package com.yeejoin.amos.boot.module.ugp.api.Util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* <pre>
* 返回封装对象
* </pre>
*
* @author mincx
* @version CommonReponse.java v0.1
* @time 2017-9-19 15:43:32
*/
public class CommonResponse implements Serializable {
private static final long serialVersionUID = -8737351878134480646L;
/**
* 操作状态
*/
@ApiModelProperty(required=true,value="操作状态")
private String result;
/**
* 操作状态
*/
@ApiModelProperty(required=true,value="状态码")
private int status;
/**
* 数据
*/
@ApiModelProperty(required=false,value="数据")
private Object dataList;
/**
* 操作详细信息
*/
@ApiModelProperty(required=false,value="操作详细信息")
private String message;
public CommonResponse(){
}
public CommonResponse(String result) {
this.result = result;
}
public CommonResponse(Object dataList) {
this.dataList = dataList;
this.result = "";
}
public CommonResponse(String result, Object dataList) {
this.dataList = dataList;
this.result = result;
}
public CommonResponse(String result, String message) {
this.result = result;
this.message = message;
}
public CommonResponse(String result, Object dataList, String message) {
this.dataList = dataList;
this.result = result;
this.message = message;
}
public CommonResponse(String result, Object dataList, int status) {
this.dataList = dataList;
this.result = result;
this.status = status;
}
public CommonResponse(String result, String message, int status) {
this.result = result;
this.message = message;
this.status = status;
}
public CommonResponse(String result, Object dataList, String message, int status) {
this.dataList = dataList;
this.result = result;
this.message = message;
this.status = status;
}
public Boolean isSuccess(){
return "SUCCESS".equals(getResult());
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Object getDataList() {
return dataList;
}
public void setDataList(Object dataList) {
this.dataList = dataList;
}
public void setStatus(int status) {
this.status = status;
}
public int getStatus() {
return status;
}
public String toJsonStr() throws Exception {
return JSON.toJSONString(this,SerializerFeature.WriteMapNullValue,SerializerFeature.DisableCircularReferenceDetect,SerializerFeature.SkipTransientField);
}
}
package com.yeejoin.amos.boot.module.ugp.api.Util;
import org.springframework.http.HttpStatus;
public class CommonResponseUtil
{
public static CommonResponse success()
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_SUCCESS);
response.setStatus(HttpStatus.OK.value());
return response;
}
public static CommonResponse success(Object obj)
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_SUCCESS);
response.setStatus(HttpStatus.OK.value());
response.setDataList(obj);
return response;
}
public static CommonResponse success(Object obj, String message)
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_SUCCESS);
response.setStatus(HttpStatus.OK.value());
response.setDataList(obj);
response.setMessage(message);
return response;
}
public static CommonResponse failure()
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_FAILURE);
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
return response;
}
public static CommonResponse failure(String message)
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_FAILURE);
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
response.setMessage(message);
return response;
}
public static CommonResponse failure(Object obj, String message)
{
CommonResponse response = new CommonResponse();
response.setResult(Constants.RESULT_FAILURE);
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
response.setDataList(obj);
response.setMessage(message);
return response;
}
}
package com.yeejoin.amos.boot.module.ugp.api.Util;
/**
* <pre>
* 系统常量
* </pre>
*
* @author mincx
* @version Constants.java v0.1
* @time 2017-9-19 15:43:32
*/
public class Constants {
public static final String ERROR_MESSAGE = "系统异常";
public static final String RESULT_SUCCESS = "SUCCESS";
public static final String RESULT_FAILURE = "FAILURE";
public static final String RULE_FACT_PREFIX = "rule_";
public static final String RULE_COMPILATION_ERROR = "规则编译异常";
public static final String NEW_LINE= "\r\n";
public static final String POSITION_LATITUDE = "latitude";
public static final String POSITION_LONGITUDE = "longitude";
public static final double PI = 3.1415;
public static final double EARTH_RADIUS = 6370.996;
public static final String RULE_CONDITION_AND = "&&";
public static final String RULE_CONDITION_OR = "||";
/**
* DES加密解密默认key
*/
public static final String XSS_KEY = "qaz";
/**
* 灾情状态
*/
public static final String FireHappenStateID = "90db70b7-49a4-4a72-b54b-0fabbed9bec7";//发生
public static final String FireDevelopStateID = "1f7fe7d7-b30c-4518-8c95-6e3bc506ca86";//猛烈
/**
* 车辆状态
*/
public static final String CarArrivedStateID = "ad55748a-1206-4507-8831-95b7f2ad804f";//到达
public static final String CarDispatchingStateID = "43a23576-3d0f-4c3d-a46b-555391a4d870";//待出动
public static final String CarOnDutyStateID = "21cc717f-60b4-46ae-942e-9efd63d13415";//执勤
public static final String CarOnSiteStateID = "d7eddc16-4c55-4de0-b726-3547c7b0b980";//在位
public static final String CarOnTheWayStateID = "5e1b6e98-d1dc-4c49-a7ad-b959d2278dba";//在途
public static final String CarRepairStateID = "e86d455b-e9fd-4938-9826-38ca46623287";//维修
/**
* 战斗力量编队状态
*/
public static final String RescuePowerArrivedStateID = "0951f770-7f75-43d8-bcec-47d7559be727";//到达
public static final String RescuePowerDispatchedStateID = "ec4afc56-6cec-41a3-95f5-20c735f052d4";//已调派
public static final String RescuePowerEnhanceStateID = "3d6cf113-b69d-47c3-a3a8-ded448cc4636";//增援
public static final String RescuePowerFightingStateID = "4bacd4b4-b07d-454e-b737-431e7c997cde";//战斗
public static final String RescuePowerStandByStateID = "4fc6e4d6-c6a8-453c-b554-ce7de0b828b2";//待命
/**
* sql注入关键字
*/
public static String badStr = "'|and|exec|execute|insert|select|delete|update|count|drop|%|chr|mid|master|truncate|" +
"char|declare|sitename|net user|xp_cmdshell|;|or|-|+|,|like'|and|exec|execute|insert|create|drop|" +
"table|from|grant|use|group_concat|column_name|" +
"information_schema.columns|table_schema|union|where|select|delete|update|order|by|count|" +
"chr|mid|master|truncate|char|declare|or|;|-|--|,|like|//|/|%|#";
}
package com.yeejoin.amos.boot.module.ugp.api.service; package com.yeejoin.amos.boot.module.ugp.api.service;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
/** /**
* 企业信息表接口类 * 企业信息表接口类
* *
...@@ -9,4 +12,6 @@ package com.yeejoin.amos.boot.module.ugp.api.service; ...@@ -9,4 +12,6 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
*/ */
public interface ICompanyService { public interface ICompanyService {
void modifyCompanyInfo(Company company) throws Exception;
} }
package com.yeejoin.amos.boot.module.ugp.api.service; package com.yeejoin.amos.boot.module.ugp.api.service;
import com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto;
import java.util.List;
/** /**
* 焊口信息表接口类 * 焊口信息表接口类
* *
...@@ -8,5 +12,5 @@ package com.yeejoin.amos.boot.module.ugp.api.service; ...@@ -8,5 +12,5 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
* @date 2022-09-22 * @date 2022-09-22
*/ */
public interface IWeldService { public interface IWeldService {
void getCode(Long projectCode, int number) throws Exception;
} }
package com.yeejoin.amos.boot.module.ugp.biz.controller; package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.CompanyServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.CompanyServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -16,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -16,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto; import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import springfox.documentation.spring.web.json.Json;
/** /**
* 企业信息表 * 企业信息表
...@@ -107,10 +119,35 @@ public class CompanyController extends BaseController { ...@@ -107,10 +119,35 @@ public class CompanyController extends BaseController {
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "企业信息表列表全部数据查询", notes = "企业信息表列表全部数据查询") @ApiOperation(httpMethod = "GET",value = "企业信息表列表全部数据查询", notes = "企业信息表列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<CompanyDto>> selectForList() { public ResponseModel<List<CompanyDto>> selectForList() {
return ResponseHelper.buildResponse(companyServiceImpl.queryForCompanyList()); return ResponseHelper.buildResponse(companyServiceImpl.queryForCompanyList());
} }
/**
* 修改企业信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "Post",value = "修改企业信息", notes = "修改企业信息")
@PostMapping(value = "/modifyCompanyInfo")
public ResponseModel<Map<String,Object>> modifyCompanyInfo(Company companyList) throws Exception {
Map<String,Object> message = new HashMap<>();
try{
companyServiceImpl.modifyCompanyInfo(companyList);
message.put("res",true);
}catch (Exception e){
message.put("res",false);
message.put("Exception",e.getMessage());
}
return ResponseHelper.buildResponse(message);
}
} }
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
@RestController
@Api(tags = "流程相关")
@RequestMapping(value = "/projectInitiation")
public class ProjectInitiationController {
@Autowired
ProjectInitiationServiceImpl projectInitiationServiceImpl;
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/start")
@ApiOperation(httpMethod = "GET", value = "流程启动", notes = "流程启动")
public void start() throws Exception {
projectInitiationServiceImpl.start();
}
}
package com.yeejoin.amos.boot.module.ugp.biz.controller; package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List; import java.util.List;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.WeldServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.WeldServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto; import com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto;
...@@ -37,28 +42,28 @@ public class WeldController extends BaseController { ...@@ -37,28 +42,28 @@ public class WeldController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增焊口信息表", notes = "新增焊口信息表") @ApiOperation(httpMethod = "POST", value = "新增焊口信息表", notes = "新增焊口信息表")
public ResponseModel<WeldDto> save(@RequestBody WeldDto model) { public ResponseModel<WeldDto> save(@RequestBody WeldDto model) {
model = weldServiceImpl.createWithModel(model); model = weldServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
/** /**
* 根据sequenceNbr更新 * 根据sequenceNbr更新
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新焊口信息表", notes = "根据sequenceNbr更新焊口信息表") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新焊口信息表", notes = "根据sequenceNbr更新焊口信息表")
public ResponseModel<WeldDto> updateBySequenceNbrWeld(@RequestBody WeldDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<WeldDto> updateBySequenceNbrWeld(@RequestBody WeldDto model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(weldServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(weldServiceImpl.updateWithModel(model));
} }
/** /**
* 根据sequenceNbr删除 * 根据sequenceNbr删除
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
...@@ -67,50 +72,75 @@ public class WeldController extends BaseController { ...@@ -67,50 +72,75 @@ public class WeldController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}") @DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除焊口信息表", notes = "根据sequenceNbr删除焊口信息表") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除焊口信息表", notes = "根据sequenceNbr删除焊口信息表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){ public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(weldServiceImpl.removeById(sequenceNbr)); return ResponseHelper.buildResponse(weldServiceImpl.removeById(sequenceNbr));
} }
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个焊口信息表", notes = "根据sequenceNbr查询单个焊口信息表") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个焊口信息表", notes = "根据sequenceNbr查询单个焊口信息表")
public ResponseModel<WeldDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<WeldDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(weldServiceImpl.queryBySeq(sequenceNbr)); return ResponseHelper.buildResponse(weldServiceImpl.queryBySeq(sequenceNbr));
} }
/** /**
* 列表分页查询 * 列表分页查询
* *
* @param current 当前页 * @param current 当前页
* @param current 每页大小 * @param current 每页大小
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "焊口信息表分页查询", notes = "焊口信息表分页查询") @ApiOperation(httpMethod = "GET", value = "焊口信息表分页查询", notes = "焊口信息表分页查询")
public ResponseModel<Page<WeldDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<Page<WeldDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) { (value = "size") int size) {
Page<WeldDto> page = new Page<WeldDto>(); Page<WeldDto> page = new Page<WeldDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(weldServiceImpl.queryForWeldPage(page)); return ResponseHelper.buildResponse(weldServiceImpl.queryForWeldPage(page));
} }
/** /**
* 列表全部数据查询 * 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "焊口信息表列表全部数据查询", notes = "焊口信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<WeldDto>> selectForList() {
return ResponseHelper.buildResponse(weldServiceImpl.queryForWeldList());
}
/**
* 生成焊口编码
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "焊口信息表列表全部数据查询", notes = "焊口信息表列表全部数据查询") @ApiOperation(httpMethod = "POST", value = "生成焊口编码", notes = "生成焊口编码")
@GetMapping(value = "/list") @PostMapping(value = "/getCode")
public ResponseModel<List<WeldDto>> selectForList() { public ResponseModel<JSONObject> getCode(Long projectCode, int number) throws Exception {
return ResponseHelper.buildResponse(weldServiceImpl.queryForWeldList()); //预返回数据
} JSONObject message = new JSONObject();
try {
weldServiceImpl.getCode(projectCode, number);
message.put("res", true);
} catch (Exception e) {
message.put("res", false);
message.put("Exception", e.getMessage());
}
return ResponseHelper.buildResponse(message);
// return ResponseHelper.buildResponse(weldServiceImpl.getCode(projectCode));
}
} }
package com.yeejoin.amos.boot.module.ugp.biz.service.impl; package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company; import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.ICompanyService; import com.yeejoin.amos.boot.module.ugp.api.service.ICompanyService;
import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto; import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto;
import org.apache.lucene.queryparser.flexible.messages.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale;
/** /**
* 企业信息表服务实现类 * 企业信息表服务实现类
...@@ -16,18 +26,44 @@ import java.util.List; ...@@ -16,18 +26,44 @@ import java.util.List;
* @date 2022-09-22 * @date 2022-09-22
*/ */
@Service @Service
public class CompanyServiceImpl extends BaseService<CompanyDto,Company,CompanyMapper> implements ICompanyService { public class CompanyServiceImpl extends BaseService<CompanyDto, Company, CompanyMapper> implements ICompanyService {
@Autowired
CompanyMapper companyMapper;
/** /**
* 分页查询 * 分页查询
*/ */
public Page<CompanyDto> queryForCompanyPage(Page<CompanyDto> page) { public Page<CompanyDto> queryForCompanyPage(Page<CompanyDto> page) {
return this.queryForPage(page, null, false); return this.queryForPage(page, null, false);
} }
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<CompanyDto> queryForCompanyList() { public List<CompanyDto> queryForCompanyList() {
return this.queryForList("" , false); return this.queryForList("", false);
}
@Override
public void modifyCompanyInfo(Company companyList)throws Exception {
try{
LambdaUpdateWrapper<Company> wrapper=new LambdaUpdateWrapper<>();
wrapper.eq(Company::getSequenceNbr,companyList.getSequenceNbr());
//获取数据库所有数据
List<Company> list = companyMapper.selectList(null);
for (Company i:list){
if (i.getName()!=companyList.getName()) {
companyMapper.update(companyList,wrapper);
} else {
throw new Exception("企业名称不能相同");
}
}
} catch (Exception e) {
throw new Exception(e);
}
} }
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum;
import com.yeejoin.amos.boot.module.ugp.api.Util.CommonResponse;
import com.yeejoin.amos.boot.module.ugp.api.Util.HttpUtil;
import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
@Service
public class ProjectInitiationServiceImpl {
@Autowired
WorkflowExcuteServiceImpl workflowExcuteService;
@Autowired
WorkflowFeignService workflowFeignService;
private final Logger logger = LoggerFactory.getLogger(ProjectInitiationServiceImpl.class);
@Value("${params.work.flow.processDefinitionKey}")
private String processDefinitionKey;
public ResponseModel start() throws Exception {
String instanceId = workflowExcuteService.startAndComplete(processDefinitionKey,null);
JSONObject jsonObject = workflowFeignService.getTask(instanceId);
// workflowFeignService.completeByVariable(,)
return CommonResponseUtil.success();
}
// public JSONObject startNew(String processDefinitionKey) {
// String url = buildUrl(address, ProjectInitiationEnum.合并启动流程, null);
// Map<String, String> headerMap = Maps.newHashMap();
// headerMap.put(XJConstant.TOKEN_KEY, RequestContext.getToken());
// headerMap.put(XJConstant.PRODUCT, RequestContext.getProduct());
// headerMap.put(XJConstant.APPKEY, RequestContext.getAppKey());
// JSONObject body = new JSONObject();
// body.put("processDefinitionKey", processDefinitionKey);
// String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap);
// logger.info("\r\n请求路径=======================>" + url + "\r\n请求参数=======================>" + body + "\r\n返回参数=======================>" + resultStr);
// return JSON.parseObject(resultStr);
// }
//
// private String buildUrl(String address, ProjectInitiationEnum projectInitiationEnum, Map<String, String> map) {
// String uri = projectInitiationEnum.getUri();
// String params = projectInitiationEnum.getParams();
// if (!StringUtils.isEmpty(params) && map != null) {
// String[] paramsArr = params.split(",");
// for (String param : paramsArr) {
// uri = uri.replace("{" + param + "}", map.get(param));
// }
// }
// return address + uri;
// }
}
package com.yeejoin.amos.boot.module.ugp.biz.service.impl; package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Weld; import com.yeejoin.amos.boot.module.ugp.api.entity.Weld;
import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IWeldService; import com.yeejoin.amos.boot.module.ugp.api.service.IWeldService;
import com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto; import com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto;
import org.apache.poi.hpsf.Array;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.*;
/** /**
* 焊口信息表服务实现类 * 焊口信息表服务实现类
...@@ -16,18 +24,43 @@ import java.util.List; ...@@ -16,18 +24,43 @@ import java.util.List;
* @date 2022-09-22 * @date 2022-09-22
*/ */
@Service @Service
public class WeldServiceImpl extends BaseService<WeldDto,Weld,WeldMapper> implements IWeldService { public
class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements IWeldService {
@Autowired
WeldMapper weldMapper;
/** /**
* 分页查询 * 分页查询
*/ */
public Page<WeldDto> queryForWeldPage(Page<WeldDto> page) { public Page<WeldDto> queryForWeldPage(Page<WeldDto> page) {
return this.queryForPage(page, null, false); return this.queryForPage(page, null, false);
} }
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<WeldDto> queryForWeldList() { public List<WeldDto> queryForWeldList() {
return this.queryForList("" , false); return this.queryForList("", false);
}
/**
* 生成焊口编号保存并查询
*/
public void getCode(Long projectCode, int number) throws Exception {
/**
* 获取前端传递的数据
*/
for (int i = 0; i <= number - 1; i++) {
Weld weld = new Weld();
String code = "XM" + (int) ((Math.random() * 9 + 1) * 10000000) + "-HK" + (int) ((Math.random() * 9 + 1) * 1000);
weld.setRecDate(new Date());
weld.setIsDelete(true);
weld.setProjectId(projectCode);
weld.setCode(code);
save(weld);
}
} }
} }
\ No newline at end of file
...@@ -27,4 +27,6 @@ emqx.broker=tcp://172.16.10.90:1883 ...@@ -27,4 +27,6 @@ emqx.broker=tcp://172.16.10.90:1883
emqx.user-name=super emqx.user-name=super
emqx.password=123456 emqx.password=123456
fire-rescue=123 fire-rescue=123
\ No newline at end of file
params.work.flow.processDefinitionKey=ceshi
\ 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