Commit 1bbc1096 authored by tangwei's avatar tangwei

修改bug

parent 177df727
......@@ -435,23 +435,56 @@ public class InputItemController extends AbstractBaseController {
InputItem inputItem = new InputItem();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
BeanUtils.copyProperties(param, inputItem);
inputItem.setDataJson(param.getDataJson() != null ?JSONObject.toJSONString(param.getDataJson()) : null);
inputItem.setPictureJson(param.getPictureJson() != null ?JSONObject.toJSONString(param.getPictureJson()) :null);
///LoginUserParam loginParam = getLoginUserParam();
ResponseModel<Object> companyByBizOrgCodeList = jcsFeignClient.getCompanyByBizOrgCodeList(reginParams.getPersonIdentity().getBizOrgCode());
String bizOrgCode = ((Map<String, Object>) companyByBizOrgCodeList.getResult()).get("bizOrgCode").toString();
if(param.getPictureJson() != null){
List<Map<String,Object>> listr = (List<Map<String,Object>>)param.getPictureJson();
for (int i = 0; i < listr.size(); i++) {
listr.get(i).remove("Symbol_key");
listr.get(i).put("orderNo",i);
}
inputItem.setPictureJson(JSONObject.toJSONString(listr));
}
inputItem.setBizOrgCode(reginParams.getPersonIdentity().getBizOrgCode() == null? null :reginParams.getPersonIdentity().getBizOrgCode() );
inputItem.setBizOrgName(reginParams.getPersonIdentity().getCompanyName()== null? null :reginParams.getPersonIdentity().getCompanyName());
inputItem.setOrgCode(loginOrgCode);
inputItem.setCreateBy(user.getUserId());
if(param.getItemType().equals("文本")){
Map<String,Object> map=new HashMap<>();
map.put("OkScore",param.getOkScore());
map.put("NoScore",param.getNoScore());
map.put("CheckType",param.getCheckType());
inputItem.setDataJson(JSONObject.toJSONString(map));
}else if(param.getItemType().equals("选择")){
if(param.getDataJson() != null){
List<Map<String,Object>> listr = (List<Map<String,Object>>)param.getDataJson();
for (int i = 0; i < listr.size(); i++) {
listr.get(i).remove("Symbol_key");
listr.get(i).put("orderNo",i);
}
inputItem.setDataJson(JSONObject.toJSONString(listr));
}
}else{
Map<String,Object> map=new HashMap<>();
map.put("OkScore",param.getOkScore());
map.put("NoScore",param.getNoScore());
map.put("ValidUp",param.getValidUp());
map.put("ValidDown",param.getValidDown());
map.put("OkUp",param.getOkUp());
map.put("OkDown",param.getOkDown());
map.put("CheckValidUp",param.isCheckValidUp());
map.put("CheckValidDown",param.isCheckOkDown());
map.put("CheckOkUp",param.isCheckOkUp());
map.put("CheckOkDown",param.isCheckOkDown());
map.put("Precision",param.getPrecision());
inputItem.setDataJson(JSONObject.toJSONString(map));
}
if (!ObjectUtils.isEmpty(param.getId())) {
inputItem.setId(param.getId());
inputItemService.updateInputItem(inputItem);
}else {
inputItemService.addNewInputItem(inputItem);
}
return CommonResponseUtil.success();
......
......@@ -26,6 +26,118 @@ public class InputItemParam {
private String checkMethod;
private String unit;
private Integer okScore;
private Integer noScore;
private String checkType;
private Integer validUp;
private Integer validDown;
private Integer okUp;
private Integer okDown;
private boolean checkValidUp;
private boolean checkValidDown;
private boolean checkOkUp;
private boolean checkOkDown;
private Integer precision;
public Integer getValidUp() {
return validUp;
}
public void setValidUp(Integer validUp) {
this.validUp = validUp;
}
public Integer getValidDown() {
return validDown;
}
public void setValidDown(Integer validDown) {
this.validDown = validDown;
}
public Integer getOkUp() {
return okUp;
}
public void setOkUp(Integer okUp) {
this.okUp = okUp;
}
public Integer getOkDown() {
return okDown;
}
public void setOkDown(Integer okDown) {
this.okDown = okDown;
}
public boolean isCheckValidUp() {
return checkValidUp;
}
public void setCheckValidUp(boolean checkValidUp) {
this.checkValidUp = checkValidUp;
}
public boolean isCheckValidDown() {
return checkValidDown;
}
public void setCheckValidDown(boolean checkValidDown) {
this.checkValidDown = checkValidDown;
}
public boolean isCheckOkUp() {
return checkOkUp;
}
public void setCheckOkUp(boolean checkOkUp) {
this.checkOkUp = checkOkUp;
}
public boolean isCheckOkDown() {
return checkOkDown;
}
public void setCheckOkDown(boolean checkOkDown) {
this.checkOkDown = checkOkDown;
}
public Integer getPrecision() {
return precision;
}
public void setPrecision(Integer precision) {
this.precision = precision;
}
public Integer getOkScore() {
return okScore;
}
public void setOkScore(Integer okScore) {
this.okScore = okScore;
}
public Integer getNoScore() {
return noScore;
}
public void setNoScore(Integer noScore) {
this.noScore = noScore;
}
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
/**
* 新加字段
*
......@@ -81,6 +193,16 @@ public class InputItemParam {
private String facilitiesType;
// 重点类型
private String keyPartsType;
//自定义类型
private String customType;
public String getCustomType() {
return customType;
}
public void setCustomType(String customType) {
this.customType = customType;
}
public String getUnit() {
return unit;
......
......@@ -100,10 +100,11 @@ public class InputItemServiceImpl implements IInputItemService {
public void updateInputItem(InputItem param) {
if (param.getId() <= 0) {
addNewInputItem(param);
return;
}
}else{
inputItemMapper.updateInputItem(param);
}
}
@Override
@Transactional
......
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