Commit 91497447 authored by sherlock's avatar sherlock

Merge branch 'dev_oracle_sherlock' into 'dev_oracle'

Dev oracle sherlock

See merge request root/atms!127
parents a391b98a f11ade1e
...@@ -18,6 +18,7 @@ import pwc.taxtech.atms.dto.*; ...@@ -18,6 +18,7 @@ import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.Common.RemoteValidationRetDto; import pwc.taxtech.atms.dto.Common.RemoteValidationRetDto;
import pwc.taxtech.atms.dto.formula.FormulaConfigDto; import pwc.taxtech.atms.dto.formula.FormulaConfigDto;
import pwc.taxtech.atms.service.KeyValueConfigService; import pwc.taxtech.atms.service.KeyValueConfigService;
import pwc.taxtech.atms.service.TemplateFormulaService;
@RestController @RestController
@RequestMapping("/api/v1/keyValueConfig") @RequestMapping("/api/v1/keyValueConfig")
...@@ -27,6 +28,9 @@ public class KeyValueConfigController { ...@@ -27,6 +28,9 @@ public class KeyValueConfigController {
@Autowired @Autowired
private KeyValueConfigService keyValueConfigService; private KeyValueConfigService keyValueConfigService;
@Autowired
private TemplateFormulaService templateFormulaService;
@ApiOperation(value = "get keyValueConfig") @ApiOperation(value = "get keyValueConfig")
@RequestMapping(value = "", method = RequestMethod.GET) @RequestMapping(value = "", method = RequestMethod.GET)
public @ResponseBody public @ResponseBody
...@@ -83,7 +87,7 @@ public class KeyValueConfigController { ...@@ -83,7 +87,7 @@ public class KeyValueConfigController {
@RequestMapping(method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody public @ResponseBody
int delelte(@RequestParam String keyValueId) throws BadHttpRequest { int delelte(@RequestParam("keyValueID") String keyValueId) throws BadHttpRequest {
if (StringUtils.isBlank(keyValueId)) { if (StringUtils.isBlank(keyValueId)) {
throw new BadHttpRequest(new Exception("keyValueId is null")); throw new BadHttpRequest(new Exception("keyValueId is null"));
} }
...@@ -101,10 +105,19 @@ public class KeyValueConfigController { ...@@ -101,10 +105,19 @@ public class KeyValueConfigController {
RemoteValidationRetDto isDuplicated(@RequestParam String value) { RemoteValidationRetDto isDuplicated(@RequestParam String value) {
boolean isDuplicated = keyValueConfigService.isKeyValueDuplicated(value); boolean isDuplicated = keyValueConfigService.isKeyValueDuplicated(value);
RemoteValidationRetDto result = new RemoteValidationRetDto(); RemoteValidationRetDto result = new RemoteValidationRetDto();
result.setValid(!isDuplicated); result.setIsValid(!isDuplicated);
result.setValue(value); result.setValue(value);
return result; return result;
} }
@RequestMapping(value="isFormulaValid", method=RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
RemoteValidationRetDto isFormulaValid(@RequestParam String value){
OperationResultDto validateResult = templateFormulaService.validate(value);
RemoteValidationRetDto result = new RemoteValidationRetDto();
result.setIsValid(validateResult.getResult());
result.setValue(value);
return result;
}
} }
package pwc.taxtech.atms.dto.Common; package pwc.taxtech.atms.dto.Common;
public class RemoteValidationRetDto {
private boolean isValid;
private String value;
public boolean isValid() { import lombok.Getter;
return isValid; import lombok.Setter;
}
public void setValid(boolean valid) { @Getter
isValid = valid; @Setter
} public class RemoteValidationRetDto {
public String getValue() { private Boolean isValid;
return value; private String value;
}
public void setValue(String value) {
this.value = value;
}
} }
...@@ -3,7 +3,7 @@ package pwc.taxtech.atms.dto; ...@@ -3,7 +3,7 @@ package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
public class IndustryDto { public class IndustryDto {
@JsonProperty("ID") // @JsonProperty("ID")
private String id; private String id;
private String name; private String name;
private Boolean isActive; private Boolean isActive;
......
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public class KeyValueConfigDisplayDto { public class KeyValueConfigDisplayDto {
@JsonProperty("ID") // @JsonProperty("ID")
private String id; private String id;
private String keyCode; private String keyCode;
private String name; private String name;
......
...@@ -150,7 +150,7 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal ...@@ -150,7 +150,7 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
keyValueConfig.setUpdator(addKeyValueConfigDto.getUserName()); keyValueConfig.setUpdator(addKeyValueConfigDto.getUserName());
keyValueConfig.setKeyValueType(2); keyValueConfig.setKeyValueType(2);
keyValueConfigMapper.insert(keyValueConfig); keyValueConfigMapper.insertSelective(keyValueConfig);
operationLogService.addDataAddLog(keyValueConfig, OperationModule.KeyValueConfig, addKeyValueConfigDto.getUserName() operationLogService.addDataAddLog(keyValueConfig, OperationModule.KeyValueConfig, addKeyValueConfigDto.getUserName()
, Message.Log.AddKeyValueConfiguration, "", keyValueConfig.getName(), logType); , Message.Log.AddKeyValueConfiguration, "", keyValueConfig.getName(), logType);
} }
......
...@@ -43,13 +43,11 @@ public class TemplateFormulaServiceImpl extends AbstractService implements Templ ...@@ -43,13 +43,11 @@ public class TemplateFormulaServiceImpl extends AbstractService implements Templ
//var compileCode = sourceCode.Compile(); //var compileCode = sourceCode.Compile();
rtn.Result = compileCode != null;*/ rtn.Result = compileCode != null;*/
result.setResult(true);
return result;
} catch (Exception e) { } catch (Exception e) {
result.setResult(false); result.setResult(false);
result.setResultMsg(e.getMessage()); result.setResultMsg(e.getMessage());
} }
return null; return result;
} }
} }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<result column="IS_CONSTANT" jdbcType="DECIMAL" property="isConstant" /> <result column="IS_CONSTANT" jdbcType="DECIMAL" property="isConstant" />
<result column="CALCULATE_STATUS" jdbcType="DECIMAL" property="calculateStatus" /> <result column="CALCULATE_STATUS" jdbcType="DECIMAL" property="calculateStatus" />
<result column="RESULT_TYPE" jdbcType="DECIMAL" property="resultType" /> <result column="RESULT_TYPE" jdbcType="DECIMAL" property="resultType" />
<result column="SERVICE_TYPE_IDS" jdbcType="VARCHAR" property="serviceTypeIDs" /> <result column="SERVICE_TYPE_IDS" jdbcType="VARCHAR" property="serviceTypeIds" />
<result column="INDUSTRY_IDS" jdbcType="VARCHAR" property="industryIds" /> <result column="INDUSTRY_IDS" jdbcType="VARCHAR" property="industryIds" />
<result column="DESCRIPTION" jdbcType="VARCHAR" property="description" /> <result column="DESCRIPTION" jdbcType="VARCHAR" property="description" />
<result column="CREATOR" jdbcType="VARCHAR" property="creator" /> <result column="CREATOR" jdbcType="VARCHAR" property="creator" />
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
DATA_SOURCE) DATA_SOURCE)
values (#{id,jdbcType=VARCHAR}, #{keyCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{keyCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{keyValueType,jdbcType=DECIMAL}, #{formula,jdbcType=VARCHAR}, #{isConstant,jdbcType=DECIMAL}, #{keyValueType,jdbcType=DECIMAL}, #{formula,jdbcType=VARCHAR}, #{isConstant,jdbcType=DECIMAL},
#{calculateStatus,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL}, #{serviceTypeIDs,jdbcType=VARCHAR}, #{calculateStatus,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL}, #{serviceTypeIds,jdbcType=VARCHAR},
#{industryIds,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, #{industryIds,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updator,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updator,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{dataSource,jdbcType=VARCHAR}) #{dataSource,jdbcType=VARCHAR})
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
<if test="resultType != null"> <if test="resultType != null">
RESULT_TYPE, RESULT_TYPE,
</if> </if>
<if test="serviceTypeIDs != null"> <if test="serviceTypeIds != null">
SERVICE_TYPE_IDS, SERVICE_TYPE_IDS,
</if> </if>
<if test="industryIds != null"> <if test="industryIds != null">
...@@ -243,8 +243,8 @@ ...@@ -243,8 +243,8 @@
<if test="resultType != null"> <if test="resultType != null">
#{resultType,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL},
</if> </if>
<if test="serviceTypeIDs != null"> <if test="serviceTypeIds != null">
#{serviceTypeIDs,jdbcType=VARCHAR}, #{serviceTypeIds,jdbcType=VARCHAR},
</if> </if>
<if test="industryIds != null"> <if test="industryIds != null">
#{industryIds,jdbcType=VARCHAR}, #{industryIds,jdbcType=VARCHAR},
...@@ -310,8 +310,8 @@ ...@@ -310,8 +310,8 @@
<if test="record.resultType != null"> <if test="record.resultType != null">
RESULT_TYPE = #{record.resultType,jdbcType=DECIMAL}, RESULT_TYPE = #{record.resultType,jdbcType=DECIMAL},
</if> </if>
<if test="record.serviceTypeIDs != null"> <if test="record.serviceTypeIds != null">
SERVICE_TYPE_IDS = #{record.serviceTypeIDs,jdbcType=VARCHAR}, SERVICE_TYPE_IDS = #{record.serviceTypeIds,jdbcType=VARCHAR},
</if> </if>
<if test="record.industryIds != null"> <if test="record.industryIds != null">
INDUSTRY_IDS = #{record.industryIds,jdbcType=VARCHAR}, INDUSTRY_IDS = #{record.industryIds,jdbcType=VARCHAR},
...@@ -353,7 +353,7 @@ ...@@ -353,7 +353,7 @@
IS_CONSTANT = #{record.isConstant,jdbcType=DECIMAL}, IS_CONSTANT = #{record.isConstant,jdbcType=DECIMAL},
CALCULATE_STATUS = #{record.calculateStatus,jdbcType=DECIMAL}, CALCULATE_STATUS = #{record.calculateStatus,jdbcType=DECIMAL},
RESULT_TYPE = #{record.resultType,jdbcType=DECIMAL}, RESULT_TYPE = #{record.resultType,jdbcType=DECIMAL},
SERVICE_TYPE_IDS = #{record.serviceTypeIDs,jdbcType=VARCHAR}, SERVICE_TYPE_IDS = #{record.serviceTypeIds,jdbcType=VARCHAR},
INDUSTRY_IDS = #{record.industryIds,jdbcType=VARCHAR}, INDUSTRY_IDS = #{record.industryIds,jdbcType=VARCHAR},
DESCRIPTION = #{record.description,jdbcType=VARCHAR}, DESCRIPTION = #{record.description,jdbcType=VARCHAR},
CREATOR = #{record.creator,jdbcType=VARCHAR}, CREATOR = #{record.creator,jdbcType=VARCHAR},
...@@ -393,8 +393,8 @@ ...@@ -393,8 +393,8 @@
<if test="resultType != null"> <if test="resultType != null">
RESULT_TYPE = #{resultType,jdbcType=DECIMAL}, RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
</if> </if>
<if test="serviceTypeIDs != null"> <if test="serviceTypeIds != null">
SERVICE_TYPE_IDS = #{serviceTypeIDs,jdbcType=VARCHAR}, SERVICE_TYPE_IDS = #{serviceTypeIds,jdbcType=VARCHAR},
</if> </if>
<if test="industryIds != null"> <if test="industryIds != null">
INDUSTRY_IDS = #{industryIds,jdbcType=VARCHAR}, INDUSTRY_IDS = #{industryIds,jdbcType=VARCHAR},
...@@ -433,7 +433,7 @@ ...@@ -433,7 +433,7 @@
IS_CONSTANT = #{isConstant,jdbcType=DECIMAL}, IS_CONSTANT = #{isConstant,jdbcType=DECIMAL},
CALCULATE_STATUS = #{calculateStatus,jdbcType=DECIMAL}, CALCULATE_STATUS = #{calculateStatus,jdbcType=DECIMAL},
RESULT_TYPE = #{resultType,jdbcType=DECIMAL}, RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
SERVICE_TYPE_IDS = #{serviceTypeIDs,jdbcType=VARCHAR}, SERVICE_TYPE_IDS = #{serviceTypeIds,jdbcType=VARCHAR},
INDUSTRY_IDS = #{industryIds,jdbcType=VARCHAR}, INDUSTRY_IDS = #{industryIds,jdbcType=VARCHAR},
DESCRIPTION = #{description,jdbcType=VARCHAR}, DESCRIPTION = #{description,jdbcType=VARCHAR},
CREATOR = #{creator,jdbcType=VARCHAR}, CREATOR = #{creator,jdbcType=VARCHAR},
......
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