企业列表出来了

master
法外狂徒张三 2024-09-06 00:19:35 +08:00
parent b07cf2fcd9
commit 76d0be89a4
6 changed files with 350 additions and 25 deletions

View File

@ -5,13 +5,16 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="72651396-d9d2-4022-b080-e21d75d1bedb" name="更改" comment="企业列表出来了"> <list default="true" id="72651396-d9d2-4022-b080-e21d75d1bedb" name="更改" comment="企业列表出来了">
<change afterPath="$PROJECT_DIR$/cloud-market-common/src/main/java/com/muyu/market/domain/ReqMsg.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/controller/ReqMsgController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/mapper/ReqMsgMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/service/IReqMsgService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/service/impl/ReqMsgServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/logs/cloud-system/error.2024-09-02.log" afterDir="false" /> <change afterPath="$PROJECT_DIR$/logs/cloud-system/error.2024-09-02.log" afterDir="false" />
<change afterPath="$PROJECT_DIR$/logs/cloud-system/error.2024-09-03.log" afterDir="false" /> <change afterPath="$PROJECT_DIR$/logs/cloud-system/error.2024-09-03.log" afterDir="false" />
<change afterPath="$PROJECT_DIR$/logs/cloud-system/info.2024-09-02.log" afterDir="false" /> <change afterPath="$PROJECT_DIR$/logs/cloud-system/info.2024-09-02.log" afterDir="false" />
<change afterPath="$PROJECT_DIR$/logs/cloud-system/info.2024-09-03.log" afterDir="false" /> <change afterPath="$PROJECT_DIR$/logs/cloud-system/info.2024-09-03.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cloud-market-common/src/main/java/com/muyu/market/config/SimpleWeatherConfig.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-market-common/src/main/java/com/muyu/market/config/SimpleWeatherConfig.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cloud-market-common/src/main/java/com/muyu/market/config/ThirdPartyConfig.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-market-common/src/main/java/com/muyu/market/config/ThirdPartyConfig.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/cloud-system/error.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/cloud-system/error.log" afterDir="false" /> <change beforePath="$PROJECT_DIR$/logs/cloud-system/error.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/cloud-system/error.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/logs/cloud-system/info.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/cloud-system/info.log" afterDir="false" /> <change beforePath="$PROJECT_DIR$/logs/cloud-system/info.log" beforeDir="false" afterPath="$PROJECT_DIR$/logs/cloud-system/info.log" afterDir="false" />
</list> </list>
@ -68,33 +71,34 @@
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;, "RequestMappingsPanelOrder0": "0",
&quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;, "RequestMappingsPanelOrder1": "1",
&quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;, "RequestMappingsPanelWidth0": "75",
&quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;, "RequestMappingsPanelWidth1": "75",
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;, "WebServerToolWindowFactoryState": "false",
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;, "last_opened_file_path": "E:/桌面/cloud-market/cloud-market-server/src/main/java/com/muyu/market/controller",
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;, "node.js.detected.package.eslint": "true",
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;, "node.js.detected.package.tslint": "true",
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.eslint": "(autodetect)",
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;, "node.js.selected.package.tslint": "(autodetect)",
&quot;settings.editor.selected.configurable&quot;: &quot;reference.settings.project.maven.repository.indices&quot;, "nodejs_package_manager_path": "npm",
&quot;spring.configuration.checksum&quot;: &quot;647853898192e405c7aff8ecac5564ea&quot;, "settings.editor.selected.configurable": "reference.settings.project.maven.repository.indices",
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot; "spring.configuration.checksum": "647853898192e405c7aff8ecac5564ea",
"vue.rearranger.settings.migration": "true"
} }
}</component> }]]></component>
<component name="ReactorSettings"> <component name="ReactorSettings">
<option name="notificationShown" value="true" /> <option name="notificationShown" value="true" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\Administrator\Downloads\cloud-market\cloud-market-server\src\main\resources\mapper\market" /> <recent name="E:\桌面\cloud-market\cloud-market-server\src\main\java\com\muyu\market\controller" />
<recent name="C:\Users\Administrator\Downloads\cloud-market\cloud-market-common\src\main\java\com\muyu\market\domain" /> <recent name="E:\桌面\cloud-market\cloud-market-server\src\main\java\com\muyu\market\service\impl" />
<recent name="C:\Users\Administrator\Downloads\cloud-market\cloud-market-server\src\main\java\com\muyu\market\service\impl" /> <recent name="E:\桌面\cloud-market\cloud-market-server\src\main\java\com\muyu\market\service" />
<recent name="C:\Users\Administrator\Downloads\cloud-market\cloud-market-server\src\main\java\com\muyu\market\service" /> <recent name="E:\桌面\cloud-market\cloud-market-server\src\main\java\com\muyu\market\mapper" />
<recent name="C:\Users\Administrator\Downloads\cloud-market\cloud-market-server\src\main\java\com\muyu\market\mapper" /> <recent name="E:\桌面\cloud-market\cloud-market-common\src\main\java\com\muyu\market\domain" />
</key> </key>
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="E:\桌面\cloud-modules-market" /> <recent name="E:\桌面\cloud-modules-market" />
@ -182,7 +186,8 @@
<workItem from="1725517357652" duration="1395000" /> <workItem from="1725517357652" duration="1395000" />
<workItem from="1725528983357" duration="20000" /> <workItem from="1725528983357" duration="20000" />
<workItem from="1725534330399" duration="6000" /> <workItem from="1725534330399" duration="6000" />
<workItem from="1725535072504" duration="2629000" /> <workItem from="1725535072504" duration="2640000" />
<workItem from="1725538502773" duration="4219000" />
</task> </task>
<task id="LOCAL-00001" summary="初始化"> <task id="LOCAL-00001" summary="初始化">
<created>1724047244829</created> <created>1724047244829</created>
@ -422,7 +427,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1725537357138</updated> <updated>1725537357138</updated>
</task> </task>
<option name="localTasksCounter" value="35" /> <task id="LOCAL-00035" summary="企业列表出来了">
<created>1725537729463</created>
<option name="number" value="00035" />
<option name="presentableId" value="LOCAL-00035" />
<option name="project" value="LOCAL" />
<updated>1725537729463</updated>
</task>
<option name="localTasksCounter" value="36" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">

View File

@ -0,0 +1,67 @@
package com.muyu.market.domain;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* req_msg
*
* @author 2112A
* @date 2024-09-05
*/
@Data
@Setter
@Getter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName("req_msg")
public class ReqMsg extends BaseEntity{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
@TableId( type = IdType.AUTO)
private Long reqId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String reqName;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String reqType;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String reqYorn;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String reqMsg;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long sysId;
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("reqId", getReqId())
.append("reqName", getReqName())
.append("reqType", getReqType())
.append("reqYorn", getReqYorn())
.append("reqMsg", getReqMsg())
.append("sysId", getSysId())
.toString();
}
}

View File

@ -0,0 +1,112 @@
package com.muyu.market.controller;
import java.util.Arrays;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.market.domain.ReqMsg;
import com.muyu.market.service.IReqMsgService;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.security.utils.SecurityUtils;
import org.springframework.validation.annotation.Validated;
import com.muyu.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author 2112A
* @date 2024-09-05
*/
@RestController
@RequestMapping("/msg")
public class ReqMsgController extends BaseController
{
@Resource
private IReqMsgService reqMsgService;
/**
*
*/
@RequiresPermissions("reqmsg:msg:list")
@GetMapping("/list")
public Result<TableDataInfo<ReqMsg>> list(ReqMsg reqMsg)
{
startPage();
List<ReqMsg> list = reqMsgService.selectReqMsgList(reqMsg);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("reqmsg:msg:export")
@PostMapping("/export")
public void export(HttpServletResponse response, ReqMsg reqMsg)
{
List<ReqMsg> list = reqMsgService.selectReqMsgList(reqMsg);
ExcelUtil<ReqMsg> util = new ExcelUtil<ReqMsg>(ReqMsg.class);
util.exportExcel(response, list, "请求报文数据");
}
/**
*
*/
@RequiresPermissions("reqmsg:msg:query")
@GetMapping(value = "/{reqId}")
public Result<List<ReqMsg>> getInfo(@PathVariable("reqId") Long reqId)
{
return success(reqMsgService.selectReqMsgByReqId(reqId));
}
/**
*
*/
@RequiresPermissions("reqmsg:msg:add")
@PostMapping
public Result<Integer> add(
@Validated @RequestBody ReqMsg reqMsg)
{
if (reqMsgService.checkIdUnique(reqMsg)) {
return error("新增 请求报文 '" + reqMsg + "'失败,请求报文已存在");
}
reqMsg.setCreateBy(SecurityUtils.getUsername());
return toAjax(reqMsgService.save(reqMsg));
}
/**
*
*/
@RequiresPermissions("reqmsg:msg:edit")
@PutMapping
public Result<Integer> edit(
@Validated @RequestBody ReqMsg reqMsg)
{
if (!reqMsgService.checkIdUnique(reqMsg)) {
return error("修改 请求报文 '" + reqMsg + "'失败,请求报文不存在");
}
reqMsg.setUpdateBy(SecurityUtils.getUsername());
return toAjax(reqMsgService.updateById(reqMsg));
}
/**
*
*/
@RequiresPermissions("reqmsg:msg:remove")
@DeleteMapping("/{reqIds}")
public Result<Integer> remove(@PathVariable("reqIds") Long[] reqIds)
{
reqMsgService.removeBatchByIds(Arrays.asList(reqIds));
return success();
}
}

View File

@ -0,0 +1,17 @@
package com.muyu.market.mapper;
import java.util.List;
import com.muyu.market.domain.ReqMsg;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author 2112A
* @date 2024-09-05
*/
@Mapper
public interface ReqMsgMapper extends BaseMapper<ReqMsg>{
}

View File

@ -0,0 +1,37 @@
package com.muyu.market.service;
import java.util.List;
import com.muyu.market.domain.ReqMsg;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* Service
*
* @author 2112A
* @date 2024-09-05
*/
public interface IReqMsgService extends IService<ReqMsg> {
/**
*
*
* @param reqId
* @return
*/
public ReqMsg selectReqMsgByReqId(Long reqId);
/**
*
*
* @param reqMsg
* @return
*/
public List<ReqMsg> selectReqMsgList(ReqMsg reqMsg);
/**
* id
* @param reqMsg
* @return
*/
Boolean checkIdUnique(ReqMsg reqMsg);
}

View File

@ -0,0 +1,80 @@
package com.muyu.market.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import com.muyu.market.mapper.ReqMsgMapper;
import com.muyu.market.domain.ReqMsg;
import com.muyu.market.service.IReqMsgService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.utils.StringUtils;
import org.springframework.util.Assert;
/**
* Service
*
* @author 2112A
* @date 2024-09-05
*/
@Service
public class ReqMsgServiceImpl
extends ServiceImpl<ReqMsgMapper, ReqMsg>
implements IReqMsgService {
/**
*
*
* @param reqId
* @return
*/
@Override
public ReqMsg selectReqMsgByReqId(Long reqId)
{
LambdaQueryWrapper<ReqMsg> queryWrapper = new LambdaQueryWrapper<>();
Assert.notNull(reqId, "reqId不可为空");
queryWrapper.eq(ReqMsg::getReqId, reqId);
return this.getOne(queryWrapper);
}
/**
*
*
* @param reqMsg
* @return
*/
@Override
public List<ReqMsg> selectReqMsgList(ReqMsg reqMsg)
{
LambdaQueryWrapper<ReqMsg> queryWrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotEmpty(reqMsg.getReqName())){
queryWrapper.like(ReqMsg::getReqName, reqMsg.getReqName());
}
if (StringUtils.isNotEmpty(reqMsg.getReqType())){
queryWrapper.eq(ReqMsg::getReqType, reqMsg.getReqType());
}
if (StringUtils.isNotEmpty(reqMsg.getReqYorn())){
queryWrapper.eq(ReqMsg::getReqYorn, reqMsg.getReqYorn());
}
if (StringUtils.isNotEmpty(reqMsg.getReqMsg())){
queryWrapper.eq(ReqMsg::getReqMsg, reqMsg.getReqMsg());
}
if (StringUtils.isNotEmpty(new Long[]{reqMsg.getSysId()})){
queryWrapper.eq(ReqMsg::getSysId, reqMsg.getSysId());
}
return this.list(queryWrapper);
}
/**
*
* @param reqMsg
* @return
*/
@Override
public Boolean checkIdUnique(ReqMsg reqMsg) {
LambdaQueryWrapper<ReqMsg> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ReqMsg::getReqId, reqMsg.getReqId());
return this.count(queryWrapper) > 0;
}
}