|  |  |  | 
|---|
|  |  |  | BeanUtils.copyProperties(w, newType); | 
|---|
|  |  |  | newType.setInsuranceId(newModel.getId()); | 
|---|
|  |  |  | newType.setBaseId(w.getId()); | 
|---|
|  |  |  | newType.setDataType(Constants.ONE); | 
|---|
|  |  |  | newType.setDataType(Constants.TWO); | 
|---|
|  |  |  | newType.setVersion(newModel.getVersion()); | 
|---|
|  |  |  | w.setSortnum(num++); | 
|---|
|  |  |  | worktypeMapper.insert(newType); | 
|---|
|  |  |  | 
|---|
|  |  |  | newModel.setId(null); | 
|---|
|  |  |  | newModel.setVersion(updateModel.getVersion()); | 
|---|
|  |  |  | newModel.setCreateDate(new Date()); | 
|---|
|  |  |  | newModel.setName(updateModel.getName()); | 
|---|
|  |  |  | newModel.setBaseId(insurance.getId()); | 
|---|
|  |  |  | newModel.setDataType(Constants.TWO); | 
|---|
|  |  |  | insuranceMapper.insert(newModel); | 
|---|
|  |  |  | 
|---|
|  |  |  | .lambda() | 
|---|
|  |  |  | .eq(Insurance::getBaseId,insurance.getId()) | 
|---|
|  |  |  | .eq(Insurance::getDataType,Constants.TWO) | 
|---|
|  |  |  | .ne(Insurance::getId,newModel.getId()) | 
|---|
|  |  |  | .set(Insurance::getDataType,Constants.ONE) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | worktypeMapper.update(null,new UpdateWrapper<Worktype>() | 
|---|
|  |  |  | .lambda() | 
|---|
|  |  |  | .eq(Worktype::getBaseId,insurance.getId()) | 
|---|
|  |  |  | .eq(Worktype::getDataType,Constants.TWO) | 
|---|
|  |  |  | .set(Worktype::getDataType,Constants.ONE) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //处理工作信息,新增最新的,同时产生历史版本 | 
|---|
|  |  |  | dealWorkTypeData(updateModel,newModel,insurance.getWorktypeList(),false); | 
|---|
|  |  |  | } | 
|---|