Commit 620763b2 authored by hezhuozhi's avatar hezhuozhi

提交工作台信息

parent 79d851fa
...@@ -19,7 +19,7 @@ public enum BusinessTypeEnum { ...@@ -19,7 +19,7 @@ public enum BusinessTypeEnum {
HYGF_YSLC("AcceptanceCheck", "验收流程"), HYGF_YSLC("AcceptanceCheck", "验收流程"),
HYGF_BWLC("GridConnected", "并网流程"), HYGF_BWLC("GridConnected", "并网流程"),
HYGF_SGLCSH("ProcessEngineering", "施工流程审核"), HYGF_SGLCSH("ProcessEngineering", "施工流程审核"),
HYGF_REPAY("Repatment", "还款"), HYGF_REPAY("hygf_repayment", "还款"),
; ;
private final String code; private final String code;
......
...@@ -9,7 +9,8 @@ public enum TaskTypeStationEnum { ...@@ -9,7 +9,8 @@ public enum TaskTypeStationEnum {
电站审核("电站审核", "电站审核"), 电站审核("电站审核", "电站审核"),
合同填报("合同填报", "合同填报"), 合同填报("合同填报", "合同填报"),
重置密码("重置密码", "重置密码"), 重置密码("重置密码", "重置密码"),
设置管理员("设置管理员", "设置管理员"); 设置管理员("设置管理员", "设置管理员"),
还款("还款", "还款");
/** /**
* 名称,描述 * 名称,描述
*/ */
......
...@@ -71,7 +71,11 @@ public class ToDoTasks extends BaseEntity { ...@@ -71,7 +71,11 @@ public class ToDoTasks extends BaseEntity {
@TableField("amos_org_code") @TableField("amos_org_code")
private String amosOrgCode; private String amosOrgCode;
/**
*路由地址
*/
@TableField("route_path")
private String routePath;
public ToDoTasks(String type, Long businessId, String taskName,String orgCode) { public ToDoTasks(String type, Long businessId, String taskName,String orgCode) {
...@@ -83,6 +87,16 @@ public class ToDoTasks extends BaseEntity { ...@@ -83,6 +87,16 @@ public class ToDoTasks extends BaseEntity {
this.taskName = taskName; this.taskName = taskName;
} }
public ToDoTasks(String type, Long businessId, String taskName,String orgCode,String routePath) {
this.type = type;
this.businessId = businessId;
this.state = "待办";
this.amosOrgCode = orgCode;
this.creationTime = new Date();
this.taskName = taskName;
this.routePath = routePath;
}
public ToDoTasks() { public ToDoTasks() {
} }
} }
...@@ -17,7 +17,8 @@ import java.util.List; ...@@ -17,7 +17,8 @@ import java.util.List;
*/ */
public interface RepaymentMapper extends BaseMapper<Repayment> { public interface RepaymentMapper extends BaseMapper<Repayment> {
@UserEmpower(field = {"regional_companies_code"}, dealerField = {"regional_companies_code"}, fieldConditions = {"in"}, relationship = "and") @UserEmpower(field = {"regional_companies_code"}, dealerField = {"regional_companies_code"}, fieldConditions = {"in"}, relationship = "and")
List<RepaymentDto> queryPage(); List<RepaymentDto> queryPage(@Param("sequenceNbr") String sequenceNbr, @Param("companyName")String companyName, @Param("loanPeriod")String loanPeriod,
@Param("messageState")String messageState, @Param("repayState")String repayState);
/** /**
* 获取区域公司通过OrgCode * 获取区域公司通过OrgCode
...@@ -25,4 +26,14 @@ public interface RepaymentMapper extends BaseMapper<Repayment> { ...@@ -25,4 +26,14 @@ public interface RepaymentMapper extends BaseMapper<Repayment> {
* @return * @return
*/ */
PrivilegeCompany getPrivilegeCompanyByOrgCode(@Param("orgCode")String orgCode); PrivilegeCompany getPrivilegeCompanyByOrgCode(@Param("orgCode")String orgCode);
/**
* 根据角色和区域公司获取用户Id
* @param companyOrgCode
* @param roleId
* @return
*/
List<String> getTodoUserIds(@Param("companyOrgCode") String companyOrgCode, @Param("roleId") String roleId);
String getSequenceNbrByName(@Param("groupName") String groupName);
} }
...@@ -4,6 +4,23 @@ ...@@ -4,6 +4,23 @@
<select id="queryPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.RepaymentDto"> <select id="queryPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.RepaymentDto">
select * from hygf_repayment select * from hygf_repayment
<where>
<if test="sequenceNbr != null and sequenceNbr != ''">
and sequence_nbr = #{sequenceNbr}
</if>
<if test="companyName != null and companyName != ''">
and company_name like #{companyName}
</if>
<if test="loanPeriod != null and loanPeriod != ''">
and loan_period like #{loanPeriod}
</if>
<if test="messageState != null and messageState != ''">
and message_state = #{messageState}
</if>
<if test="repayState != null and repayState != ''">
and repay_state = #{repayState}
</if>
</where>
order by rec_date DESC order by rec_date DESC
</select> </select>
...@@ -12,4 +29,16 @@ ...@@ -12,4 +29,16 @@
SELECT * FROM privilege_company SELECT * FROM privilege_company
WHERE ORG_CODE=#{orgCode} LIMIT 1 WHERE ORG_CODE=#{orgCode} LIMIT 1
</select> </select>
<select id="getTodoUserIds" resultType="java.lang.String">
SELECT USER_ID FROM privilege_user_org_role puor LEFT JOIN std_user_empower sue ON sue.amos_user_id=puor.USER_ID
WHERE (sue.amos_org_code like #{companyOrgCode} or sue.amos_org_code like '%all%') and puor.ROLE_SEQ=#{roleId}
and sue.permission_type='HYGF'
GROUP BY USER_ID;
</select>
<select id="getSequenceNbrByName" resultType="java.lang.String">
SELECT SEQUENCE_NBR from privilege_group where GROUP_NAME=#{groupName} LIMIT 1
</select>
</mapper> </mapper>
...@@ -216,8 +216,13 @@ public class RepaymentController extends BaseController { ...@@ -216,8 +216,13 @@ public class RepaymentController extends BaseController {
@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<RepaymentDto>> queryForPage(@RequestParam(value = "current") int current, public ResponseModel<Page<RepaymentDto>> queryForPage(@RequestParam(value = "sequenceNbr",required = false) String sequenceNbr,
@RequestParam(value = "companyName",required = false) String companyName,
@RequestParam(value = "loanPeriod",required = false) String loanPeriod,
@RequestParam(value = "messageState",required = false) String messageState,
@RequestParam(value = "repayState",required = false) String repayState,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) { @RequestParam(value = "size") int size) {
return ResponseHelper.buildResponse(repaymentService.queryForRepaymentPage(current, size)); return ResponseHelper.buildResponse(repaymentService.queryForRepaymentPage(sequenceNbr, companyName,loanPeriod,messageState,repayState,current, size));
} }
} }
...@@ -68,7 +68,7 @@ public class CommonServiceImpl { ...@@ -68,7 +68,7 @@ public class CommonServiceImpl {
// private TaskV2FeignService taskV2FeignService; // private TaskV2FeignService taskV2FeignService;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Value("classpath:/json/urlInfo.json") @Value("classpath:/json/hygfRouth.json")
private Resource urlInfo; private Resource urlInfo;
@Autowired @Autowired
SurveyInformationServiceImpl surveyInformationServiceImpl; SurveyInformationServiceImpl surveyInformationServiceImpl;
...@@ -83,6 +83,23 @@ public class CommonServiceImpl { ...@@ -83,6 +83,23 @@ public class CommonServiceImpl {
private static final String TEMP_DIR_NAME = "temp"; private static final String TEMP_DIR_NAME = "temp";
private static final String TEMPLATE_FILE_PATH = "F:\\work\\amos-boot-zx-biz\\amos-boot-system-jxiop\\amos-boot-module-hygf-biz\\src\\main\\resources\\templates\\test.xlsx"; // 模版文件路径 private static final String TEMPLATE_FILE_PATH = "F:\\work\\amos-boot-zx-biz\\amos-boot-system-jxiop\\amos-boot-module-hygf-biz\\src\\main\\resources\\templates\\test.xlsx"; // 模版文件路径
public String getRouthPath(String type,Object model) {
List<Map> urlList = JsonUtils.getResourceList(urlInfo);
String routhPath="";
String urlParams = "";
try {
urlParams = "&" + toQueryParams(model);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
for (Map map : urlList) {
if (map.get("type").equals(type)) {
routhPath = (map.get("url").toString() + urlParams);
break;
}
}
return routhPath;
}
// private static String toQueryParams2(JSONObject jsonObject) { // private static String toQueryParams2(JSONObject jsonObject) {
// StringBuilder sb = new StringBuilder(); // StringBuilder sb = new StringBuilder();
// Set<String> keys = jsonObject.keySet(); // Set<String> keys = jsonObject.keySet();
...@@ -376,32 +393,32 @@ public class CommonServiceImpl { ...@@ -376,32 +393,32 @@ public class CommonServiceImpl {
// } // }
// } // }
// public <T> String toQueryParams(T obj) throws UnsupportedEncodingException { private <T> String toQueryParams(T obj) throws UnsupportedEncodingException {
// StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
//
// for (Class<?> clazz = obj.getClass(); !clazz.equals(Object.class); clazz = clazz.getSuperclass()) { for (Class<?> clazz = obj.getClass(); !clazz.equals(Object.class); clazz = clazz.getSuperclass()) {
// Field[] fields = clazz.getDeclaredFields(); Field[] fields = clazz.getDeclaredFields();
//
// for (Field field : fields) { for (Field field : fields) {
// if (!Modifier.isStatic(field.getModifiers())) { if (!Modifier.isStatic(field.getModifiers())) {
// field.setAccessible(true); field.setAccessible(true);
//
// try { try {
// Object value = field.get(obj); Object value = field.get(obj);
//
// if (value != null && !"".equals(value)) { if (value != null && !"".equals(value)) {
// String encodedValue = URLEncoder.encode(value.toString(), "UTF-8"); String encodedValue = URLEncoder.encode(value.toString(), "UTF-8");
// sb.append(field.getName()).append('=').append(encodedValue).append('&'); sb.append(field.getName()).append('=').append(encodedValue).append('&');
// } }
// } catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
// throw new RuntimeException(e); throw new RuntimeException(e);
// } }
// } }
// } }
// } }
//
// return sb.length() > 0 ? sb.substring(0, sb.length() - 1) : ""; return sb.length() > 0 ? sb.substring(0, sb.length() - 1) : "";
// } }
// /** // /**
// * 更新并完成 // * 更新并完成
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.dto.TasksRole; import com.yeejoin.amos.boot.module.hygf.api.dto.TasksRole;
...@@ -14,6 +16,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.UserMessage; ...@@ -14,6 +16,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.UserMessage;
import com.yeejoin.amos.boot.module.hygf.api.mapper.ToDoTasksMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.ToDoTasksMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.UserMessageMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.UserMessageMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IToDoTasksService; import com.yeejoin.amos.boot.module.hygf.api.service.IToDoTasksService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -47,6 +50,8 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -47,6 +50,8 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
@Autowired @Autowired
protected EmqKeeper emqKeeper; protected EmqKeeper emqKeeper;
@Autowired
Sequence sequence;
final static Logger log = LoggerFactory.getLogger(ToDoTasksServiceImpl.class); final static Logger log = LoggerFactory.getLogger(ToDoTasksServiceImpl.class);
...@@ -78,7 +83,52 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -78,7 +83,52 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
return toDoTasksPage; return toDoTasksPage;
} }
@Transactional
public void completeToDoTasks(ToDoTasks toDoTasks,String meg) {
try {
LambdaQueryWrapper<ToDoTasks> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ToDoTasks::getType, toDoTasks.getType());
wrapper.eq(ToDoTasks::getState, "待办");
wrapper.eq(ToDoTasks::getBusinessId, toDoTasks.getBusinessId());
List<ToDoTasks> doTasks= toDoTasksMapper.selectList(wrapper);
if(CollectionUtils.isNotEmpty(doTasks)){
for (ToDoTasks doTask : doTasks) {
doTask.setState("已办");
doTask.setCompleteTime(new Date());
toDoTasksMapper.updateById(doTask);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(doTasks).getBytes(), 2 ,false);
UserMessage userMessage= new UserMessage( doTask.getType(), doTask.getBusinessId(), doTask.getAmosUserId(), new Date(), doTask.getTaskName()+"已完成."+meg, doTask.getAmosOrgCode());
userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false);
}
}
}catch (Exception e){
e.printStackTrace();
throw new BadRequest("任务更新失败!");
}
}
@Transactional
public void addToDoTasksByUserIds(List<String> userIds, ToDoTasks toDoTasks) {
try {
if(CollectionUtil.isNotEmpty(userIds)){
for (String todoUserId : userIds) {
toDoTasks.setAmosUserId(todoUserId);
toDoTasks.setSequenceNbr(sequence.nextId());
toDoTasksMapper.insert(toDoTasks);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(toDoTasks).getBytes(), 2 ,false);
UserMessage userMessage= new UserMessage( toDoTasks.getType(), toDoTasks.getBusinessId(), toDoTasks.getAmosUserId(), new Date(), toDoTasks.getTaskName()+"待完成", toDoTasks.getAmosOrgCode());
userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false);
}
}else {
log.error("用户为空,不进行添加待办和发送消息");
}
}catch (Exception e){
e.printStackTrace();
throw new BadRequest("任务添加失败!");
}
}
@Override @Override
@Transactional @Transactional
......
[
{
"type": "AbarbeitungWaitPush",
"pageType": "",
"name": "推送融资",
"url": "/mixuap?appId=1678340647909617665&id=1774627124162859009"
},
{
"type": "WaitAbarbeitung",
"pageType": "",
"name": "经销商整改",
"url": "/mixuap?appId=1678340647909617665&id=1806150815363108865"
},
{
"type": "FinancingAudit",
"pageType": "",
"name": "融资审核",
"url": "/mixuap?appId=1678340647909617665&id=1775075407041662977"
},
{
"type": "AuditPass",
"pageType": "",
"name": "线下放款",
"url": "/mixuap?appId=1678340647909617665&id=1805852764345995265"
},
{
"type": "jxs_03",
"pageType": "",
"name": "经销商管理员审核",
"url": "/mixuap?appId=1678340647909617665&id=1686219644483956738"
},
{
"type": "hygf_02",
"pageType": "",
"name": "经销商确认",
"url": "/mixuap?appId=1677158789557547009&id=1677158800043307009"
},
{
"type": "hygf_03",
"pageType": "",
"name": "设计审核",
"url": "/mixuap?appId=1677158789557547009&id=1680021027779801090"
},
{
"type": "hygf_05",
"pageType": "",
"name": "投融审核",
"url": "/mixuap?appId=1677158789557547009&id=1680021027779801090"
},
{
"type": "hygf_07",
"pageType": "",
"name": "法务审核",
"url": "/mixuap?appId=1677158789557547009&id=1680021027779801090"
},
{
"type": "hygf_09",
"pageType": "",
"name": "设计上传典型图库",
"url": "/mixuap?appId=1677158789557547009&id=1680021027779801090"
},
{
"type": "hygf_10",
"pageType": "",
"name": "经销商设计人员上传设计图",
"url": "/mixuap?appId=1677158789557547009&id=1680021027779801090"
},
{
"type": "hygf_11",
"pageType": "",
"name": "设计图纸审核",
"url": "/mixuap?appId=1677158789557547009&id=1680021027779801090"
},
{
"type": "hygf_bw1",
"pageType": "",
"name": "并网登记提交",
"url": "/mixuap?appId=1677158789557547009&id=1747156510238076929"
},
{
"type": "hygf_bw2",
"pageType": "",
"name": "并网管理端工程审核",
"url": "/mixuap?appId=1678340647909617665&id=1747528027618701313"
},
{
"type": "hygf_ys1",
"pageType": "",
"name": "经销商工程提交验收",
"url": "/mixuap?appId=1677158789557547009&id=1747168313215053826"
},
{
"type": "hygf_ys2",
"pageType": "",
"name": "管理端投融审核",
"url": "/mixuap?appId=1678340647909617665&id=1747528027618701313"
},
{
"type": "hygf_zg_tr",
"pageType": "",
"name": "整改单",
"url": "/mixuap?appId=1677158789557547009&id=1747168313215053826"
},
{
"type": "hygf_ys3",
"pageType": "",
"name": "管理端法务审核",
"url": "/mixuap?appId=1678340647909617665&id=1747528027618701313"
},
{
"type": "hygf_zg_fw",
"pageType": "",
"name": "整改单",
"url": "/mixuap?appId=1677158789557547009&id=1747168313215053826"
},
{
"type": "hygf_ys4",
"pageType": "",
"name": "管理端工程审核",
"url": "/mixuap?appId=1678340647909617665&id=1747528027618701313"
},
{
"type": "hygf_zg_gc",
"pageType": "",
"name": "整改单",
"url": "/mixuap?appId=1677158789557547009&id=1747168313215053826"
},
{
"type": "hygf_ys5",
"pageType": "",
"name": "管理端工程是否线下",
"url": "/mixuap?appId=1678340647909617665&id=1747528027618701313"
},
{
"type": "hygf_ys6",
"pageType": "",
"name": "管理端工程线下验",
"url": "/mixuap?appId=1678340647909617665&id=1747528027618701313"
},
{
"type": "hygf_zg_xx",
"pageType": "",
"name": "整改单",
"url": "/mixuap?appId=1677158789557547009&id=1747168313215053826"
},
{
"type": "fh_dtj",
"pageType": "",
"name": "待发货",
"url": ""
},
{
"type": "fh_dyr",
"pageType": "",
"name": "待确认",
"url": ""
},
{
"type": "fh_dsh",
"pageType": "",
"name": "待审核",
"url": ""
},
{
"type": "fh_sqbh",
"pageType": "",
"name": "申请补货",
"url": ""
},
{
"type": "Activity_0bs6t4g",
"pageType": "",
"name": "下发整改单",
"url": ""
},
{
"type": "Activity_0ku0pw4",
"pageType": "",
"name": "填写整改单",
"url": ""
},
{
"type": "Activity_0e6eabb",
"pageType": "",
"name": "整改单审核",
"url": ""
},
{
"type": "Activity_0bs6t4g",
"pageType": "",
"name": "验收提交",
"url": ""
},
{
"type": "Activity_0ojajec",
"pageType": "",
"name": "经销商管理员审核",
"url": ""
},
{
"type": "Activity_0edftmv",
"pageType": "",
"name": "片区审核",
"url": ""
},
{
"type": "Activity_1rjn5s1",
"pageType": "",
"name": "投融/法务审核",
"url": ""
},
{
"type": "Activity_0rbc0gc",
"pageType": "",
"name": "资产审核",
"url": ""
},
{
"type": "Activity_0bs6t4g",
"pageType": "",
"name": "并网登记",
"url": ""
},
{
"type": "Activity_0r2x1es",
"pageType": "",
"name": "经销商管理审核",
"url": ""
},
{
"type": "Activity_05nlkey",
"pageType": "",
"name": "片区审核",
"url": ""
},
{
"type": "Activity_0k4o46e",
"pageType": "",
"name": "设计审核/工程审核",
"url": ""
},
{
"type": "Activity_0bs6t4g",
"pageType": "",
"name": "施工完成提交",
"url": ""
},
{
"type": "Activity_1spujef",
"pageType": "",
"name": "完工登记提交",
"url": ""
},
{
"type": "Activity_16r1828",
"pageType": "",
"name": "完工自审",
"url": ""
},
{
"type": "Activity_1bldcno",
"pageType": "",
"name": "完工自审-片区运营中心",
"url": ""
},
{
"type": "Activity_1yftt2k",
"pageType": "",
"name": "工程审核",
"url": ""
},
{
"type": "Activity_095if3p",
"pageType": "",
"name": "设计审核",
"url": ""
},
{
"type": "hygf_repayment",
"pageType": "",
"name": "还款管理",
"url": "/mixuap?appId=1678340647909617665&id=1846106343904120833"
}
]
\ 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