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

calendar action

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