Commit 5b83e87f authored by Mccoy Z Xia's avatar Mccoy Z Xia

calendar action

parent 5eb32906
......@@ -30,9 +30,9 @@ public class CalendarActionController {
return actionServiceImpl.getCalendarActionList();
}
@PostMapping("deleteCalendarAction")
public OperationResultDto getCalendarDataForDisplay(@RequestBody CalendarActionDto dto){
return actionServiceImpl.deleteCalendarAction(dto);
@PostMapping("deleteCalendarAction/{id}")
public OperationResultDto getCalendarDataForDisplay(@PathVariable("id") Long id){
return actionServiceImpl.deleteCalendarAction(id);
}
}
......@@ -9,7 +9,7 @@ public interface ICalendarActionService {
OperationResultDto saveCalendarAction(CalendarActionDto dto);
OperationResultDto deleteCalendarAction(CalendarActionDto dto);
OperationResultDto deleteCalendarAction(Long id);
OperationResultDto getCalendarActionList();
}
......@@ -87,11 +87,14 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
relationship.setId(idService.nextId());
relationship.setActionId(action.getId());
relationship.setJurisdictionId(jurisdiction.getId());
relationshipList.add(relationship);
});
try {
calendarExtMapper.batchInsertActionJurisdiction(jurisdictionList);
calendarExtMapper.batchInsertActionJurisdictionRelation(relationshipList);
// calendarExtMapper.batchInsertActionJurisdiction(jurisdictionList);
// calendarExtMapper.batchInsertActionJurisdictionRelation(relationshipList);
jurisdictionList.forEach(p -> calendarJurisdictionMapper.insert(p));
relationshipList.forEach(p -> calendarActionJurisdictionRelationshipMapper.insert(p));
calendarActionMapper.insert(action);
} catch (Exception e) {
log.error("insertAction error", e);
......@@ -113,7 +116,6 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
try {
list.forEach(p -> {
CalendarJurisdiction jurisdiction = jurisdictionTMapper.toCalendarAction(p);
jurisdiction.setId(idService.nextId());
jurisdiction.setUpdateTime(updateTime);
jurisdictionList.add(jurisdiction);
});
......@@ -127,10 +129,10 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
}
@Override
public OperationResultDto deleteCalendarAction(CalendarActionDto dto) {
public OperationResultDto deleteCalendarAction(Long id) {
int count = 0;
CalendarAction action = new CalendarAction();
action.setId(dto.getId());
action.setId(id);
action.setStatus(Byte.parseByte("0"));
action.setUpdateTime(new Date());
try {
......
......@@ -92,11 +92,11 @@ public interface CalendarExtMapper extends MyMapper {
int batchInsertActionJurisdictionRelation(List<CalendarActionJurisdictionRelationship> relationshipList);
@Select("SELECT\n" +
"\tt.id, area, description, logic_num, logic_unit, status\n" +
"\tt.id, area, description, logic_num AS logicNum, logic_unit AS logicUnit, status\n" +
"FROM\n" +
"\tcalendar_jurisdiction t\n" +
"LEFT JOIN calendar_action_jurisdiction_relationship ON t.id = jurisdiction_id\n" +
"AND action_id = #{actionId}\n" +
"WHERE action_id = #{actionId}\n" +
"ORDER BY area")
List<CalendarJurisdictionDto> getJurisdictionListByActionId(Long actionId);
}
......@@ -13,10 +13,8 @@ public interface CalendarJurisdictionTMapper {
CalendarJurisdictionTMapper CALENDAR_JURISDICTION_T_MAPPER = Mappers.getMapper(CalendarJurisdictionTMapper.class);
@Mapping(source = "id", target = "id")
CalendarJurisdictionDto toCalendarActionDto(CalendarJurisdiction calendarJurisdiction);
@Mapping(source = "id", target = "id")
CalendarJurisdiction toCalendarAction(CalendarJurisdictionDto calendarJurisdictionDto);
}
......@@ -2,10 +2,7 @@ package pwc.taxtech.atms.calendar.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.*;
/**
* <p> @Description </p>
......@@ -29,7 +26,7 @@ public class CalendarJurisdictionDto {
private Integer logicNum;
private String logicUnit;
private Integer logicUnit;
private Byte status;
......
......@@ -54,14 +54,14 @@ public class CalendarJurisdiction extends BaseEntity implements Serializable {
/**
* Database Column Remarks:
* logic单位
* logic单位 枚举
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column calendar_jurisdiction.logic_unit
*
* @mbg.generated
*/
private String logicUnit;
private Integer logicUnit;
/**
*
......@@ -202,7 +202,7 @@ public class CalendarJurisdiction extends BaseEntity implements Serializable {
*
* @mbg.generated
*/
public String getLogicUnit() {
public Integer getLogicUnit() {
return logicUnit;
}
......@@ -214,8 +214,8 @@ public class CalendarJurisdiction extends BaseEntity implements Serializable {
*
* @mbg.generated
*/
public void setLogicUnit(String logicUnit) {
this.logicUnit = logicUnit == null ? null : logicUnit.trim();
public void setLogicUnit(Integer logicUnit) {
this.logicUnit = logicUnit;
}
/**
......
......@@ -455,62 +455,52 @@ public class CalendarJurisdictionExample {
return (Criteria) this;
}
public Criteria andLogicUnitEqualTo(String value) {
public Criteria andLogicUnitEqualTo(Integer value) {
addCriterion("logic_unit =", value, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitNotEqualTo(String value) {
public Criteria andLogicUnitNotEqualTo(Integer value) {
addCriterion("logic_unit <>", value, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitGreaterThan(String value) {
public Criteria andLogicUnitGreaterThan(Integer value) {
addCriterion("logic_unit >", value, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitGreaterThanOrEqualTo(String value) {
public Criteria andLogicUnitGreaterThanOrEqualTo(Integer value) {
addCriterion("logic_unit >=", value, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitLessThan(String value) {
public Criteria andLogicUnitLessThan(Integer value) {
addCriterion("logic_unit <", value, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitLessThanOrEqualTo(String value) {
public Criteria andLogicUnitLessThanOrEqualTo(Integer value) {
addCriterion("logic_unit <=", value, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitLike(String value) {
addCriterion("logic_unit like", value, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitNotLike(String value) {
addCriterion("logic_unit not like", value, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitIn(List<String> values) {
public Criteria andLogicUnitIn(List<Integer> values) {
addCriterion("logic_unit in", values, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitNotIn(List<String> values) {
public Criteria andLogicUnitNotIn(List<Integer> values) {
addCriterion("logic_unit not in", values, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitBetween(String value1, String value2) {
public Criteria andLogicUnitBetween(Integer value1, Integer value2) {
addCriterion("logic_unit between", value1, value2, "logicUnit");
return (Criteria) this;
}
public Criteria andLogicUnitNotBetween(String value1, String value2) {
public Criteria andLogicUnitNotBetween(Integer value1, Integer value2) {
addCriterion("logic_unit not between", value1, value2, "logicUnit");
return (Criteria) this;
}
......
......@@ -10,7 +10,7 @@
<result column="area" jdbcType="TINYINT" property="area" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="logic_num" jdbcType="INTEGER" property="logicNum" />
<result column="logic_unit" jdbcType="VARCHAR" property="logicUnit" />
<result column="logic_unit" jdbcType="INTEGER" property="logicUnit" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
......@@ -143,7 +143,7 @@
logic_num, logic_unit, `status`,
create_time, update_time)
values (#{id,jdbcType=BIGINT}, #{area,jdbcType=TINYINT}, #{description,jdbcType=VARCHAR},
#{logicNum,jdbcType=INTEGER}, #{logicUnit,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
#{logicNum,jdbcType=INTEGER}, #{logicUnit,jdbcType=INTEGER}, #{status,jdbcType=TINYINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.calendar.entity.CalendarJurisdiction">
......@@ -192,7 +192,7 @@
#{logicNum,jdbcType=INTEGER},
</if>
<if test="logicUnit != null">
#{logicUnit,jdbcType=VARCHAR},
#{logicUnit,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
......@@ -235,7 +235,7 @@
logic_num = #{record.logicNum,jdbcType=INTEGER},
</if>
<if test="record.logicUnit != null">
logic_unit = #{record.logicUnit,jdbcType=VARCHAR},
logic_unit = #{record.logicUnit,jdbcType=INTEGER},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=TINYINT},
......@@ -261,7 +261,7 @@
area = #{record.area,jdbcType=TINYINT},
description = #{record.description,jdbcType=VARCHAR},
logic_num = #{record.logicNum,jdbcType=INTEGER},
logic_unit = #{record.logicUnit,jdbcType=VARCHAR},
logic_unit = #{record.logicUnit,jdbcType=INTEGER},
`status` = #{record.status,jdbcType=TINYINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
......@@ -286,7 +286,7 @@
logic_num = #{logicNum,jdbcType=INTEGER},
</if>
<if test="logicUnit != null">
logic_unit = #{logicUnit,jdbcType=VARCHAR},
logic_unit = #{logicUnit,jdbcType=INTEGER},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
......@@ -309,7 +309,7 @@
set area = #{area,jdbcType=TINYINT},
description = #{description,jdbcType=VARCHAR},
logic_num = #{logicNum,jdbcType=INTEGER},
logic_unit = #{logicUnit,jdbcType=VARCHAR},
logic_unit = #{logicUnit,jdbcType=INTEGER},
`status` = #{status,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
......
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