Commit 10a6a199 by dupengfei

Merge remote-tracking branch 'origin/dev_gabbzpt' into dev_gabbzpt

parents 4606acc1 315ef8c2
package com.founder.commonutils.bzptEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="服务标识号", description="服务标识号对象")
public class TbXwFwbsh implements Serializable {
private String rcdid;
private String zjbh;
private String gjc;
private String bshxq;
private String bshlx;
private String bm;
private String rylx;
private String ztbs;
public String getRcdid() {
return rcdid;
}
public void setRcdid(String rcdid) {
this.rcdid = rcdid;
}
public String getZjbh() {
return zjbh;
}
public void setZjbh(String zjbh) {
this.zjbh = zjbh;
}
public String getGjc() {
return gjc;
}
public void setGjc(String gjc) {
this.gjc = gjc;
}
public String getBshxq() {
return bshxq;
}
public void setBshxq(String bshxq) {
this.bshxq = bshxq;
}
public String getBshlx() {
return bshlx;
}
public void setBshlx(String bshlx) {
this.bshlx = bshlx;
}
public String getBm() {
return bm;
}
public void setBm(String bm) {
this.bm = bm;
}
public String getRylx() {
return rylx;
}
public void setRylx(String rylx) {
this.rylx = rylx;
}
public String getZtbs() {
return ztbs;
}
public void setZtbs(String ztbs) {
this.ztbs = ztbs;
}
}
package com.founder.bzpt.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.founder.bzpt.service.IDetailService;
import com.founder.commonutils.bzptEntity.*;
......@@ -13,15 +12,10 @@ import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.xcontent.XContentFactory;
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.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
......@@ -260,11 +254,11 @@ public class DetailController {
@ApiOperation(value = "删除标识号")
@PostMapping(value = "/deleteBsh")
@ResponseBody
public MapRestResult deleteBsh(@RequestParam(value = "zjbh", defaultValue = "") String zjbh) {
public MapRestResult deleteBsh(@RequestParam(value = "rcdid") String rcdid) {
Map<String, Object> resultMap = new HashedMap();
int res;
String state = "error";
res = detailervice.deleteBsh(zjbh);
res = detailervice.deleteBsh(rcdid);
if (res > 0) {
state = "success";
}
......@@ -275,71 +269,39 @@ public class DetailController {
@ApiOperation(value = "新增服务标识号信息")
@PostMapping("/insertFwbsh")
@ResponseBody
public MapRestResult insertFwbsh(@RequestParam(value = "insertBshItem") String insertBshItem,HttpServletRequest requset)
public MapRestResult insertFwbsh(@RequestBody List<TbXwFwbsh> listParams, HttpServletRequest requset)
{
//拿到登录用户
//User user = (User)requset.getSession().getAttribute("USER");
//String trueName=user.getTrueName();
int res;
String state = "error";
Map<String, Object> resultMap = new HashedMap();
String zjbh = "";
String bm = "";
String gjc = "";
String bshxq ="";
String bshlx = "";
String rylx = "";
String ztbs = "";
//解析json数据
JSONArray json = JSONArray.parseArray(insertBshItem);
Iterator<Object> iterator = json.iterator();
while(iterator.hasNext()) {
JSONObject obj = (JSONObject) iterator.next();
zjbh = (String) obj.get("zjbh");
bm = (String) obj.get("bm");
gjc = (String) obj.get("gjc");
bshxq = (String) obj.get("bshxq");
bshlx = (String) obj.get("bshlx");
rylx = (String) obj.get("rylx");
ztbs = (String) obj.get("ztbs");
listParams.stream().forEach(p->{
TbTzxxjqTzxxlxdy tbTzxxjqTzxxlxdy = new TbTzxxjqTzxxlxdy();
tbTzxxjqTzxxlxdy.setLrr("admin");
tbTzxxjqTzxxlxdy.setScbz("0");
tbTzxxjqTzxxlxdy.setGxr("admin");
tbTzxxjqTzxxlxdy.setBshlx(bshlx);
tbTzxxjqTzxxlxdy.setZtbs(ztbs);
tbTzxxjqTzxxlxdy.setZjbh(zjbh);
tbTzxxjqTzxxlxdy.setBm(bm);
tbTzxxjqTzxxlxdy.setBshxq(bshxq);
if(gjc!=null){
tbTzxxjqTzxxlxdy.setGjc(gjc.trim());//由于前台界面录入时复制粘贴存在前后空格的情况,故在关键词不为null时去掉字符串前后空格后入库
tbTzxxjqTzxxlxdy.setBshlx(p.getBshlx());
tbTzxxjqTzxxlxdy.setZtbs(p.getZtbs());
tbTzxxjqTzxxlxdy.setZjbh(p.getZjbh());
tbTzxxjqTzxxlxdy.setBm(p.getBm());
tbTzxxjqTzxxlxdy.setBshxq(p.getBshxq());
if(p.getGjc()!=null){
tbTzxxjqTzxxlxdy.setGjc(p.getGjc().trim());//由于前台界面录入时复制粘贴存在前后空格的情况,故在关键词不为null时去掉字符串前后空格后入库
}
tbTzxxjqTzxxlxdy.setRylx(rylx);
tbTzxxjqTzxxlxdy.setRylx(p.getRylx());
String seq = CommonFunc.getMainSeq1();
tbTzxxjqTzxxlxdy.setRcdid(seq);
res = detailervice.insertFwbsh(tbTzxxjqTzxxlxdy);
if (res > 0) {
state = "success";
resultMap.put("state", state);
}else{
return MapRestResult.build(200,"新增标识号失败","1","fail");
}
}
detailervice.insertFwbsh(tbTzxxjqTzxxlxdy);
});
return MapRestResult.build(200,"新增标识号成功","1","success");
}
@ApiOperation(value = "更新服务标识号信息")
@PostMapping("/updateBsh")
@ResponseBody
public MapRestResult updateBsh(@RequestParam(value = "zjbh") String zjbh,@RequestParam(value = "ryxq") String ryxq,@RequestParam(value = "bjBshHm") String bjBshHm,@RequestParam(value = "bjBshXq") String bjBshXq,@RequestParam(value = "bshlx") String bshlx){
Map<String, Object> resultMap = new HashedMap();
int res;
String state = "error";
res = detailervice.updateBsh(zjbh, ryxq, bjBshHm, bjBshXq, bshlx);
if (res > 0) {
state = "success";
}
resultMap.put("state", state);
public MapRestResult updateBsh(@RequestBody List<TbXwFwbsh> listParams){
listParams.stream().forEach(p->{
detailervice.updateBsh(p);
});
return MapRestResult.build(200,"更新服务标识号信息成功","1","success");
}
......
......@@ -28,7 +28,7 @@ public interface DetailMapper {
Integer insertFwbsh(TbTzxxjqTzxxlxdy tbTzxxjqTzxxlxdy);
Integer updateBsh(@Param(value = "zjbh") String zjbh, @Param(value = "ryxq") String ryxq, @Param(value = "bjBshHm") String bjBshHm, @Param(value = "bjBshXq") String bjBshXq, @Param(value = "bshlx") String bshlx);
Integer updateBsh(TbXwFwbsh tbXwFwbsh);
Integer updateTbXwAsjbzByObject(TbXwAsjbz tbXwAsjbz);
......
......@@ -417,22 +417,24 @@
AND T.ASJBH = #{asjbh}
</select>
<!--修改服务标识号-->
<update id="updateBsh" parameterType="com.founder.commonutils.bzptEntity.TbTzxxjqTzxxlxdy">
<update id="updateBsh" parameterType="com.founder.commonutils.bzptEntity.TbXwFwbsh">
update tb_tzxxjq_tzxxlxdy
<set>
rylx=#{ryxq},
<if test="bjBshHm != null and bjBshHm !=''">
gjc=#{bjBshHm},
<if test="rylx != null and rylx !=''">
rylx=#{rylx},
</if>
<if test="bjBshXq != null and bjBshXq !=''">
bshxq=#{bjBshXq},
<if test="gjc != null and gjc !=''">
gjc=#{gjc},
</if>
<if test="bshxq != null and bshxq !=''">
bshxq=#{bshxq},
</if>
<if test="bshlx != null and bshlx !=''">
bshlx=#{bshlx}
</if>
</set>
where
<if test="zjbh!=null and zjbh!=''"> rcdid = #{zjbh}</if>
<if test="rcdid!=null and rcdid!=''"> rcdid = #{rcdid}</if>
</update>
<!--现场勘验信息-->
<select id="getXckyXxByObjects" parameterType="String" resultType="com.founder.commonutils.bzptEntity.XkXcJbXx">
......
......@@ -4,6 +4,7 @@ import com.founder.commonutils.bzptEntity.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
public interface IDetailService {
......@@ -19,7 +20,7 @@ public interface IDetailService {
Integer insertFwbsh(TbTzxxjqTzxxlxdy tbTzxxjqTzxxlxdy);
Integer updateBsh(String zjhb, String ryxq, String bjBshHm, String bjBshXq, String bshlx);
Integer updateBsh(TbXwFwbsh tbXwFwbsh);
Integer updateTbXwAsjbzByObject(TbXwAsjbz tbXwAsjbz);
......
......@@ -89,12 +89,12 @@ public class DetailServiceImpl implements IDetailService {
/**
* 更新服务标识号信息
*
* @param zjhb
* @param
* @return
*/
@Override
public Integer updateBsh(String zjhb, String ryxq, String bjBshHm, String bjBshXq, String bshlx) {
return detailDao.updateBsh(zjhb, ryxq, bjBshHm, bjBshXq, bshlx);
public Integer updateBsh(TbXwFwbsh tbXwFwbsh) {
return detailDao.updateBsh(tbXwFwbsh);
}
@Override
......
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