桩停用增加提示语

This commit is contained in:
yuyang 2022-08-26 15:34:12 +08:00
parent 1a00701bd4
commit c5fd596a15
12 changed files with 44 additions and 13 deletions

View File

@ -100,7 +100,10 @@ public class XhpcChargingPileController extends BaseController {
@Log(title = "桩-停用", businessType = BusinessType.UPDATE)
@PostMapping(value = "/updateStatus")
public AjaxResult updateStatus(@RequestBody XhpcChargingPile xhpcChargingPile) {
return xhpcChargingPileService.updateStatus(xhpcChargingPile.getChargingPileId(), xhpcChargingPile.getStatus());
if(null==xhpcChargingPile.getPrompt() || xhpcChargingPile.getPrompt().length()>50){
return AjaxResult.error("桩提示语为空且50字之内");
}
return xhpcChargingPileService.updateStatus(xhpcChargingPile.getChargingPileId(), xhpcChargingPile.getStatus(),xhpcChargingPile.getPrompt());
}
/**

View File

@ -58,7 +58,10 @@ public class XhpcTerminalController extends BaseController {
if(null==xhpcTerminal.getStatus()){
return AjaxResult.error("桩数据状态为空");
}
return xhpcTerminalService.updateStatus(xhpcTerminal.getTerminalId(), xhpcTerminal.getStatus());
if(null==xhpcTerminal.getPrompt() || xhpcTerminal.getPrompt().length()>50){
return AjaxResult.error("桩提示语为空且50字之内");
}
return xhpcTerminalService.updateStatus(xhpcTerminal.getTerminalId(), xhpcTerminal.getStatus(),xhpcTerminal.getPrompt());
}
/**

View File

@ -126,5 +126,5 @@ public interface XhpcChargingPileMapper {
* @param chargingPileId
* @return
*/
int xhpcTerminalSataus(@Param("chargingPileId") Long chargingPileId,@Param("status") Integer status);
int xhpcTerminalSataus(@Param("chargingPileId") Long chargingPileId,@Param("status") Integer status,@Param("prompt")String prompt);
}

View File

@ -52,7 +52,7 @@ public interface XhpcTerminalMapper {
* @param xhpcTerminal 终端
* @return 结果
*/
int updateXhpcTerminal(@Param("name") String name,@Param("serialNumber") String serialNumber,@Param("connectorType") Integer connectorType,@Param("status") Integer status,@Param("terminalId") Long terminalId);
int updateXhpcTerminal(@Param("name") String name,@Param("serialNumber") String serialNumber,@Param("connectorType") Integer connectorType,@Param("status") Integer status,@Param("terminalId") Long terminalId,@Param("prompt")String prompt);
/**
* 添加终端

View File

@ -53,7 +53,7 @@ public interface IXhpcChargingPileService {
*
* @return
*/
AjaxResult updateStatus(Long chargingPileId, Integer status);
AjaxResult updateStatus(Long chargingPileId, Integer status,String prompt);
/**

View File

@ -31,7 +31,7 @@ public interface IXhpcTerminalService {
* 停用
* @return
*/
AjaxResult updateStatus(Long terminalId,Integer status);
AjaxResult updateStatus(Long terminalId,Integer status,String prompt);
/**
* 查询

View File

@ -314,13 +314,13 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
@Override
@Transactional
public AjaxResult updateStatus(Long chargingPileId, Integer status) {
public AjaxResult updateStatus(Long chargingPileId, Integer status,String prompt) {
if(status ==0 || status ==1){
XhpcChargingPile xhpc = xhpcChargingPileMapper.selectXhpcChargingPileById(chargingPileId);
xhpc.setStatus(status);
xhpcChargingPileMapper.updaeXhpcChargingPile(xhpc);
//修改枪状态 0正常 1停用
xhpcChargingPileMapper.xhpcTerminalSataus(chargingPileId,status);
xhpcChargingPileMapper.xhpcTerminalSataus(chargingPileId,status,prompt);
return AjaxResult.success();
}
return AjaxResult.error("修改状态不对请重新编辑");

View File

@ -66,11 +66,11 @@ public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTermina
}
@Override
public AjaxResult updateStatus(Long terminalId, Integer status) {
public AjaxResult updateStatus(Long terminalId, Integer status,String prompt) {
System.out.println(">>>>>>>>>>terminalId>>>>>>>>>"+terminalId);
System.out.println(">>>>>>>>>>status>>>>>>>>>"+status);
xhpcTerminalMapper.updateXhpcTerminal(null,null,null,status,terminalId);
xhpcTerminalMapper.updateXhpcTerminal(null,null,null,status,terminalId,prompt);
return AjaxResult.success();
}
@ -84,7 +84,7 @@ public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTermina
@Override
public AjaxResult updateXhpcTerminalName(Long terminalId, String name, String serialNumber,int connectorType) {
xhpcTerminalMapper.updateXhpcTerminal(name,serialNumber,connectorType,null,terminalId);
xhpcTerminalMapper.updateXhpcTerminal(name,serialNumber,connectorType,null,terminalId,null);
return AjaxResult.success();
}

View File

@ -520,7 +520,7 @@
<update id="xhpcTerminalSataus">
update xhpc_terminal
set status = #{status}
set status = #{status} and prompt=#{prompt}
where charging_pile_id = #{chargingPileId}
</update>
</mapper>

View File

@ -23,7 +23,7 @@
<result property="rateModelId" column="rate_model_id"/>
<result property="operatorIdEvcs" column="operator_id_evcs"/>
<result property="connectorType" column="connector_type" />
<result property="prompt" column="prompt" />
</resultMap>
<sql id="selectXhpcTerminalVo">
@ -133,6 +133,9 @@
<if test="connectorType != null">
connector_type = #{connectorType},
</if>
<if test="prompt != null and prompt !=''">
prompt = #{prompt},
</if>
</set>
where terminal_id = #{terminalId}
</update>

View File

@ -123,6 +123,9 @@ public class XhpcChargingPile extends BaseEntity {
@Excel(name = "设备类型")
private String equipmentTypeName;
//桩停用提示语
private String prompt;
public String getTypeName() {
return typeName;
@ -441,4 +444,11 @@ public class XhpcChargingPile extends BaseEntity {
this.chargingStationName = chargingStationName;
}
public String getPrompt() {
return prompt;
}
public void setPrompt(String prompt) {
this.prompt = prompt;
}
}

View File

@ -89,6 +89,9 @@ public class XhpcTerminal extends BaseEntity {
@Column(name = "number", nullable = true)
private Integer number;
private String prompt;
public int getConnectorType() {
return connectorType;
@ -230,6 +233,14 @@ public class XhpcTerminal extends BaseEntity {
this.number = number;
}
public String getPrompt() {
return prompt;
}
public void setPrompt(String prompt) {
this.prompt = prompt;
}
@Override
public String toString() {
return "XhpcTerminal{" +
@ -247,6 +258,7 @@ public class XhpcTerminal extends BaseEntity {
", operatorIdEvcs='" + operatorIdEvcs + '\'' +
", connectorType=" + connectorType +
", number=" + number +
", prompt='" + prompt + '\'' +
'}';
}
}