Commit e14fa5f4 authored by 李博今's avatar 李博今

更新Arrange字段desc为description

增加subtask表字段grade_code,实体类增加gradeCode
parent 1ecef7c0
...@@ -10,7 +10,7 @@ Target Server Type : MYSQL ...@@ -10,7 +10,7 @@ Target Server Type : MYSQL
Target Server Version : 50717 Target Server Version : 50717
File Encoding : 65001 File Encoding : 65001
Date: 2018-04-23 16:50:53 Date: 2018-04-26 10:33:12
*/ */
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;
...@@ -29,9 +29,7 @@ CREATE TABLE `b_arrange` ( ...@@ -29,9 +29,7 @@ CREATE TABLE `b_arrange` (
`del_flag` varchar(1) DEFAULT NULL, `del_flag` varchar(1) DEFAULT NULL,
`flag` varchar(1) DEFAULT NULL, `flag` varchar(1) DEFAULT NULL,
`term_code` varchar(64) DEFAULT NULL, `term_code` varchar(64) DEFAULT NULL,
`desc` varchar(255) DEFAULT NULL, `description` varchar(255) DEFAULT NULL,
`grade_code` varchar(64) DEFAULT NULL,
`agency_code` varchar(64) DEFAULT NULL,
`status` varchar(1) DEFAULT NULL, `status` varchar(1) DEFAULT NULL,
PRIMARY KEY (`business_id`) PRIMARY KEY (`business_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
...@@ -39,14 +37,6 @@ CREATE TABLE `b_arrange` ( ...@@ -39,14 +37,6 @@ CREATE TABLE `b_arrange` (
-- ---------------------------- -- ----------------------------
-- Records of b_arrange -- Records of b_arrange
-- ---------------------------- -- ----------------------------
INSERT INTO `b_arrange` VALUES ('339ab1993c7f424294fd0f9e22a1c11a', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 10:37:36', '2018-04-19 10:37:36', null, '0', '1', 'newTerm2', null, '大一', '华为', '0'); INSERT INTO `b_arrange` VALUES ('19aae22e47884deaad96f3470074271e', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-26 10:21:28', '2018-04-26 10:21:28', null, '0', '1', 't001', '哈哈哈', '0');
INSERT INTO `b_arrange` VALUES ('37dcd7171b12477f96396ef66139fb0e', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 10:36:25', '2018-04-19 10:36:25', null, '0', '1', 'newTerm', null, '大一', '华为', '0'); INSERT INTO `b_arrange` VALUES ('b', 'b', 'b', null, null, null, '0', '1', 'newTerm2', null, '0');
INSERT INTO `b_arrange` VALUES ('5a5ec1e7bd9648e7a2ee3bab69b92e88', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 10:37:08', '2018-04-19 10:37:08', null, '0', '1', 'newTerm', null, '大二', '小米', '0'); INSERT INTO `b_arrange` VALUES ('e15b02f7030e43ccab0277eacbe307ce', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 10:36:49', '2018-04-19 10:36:49', null, '0', '1', 'newTerm', null, '0');
INSERT INTO `b_arrange` VALUES ('62a8fc66457b4118993a2a83b984b568', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-23 15:13:25', '2018-04-23 15:13:25', null, '0', '1', 'newTerm2', null, '大三', '腾讯', '0');
INSERT INTO `b_arrange` VALUES ('692674c8865e46b2915a63baa0f1060f', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 14:29:53', '2018-04-19 14:29:53', null, '0', '1', 'newTerm2', null, '大三', '腾讯', '0');
INSERT INTO `b_arrange` VALUES ('8fca18f54e454af4b4a4d85d4f412d02', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 10:37:02', '2018-04-19 10:37:02', null, '0', '1', 'newTerm', null, '大二', '华为', '0');
INSERT INTO `b_arrange` VALUES ('ac5e19e11d884e94b6787a0397dc4fc1', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 10:36:40', '2018-04-19 10:36:40', null, '0', '1', 'newTerm', null, '大一', '小米', '0');
INSERT INTO `b_arrange` VALUES ('bd965a654ec440eb882a32406190c965', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 10:37:16', '2018-04-19 10:37:16', null, '0', '1', 'newTerm', null, '大三', '小米', '0');
INSERT INTO `b_arrange` VALUES ('c8000bd9cc0b45bd83c60f090b43d317', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 10:37:57', '2018-04-19 10:37:57', null, '0', '1', 'newTerm2', null, '大二', '阿里巴巴', '0');
INSERT INTO `b_arrange` VALUES ('d3929a4cb5814df1a47625a840724e9b', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 10:37:31', '2018-04-19 10:37:31', null, '0', '1', 'newTerm2', null, '大一', '小米', '0');
INSERT INTO `b_arrange` VALUES ('e15b02f7030e43ccab0277eacbe307ce', '333e421d32d9425ea99afce95b603902', '333e421d32d9425ea99afce95b603902', '2018-04-19 10:36:49', '2018-04-19 10:36:49', null, '0', '1', 'newTerm', null, '大一', '融创软通', '0');
/* /*
Navicat MySQL Data Transfer Navicat MySQL Data Transfer
Source Server : 106.2.3.134 Source Server : 127.0.0.1_3306
Source Server Version : 50719 Source Server Version : 50717
Source Host : 106.2.3.134:13318 Source Host : localhost:3306
Source Database : edu_db Source Database : edu_db
Target Server Type : MYSQL Target Server Type : MYSQL
Target Server Version : 50719 Target Server Version : 50717
File Encoding : 65001 File Encoding : 65001
Date: 2018-04-25 16:17:58 Date: 2018-04-26 10:33:46
*/ */
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;
-- ---------------------------- -- ----------------------------
-- Table structure for `b_subtask` -- Table structure for b_subtask
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `b_subtask`; DROP TABLE IF EXISTS `b_subtask`;
CREATE TABLE `b_subtask` ( CREATE TABLE `b_subtask` (
...@@ -27,12 +27,23 @@ CREATE TABLE `b_subtask` ( ...@@ -27,12 +27,23 @@ CREATE TABLE `b_subtask` (
`update_date` datetime DEFAULT NULL, `update_date` datetime DEFAULT NULL,
`del_flag` varchar(1) NOT NULL, `del_flag` varchar(1) NOT NULL,
`flag` varchar(1) NOT NULL, `flag` varchar(1) NOT NULL,
`remarks` varchar(128) NOT NULL, `remarks` varchar(128) DEFAULT NULL,
`code` varchar(64) NOT NULL, `arrange_id` varchar(64) DEFAULT '',
`name` varchar(256) NOT NULL, `name` varchar(256) DEFAULT '',
`agency_code` varchar(64) DEFAULT NULL,
`status` varchar(1) DEFAULT NULL,
`grade_code` varchar(64) DEFAULT NULL,
PRIMARY KEY (`business_id`) PRIMARY KEY (`business_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------- -- ----------------------------
-- Records of b_subtask -- Records of b_subtask
-- ---------------------------- -- ----------------------------
INSERT INTO `b_subtask` VALUES ('1', '1', null, '1', null, '0', '1', null, 'e15b02f7030e43ccab0277eacbe307ce', 'aaa', '假的Code1', '0', null);
INSERT INTO `b_subtask` VALUES ('18228e13a9c14424a9586c76a405f40f', '333e421d32d9425ea99afce95b603902', '2018-04-26 10:21:28', '333e421d32d9425ea99afce95b603902', '2018-04-26 10:21:28', '0', '1', null, '19aae22e47884deaad96f3470074271e', 'aaa', 'xiaomi', '0', null);
INSERT INTO `b_subtask` VALUES ('2', '1', null, '1', null, '0', '1', null, 'e15b02f7030e43ccab0277eacbe307ce', 'bbb', '假的Code2', '0', null);
INSERT INTO `b_subtask` VALUES ('3', '1', null, '1', null, '0', '1', null, 'e15b02f7030e43ccab0277eacbe307ce', 'aaa', '假的Code3', '0', null);
INSERT INTO `b_subtask` VALUES ('4', '1', null, '1', null, '0', '1', null, 'b', 'aaaa', '假的Code4', '0', null);
INSERT INTO `b_subtask` VALUES ('4f3fdf16524949369331a64bed074603', '333e421d32d9425ea99afce95b603902', '2018-04-26 10:21:28', '333e421d32d9425ea99afce95b603902', '2018-04-26 10:21:28', '0', '1', null, '19aae22e47884deaad96f3470074271e', 'aaa', 'hauwei', '0', null);
INSERT INTO `b_subtask` VALUES ('5', '1', null, '1', null, '0', '1', null, 'b', 'bbbb', '假的Code5', '0', null);
INSERT INTO `b_subtask` VALUES ('6', '1', null, '1', null, '0', '1', null, 'b', 'bbbb', '假的Code6', '0', null);
...@@ -42,9 +42,11 @@ public class BArrangeController extends PaginationController<BArrange> { ...@@ -42,9 +42,11 @@ public class BArrangeController extends PaginationController<BArrange> {
@ApiOperation(value="添加", notes="添加") @ApiOperation(value="添加", notes="添加")
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) //@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping(value = "/add") @PostMapping(value = "/add")
public String add(String json) { public Result add(String json) {
return Result.builder(bArrangeServiceImpl.save(json),
return bArrangeServiceImpl.save(json); MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
json);
} }
@ApiOperation(value="查看 集合", notes="查看单 集合") @ApiOperation(value="查看 集合", notes="查看单 集合")
......
...@@ -70,5 +70,7 @@ public interface BArrangeRepository extends BaseMapper<BArrange> { ...@@ -70,5 +70,7 @@ public interface BArrangeRepository extends BaseMapper<BArrange> {
int insertList(ArrayList<ScheduleDto> list); int insertList(ArrayList<ScheduleDto> list);
int insertBSubtask(List<BSubtask> list);
} }
...@@ -30,12 +30,13 @@ public class BArrange extends IdEntity<BArrange> { ...@@ -30,12 +30,13 @@ public class BArrange extends IdEntity<BArrange> {
private String termCode; private String termCode;
/*描述*/ /*描述*/
private String desc; private String description;
/*状态*/ /*状态*/
@Length(min = 1,max = 64,message = "长度为1") @Length(min = 1,max = 64,message = "长度为1")
@NotBlank @NotBlank
private String status; private String status;
// //
// @Transient // @Transient
// private List<BArrange> childList; // private List<BArrange> childList;
......
...@@ -30,6 +30,8 @@ public class BSubtask extends IdEntity<BSubtask> { ...@@ -30,6 +30,8 @@ public class BSubtask extends IdEntity<BSubtask> {
private String agencyCode; private String agencyCode;
private String gradeCode;
@Transient @Transient
private List<BSubtask> childList; private List<BSubtask> childList;
......
...@@ -14,10 +14,10 @@ public interface BArrangeService { ...@@ -14,10 +14,10 @@ public interface BArrangeService {
/** /**
* 保存 * 保存
* @param bArrange * @param json
* @return * @return
*/ */
String save(String json); PersistModel save(String json);
......
package org.rcisoft.business.barrange.service.impl; package org.rcisoft.business.barrange.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.google.gson.JsonObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.rcisoft.business.barrange.dao.BArrangeRepository; import org.rcisoft.business.barrange.dao.BArrangeRepository;
import org.rcisoft.business.barrange.entity.BArrange; import org.rcisoft.business.barrange.entity.BArrange;
import org.rcisoft.business.barrange.entity.BSubtask;
import org.rcisoft.business.barrange.entity.ScheduleDto; import org.rcisoft.business.barrange.entity.ScheduleDto;
import org.rcisoft.business.barrange.service.BArrangeService; import org.rcisoft.business.barrange.service.BArrangeService;
import org.rcisoft.business.bclass.dao.BClassRepository; import org.rcisoft.business.bclass.dao.BClassRepository;
...@@ -22,7 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -22,7 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import springfox.documentation.spring.web.json.Json;
import javax.security.auth.Subject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -57,17 +62,29 @@ public class BArrangeServiceImpl implements BArrangeService { ...@@ -57,17 +62,29 @@ public class BArrangeServiceImpl implements BArrangeService {
*/ */
// @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) // @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override @Override
public String save(String json){ public PersistModel save(String json){
BArrange bArrange = new BArrange();
List<BSubtask> subtaskList = new ArrayList<>();
JSONObject jsonObject = JSONObject.fromObject(json); JSONObject jsonObject = JSONObject.fromObject(json);
String name = jsonObject.getString("name"); JSONObject arrange = jsonObject.getJSONObject("arrange");
// bArrange.setCommonBusinessId(); bArrange.setDescription(arrange.getString("desc"));
// //增加操作 bArrange.setTermCode(arrange.getString("termCode"));
// UserUtil.setCurrentPersistOperation(bArrange); bArrange.setStatus("0");
// int line = bArrangeRepository.insertSelective(bArrange); UserUtil.setCurrentPersistOperation(bArrange);
// log.info(UserUtil.getUserInfoProp(bArrange.getToken(),UserUtil.USER_USERNAME)+"新增了ID为"+ int line = bArrangeRepository.insertSelective(bArrange);
// bArrange.getBusinessId()+"的信息"); JSONArray childList = arrange.getJSONArray("childList");
// return new PersistModel(line); for(int i = 0; i < childList.size() ; i++){
return name; JSONObject subtask = childList.getJSONObject(i);
BSubtask bSubtask = new BSubtask();
bSubtask.setName(subtask.getString("name"));
bSubtask.setAgencyCode(subtask.getString("agencyCode"));
bSubtask.setArrangeId(bArrange.getBusinessId());
bSubtask.setStatus("0");
UserUtil.setCurrentPersistOperation(bSubtask);
subtaskList.add(bSubtask);
}
bArrangeRepository.insertBSubtask(subtaskList);
return new PersistModel(line);
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<result column="del_flag" jdbcType="VARCHAR" property="delFlag"/> <result column="del_flag" jdbcType="VARCHAR" property="delFlag"/>
<result column="flag" jdbcType="VARCHAR" property="flag"/> <result column="flag" jdbcType="VARCHAR" property="flag"/>
<result column="term_code" jdbcType="VARCHAR" property="termCode"/> <result column="term_code" jdbcType="VARCHAR" property="termCode"/>
<result column="desc" jdbcType="VARCHAR" property="desc"/> <result column="description" jdbcType="VARCHAR" property="description"/>
<result column="status" jdbcType="VARCHAR" property="status"/> <result column="status" jdbcType="VARCHAR" property="status"/>
</resultMap> </resultMap>
<resultMap id="bSubtaskResultMap" type="org.rcisoft.business.barrange.entity.BSubtask"> <resultMap id="bSubtaskResultMap" type="org.rcisoft.business.barrange.entity.BSubtask">
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<resultMap id="BaseResultMap2" type="org.rcisoft.business.barrange.entity.BArrange"> <resultMap id="BaseResultMap2" type="org.rcisoft.business.barrange.entity.BArrange">
<id column="business_id" jdbcType="VARCHAR" property="businessId"/> <id column="business_id" jdbcType="VARCHAR" property="businessId"/>
<result column="term_code" jdbcType="VARCHAR" property="termCode"/> <result column="term_code" jdbcType="VARCHAR" property="termCode"/>
<result column="desc" jdbcType="VARCHAR" property="desc"/> <result column="description" jdbcType="VARCHAR" property="description"/>
<result column="status" jdbcType="VARCHAR" property="status"/> <result column="status" jdbcType="VARCHAR" property="status"/>
<collection property="childList" javaType="ArrayList" column="business_id" ofType="org.rcisoft.business.barrange.entity.BSubtask" <collection property="childList" javaType="ArrayList" column="business_id" ofType="org.rcisoft.business.barrange.entity.BSubtask"
select="org.rcisoft.business.barrange.dao.BArrangeRepository.queryBSubtask" select="org.rcisoft.business.barrange.dao.BArrangeRepository.queryBSubtask"
...@@ -107,5 +107,17 @@ ...@@ -107,5 +107,17 @@
</foreach> </foreach>
</insert> </insert>
<insert id="insertBSubtask">
insert into b_subtask(business_id,flag,del_flag,update_by,create_by,create_date,update_date,remarks,
arrange_id,name,agency_code,status,grade_code)
values
<foreach collection="list" item="item" separator=",">
(#{item.businessId},#{item.flag},#{item.delFlag},#{item.updateBy},#{item.createBy},
#{item.createDate},#{item.updateDate},#{item.remarks},
#{item.arrangeId},#{item.name},#{item.agencyCode},
#{item.status},#{item.gradeCode})
</foreach>
</insert>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper> </mapper>
\ No newline at end of file
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