桩停用增加提示语
This commit is contained in:
parent
1a00701bd4
commit
c5fd596a15
@ -100,7 +100,10 @@ public class XhpcChargingPileController extends BaseController {
|
|||||||
@Log(title = "桩-停用", businessType = BusinessType.UPDATE)
|
@Log(title = "桩-停用", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping(value = "/updateStatus")
|
@PostMapping(value = "/updateStatus")
|
||||||
public AjaxResult updateStatus(@RequestBody XhpcChargingPile xhpcChargingPile) {
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -58,7 +58,10 @@ public class XhpcTerminalController extends BaseController {
|
|||||||
if(null==xhpcTerminal.getStatus()){
|
if(null==xhpcTerminal.getStatus()){
|
||||||
return AjaxResult.error("桩数据状态为空");
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -126,5 +126,5 @@ public interface XhpcChargingPileMapper {
|
|||||||
* @param chargingPileId
|
* @param chargingPileId
|
||||||
* @return
|
* @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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public interface XhpcTerminalMapper {
|
|||||||
* @param xhpcTerminal 终端
|
* @param xhpcTerminal 终端
|
||||||
* @return 结果
|
* @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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加终端
|
* 添加终端
|
||||||
|
|||||||
@ -53,7 +53,7 @@ public interface IXhpcChargingPileService {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult updateStatus(Long chargingPileId, Integer status);
|
AjaxResult updateStatus(Long chargingPileId, Integer status,String prompt);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public interface IXhpcTerminalService {
|
|||||||
* 停用
|
* 停用
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult updateStatus(Long terminalId,Integer status);
|
AjaxResult updateStatus(Long terminalId,Integer status,String prompt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询
|
* 查询
|
||||||
|
|||||||
@ -314,13 +314,13 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public AjaxResult updateStatus(Long chargingPileId, Integer status) {
|
public AjaxResult updateStatus(Long chargingPileId, Integer status,String prompt) {
|
||||||
if(status ==0 || status ==1){
|
if(status ==0 || status ==1){
|
||||||
XhpcChargingPile xhpc = xhpcChargingPileMapper.selectXhpcChargingPileById(chargingPileId);
|
XhpcChargingPile xhpc = xhpcChargingPileMapper.selectXhpcChargingPileById(chargingPileId);
|
||||||
xhpc.setStatus(status);
|
xhpc.setStatus(status);
|
||||||
xhpcChargingPileMapper.updaeXhpcChargingPile(xhpc);
|
xhpcChargingPileMapper.updaeXhpcChargingPile(xhpc);
|
||||||
//修改枪状态 0正常 1停用
|
//修改枪状态 0正常 1停用
|
||||||
xhpcChargingPileMapper.xhpcTerminalSataus(chargingPileId,status);
|
xhpcChargingPileMapper.xhpcTerminalSataus(chargingPileId,status,prompt);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
return AjaxResult.error("修改状态不对请重新编辑");
|
return AjaxResult.error("修改状态不对请重新编辑");
|
||||||
|
|||||||
@ -66,11 +66,11 @@ public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTermina
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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(">>>>>>>>>>terminalId>>>>>>>>>"+terminalId);
|
||||||
System.out.println(">>>>>>>>>>status>>>>>>>>>"+status);
|
System.out.println(">>>>>>>>>>status>>>>>>>>>"+status);
|
||||||
xhpcTerminalMapper.updateXhpcTerminal(null,null,null,status,terminalId);
|
xhpcTerminalMapper.updateXhpcTerminal(null,null,null,status,terminalId,prompt);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTermina
|
|||||||
@Override
|
@Override
|
||||||
public AjaxResult updateXhpcTerminalName(Long terminalId, String name, String serialNumber,int connectorType) {
|
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();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -520,7 +520,7 @@
|
|||||||
|
|
||||||
<update id="xhpcTerminalSataus">
|
<update id="xhpcTerminalSataus">
|
||||||
update xhpc_terminal
|
update xhpc_terminal
|
||||||
set status = #{status}
|
set status = #{status} and prompt=#{prompt}
|
||||||
where charging_pile_id = #{chargingPileId}
|
where charging_pile_id = #{chargingPileId}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
<result property="rateModelId" column="rate_model_id"/>
|
<result property="rateModelId" column="rate_model_id"/>
|
||||||
<result property="operatorIdEvcs" column="operator_id_evcs"/>
|
<result property="operatorIdEvcs" column="operator_id_evcs"/>
|
||||||
<result property="connectorType" column="connector_type" />
|
<result property="connectorType" column="connector_type" />
|
||||||
|
<result property="prompt" column="prompt" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectXhpcTerminalVo">
|
<sql id="selectXhpcTerminalVo">
|
||||||
@ -133,6 +133,9 @@
|
|||||||
<if test="connectorType != null">
|
<if test="connectorType != null">
|
||||||
connector_type = #{connectorType},
|
connector_type = #{connectorType},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="prompt != null and prompt !=''">
|
||||||
|
prompt = #{prompt},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where terminal_id = #{terminalId}
|
where terminal_id = #{terminalId}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
@ -123,6 +123,9 @@ public class XhpcChargingPile extends BaseEntity {
|
|||||||
@Excel(name = "设备类型")
|
@Excel(name = "设备类型")
|
||||||
private String equipmentTypeName;
|
private String equipmentTypeName;
|
||||||
|
|
||||||
|
//桩停用提示语
|
||||||
|
private String prompt;
|
||||||
|
|
||||||
public String getTypeName() {
|
public String getTypeName() {
|
||||||
|
|
||||||
return typeName;
|
return typeName;
|
||||||
@ -441,4 +444,11 @@ public class XhpcChargingPile extends BaseEntity {
|
|||||||
this.chargingStationName = chargingStationName;
|
this.chargingStationName = chargingStationName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPrompt() {
|
||||||
|
return prompt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrompt(String prompt) {
|
||||||
|
this.prompt = prompt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,6 +89,9 @@ public class XhpcTerminal extends BaseEntity {
|
|||||||
@Column(name = "number", nullable = true)
|
@Column(name = "number", nullable = true)
|
||||||
private Integer number;
|
private Integer number;
|
||||||
|
|
||||||
|
private String prompt;
|
||||||
|
|
||||||
|
|
||||||
public int getConnectorType() {
|
public int getConnectorType() {
|
||||||
|
|
||||||
return connectorType;
|
return connectorType;
|
||||||
@ -230,6 +233,14 @@ public class XhpcTerminal extends BaseEntity {
|
|||||||
this.number = number;
|
this.number = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPrompt() {
|
||||||
|
return prompt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrompt(String prompt) {
|
||||||
|
this.prompt = prompt;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "XhpcTerminal{" +
|
return "XhpcTerminal{" +
|
||||||
@ -247,6 +258,7 @@ public class XhpcTerminal extends BaseEntity {
|
|||||||
", operatorIdEvcs='" + operatorIdEvcs + '\'' +
|
", operatorIdEvcs='" + operatorIdEvcs + '\'' +
|
||||||
", connectorType=" + connectorType +
|
", connectorType=" + connectorType +
|
||||||
", number=" + number +
|
", number=" + number +
|
||||||
|
", prompt='" + prompt + '\'' +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user