| New file |
| | |
| | | package com.java110.dto.sysDocument; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 系统文档数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class SysDocumentDto extends PageDto implements Serializable { |
| | | |
| | | private String docContent; |
| | | private String docCode; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getDocContent() { |
| | | return docContent; |
| | | } |
| | | |
| | | public void setDocContent(String docContent) { |
| | | this.docContent = docContent; |
| | | } |
| | | |
| | | public String getDocCode() { |
| | | return docCode; |
| | | } |
| | | |
| | | public void setDocCode(String docCode) { |
| | | this.docCode = docCode; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.po.sysDocument; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class SysDocumentPo implements Serializable { |
| | | |
| | | |
| | | private String docId; |
| | | |
| | | private String docContent; |
| | | private String docCode; |
| | | private String statusCd = "0"; |
| | | |
| | | public String getDocContent() { |
| | | return docContent; |
| | | } |
| | | |
| | | public void setDocContent(String docContent) { |
| | | this.docContent = docContent; |
| | | } |
| | | |
| | | public String getDocCode() { |
| | | return docCode; |
| | | } |
| | | |
| | | public void setDocCode(String docCode) { |
| | | this.docCode = docCode; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | |
| | | public String getDocId() { |
| | | return docId; |
| | | } |
| | | |
| | | public void setDocId(String docId) { |
| | | this.docId = docId; |
| | | } |
| | | } |
| | |
| | | public static final String CODE_PREFIX_receiptId = "83"; |
| | | public static final String CODE_PREFIX_auditId = "84"; |
| | | public static final String CODE_PREFIX_typeCd = "85"; |
| | | public static final String CODE_PREFIX_docId = "86"; |
| | | |
| | | |
| | | |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="sysDocumentServiceDaoImpl"> |
| | | |
| | | |
| | | <!-- 保存系统文档信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveSysDocumentInfo" parameterType="Map"> |
| | | insert into sys_document( |
| | | doc_id,doc_content,doc_code |
| | | ) values ( |
| | | #{docId},#{docContent},#{docCode} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询系统文档信息 add by wuxw 2018-07-03 --> |
| | | <select id="getSysDocumentInfo" parameterType="Map" resultType="Map"> |
| | | select t.doc_id docId,t.doc_content,t.doc_content docContent,t.doc_code,t.doc_code docCode,t.status_cd,t.status_cd statusCd |
| | | from sys_document t |
| | | where 1 =1 |
| | | <if test="docContent !=null and docContent != ''"> |
| | | and t.doc_content= #{docContent} |
| | | </if> |
| | | <if test="docCode !=null and docCode != ''"> |
| | | and t.doc_code= #{docCode} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 修改系统文档信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateSysDocumentInfo" parameterType="Map"> |
| | | update sys_document t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="docContent !=null and docContent != ''"> |
| | | , t.doc_content= #{docContent} |
| | | </if> |
| | | <if test="docCode !=null and docCode != ''"> |
| | | , t.doc_code= #{docCode} |
| | | </if> |
| | | where 1=1 |
| | | <if test="docId !=null and docId != ''"> |
| | | and t.doc_id= #{docId} |
| | | </if> |
| | | </update> |
| | | |
| | | <!-- 查询系统文档数量 add by wuxw 2018-07-03 --> |
| | | <select id="querySysDocumentsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from sys_document t |
| | | where 1 =1 |
| | | <if test="docContent !=null and docContent != ''"> |
| | | and t.doc_content= #{docContent} |
| | | </if> |
| | | <if test="docCode !=null and docCode != ''"> |
| | | and t.doc_code= #{docCode} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="docId !=null and docId != ''"> |
| | | and t.doc_id= #{docId} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | { |
| | | "autoMove": false, |
| | | "id": "typeCd", |
| | | "name": "activitiesType", |
| | | "desc": "信息分类", |
| | | "shareParam": "communityId", |
| | | "shareColumn": "community_id", |
| | | "shareName": "community", |
| | | "tableName": "activities_type", |
| | | "id": "docId", |
| | | "name": "sysDocument", |
| | | "desc": "系统文档", |
| | | "shareParam": "docId", |
| | | "shareColumn": "doc_id", |
| | | "shareName": "common", |
| | | "tableName": "sys_document", |
| | | "param": { |
| | | "typeCd": "type_cd", |
| | | "typeName": "type_name", |
| | | "typeDesc": "type_desc", |
| | | "seq": "seq", |
| | | "defaultShow": "defalut_show", |
| | | "communityId": "community_id", |
| | | "docCode": "doc_code", |
| | | "docContent": "doc_content", |
| | | "statusCd": "status_cd" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "communityId", |
| | | "msg": "小区不能为空" |
| | | "code": "docCode", |
| | | "msg": "文档编码不能为空" |
| | | }, |
| | | { |
| | | "code": "typeName", |
| | | "msg": "分类不能为空" |
| | | }, |
| | | { |
| | | "code": "seq", |
| | | "msg": "顺序不能为空" |
| | | }, |
| | | { |
| | | "code": "defaultShow", |
| | | "msg": "显示不能为空" |
| | | "code": "docContent", |
| | | "msg": "文档内容不能为空" |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | { |
| | | "autoMove": false, |
| | | "id": "typeCd", |
| | | "name": "activitiesType", |
| | | "desc": "信息分类", |
| | | "shareParam": "communityId", |
| | | "shareColumn": "community_id", |
| | | "shareName": "community", |
| | | "tableName": "activities_type", |
| | | "param": { |
| | | "typeCd": "type_cd", |
| | | "typeName": "type_name", |
| | | "typeDesc": "type_desc", |
| | | "seq": "seq", |
| | | "defaultShow": "defalut_show", |
| | | "communityId": "community_id", |
| | | "statusCd": "status_cd" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "communityId", |
| | | "msg": "小区不能为空" |
| | | }, |
| | | { |
| | | "code": "typeName", |
| | | "msg": "分类不能为空" |
| | | }, |
| | | { |
| | | "code": "seq", |
| | | "msg": "顺序不能为空" |
| | | }, |
| | | { |
| | | "code": "defaultShow", |
| | | "msg": "显示不能为空" |
| | | } |
| | | ] |
| | | } |
| | | |
| New file |
| | |
| | | package com.java110.intf.common; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.sysDocument.SysDocumentDto; |
| | | import com.java110.po.sysDocument.SysDocumentPo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName ISysDocumentInnerServiceSMO |
| | | * @Description 系统文档接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "common-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/sysDocumentApi") |
| | | public interface ISysDocumentInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveSysDocument", method = RequestMethod.POST) |
| | | public int saveSysDocument(@RequestBody SysDocumentPo sysDocumentPo); |
| | | |
| | | @RequestMapping(value = "/updateSysDocument", method = RequestMethod.POST) |
| | | public int updateSysDocument(@RequestBody SysDocumentPo sysDocumentPo); |
| | | |
| | | @RequestMapping(value = "/deleteSysDocument", method = RequestMethod.POST) |
| | | public int deleteSysDocument(@RequestBody SysDocumentPo sysDocumentPo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param sysDocumentDto 数据对象分享 |
| | | * @return SysDocumentDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/querySysDocuments", method = RequestMethod.POST) |
| | | List<SysDocumentDto> querySysDocuments(@RequestBody SysDocumentDto sysDocumentDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param sysDocumentDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/querySysDocumentsCount", method = RequestMethod.POST) |
| | | int querySysDocumentsCount(@RequestBody SysDocumentDto sysDocumentDto); |
| | | } |
| New file |
| | |
| | | package com.java110.common.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.bmo.sysDocument.IDeleteSysDocumentBMO; |
| | | import com.java110.common.bmo.sysDocument.IGetSysDocumentBMO; |
| | | import com.java110.common.bmo.sysDocument.ISaveSysDocumentBMO; |
| | | import com.java110.common.bmo.sysDocument.IUpdateSysDocumentBMO; |
| | | import com.java110.dto.sysDocument.SysDocumentDto; |
| | | import com.java110.po.sysDocument.SysDocumentPo; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/sysDocument") |
| | | public class SysDocumentApi { |
| | | |
| | | @Autowired |
| | | private ISaveSysDocumentBMO saveSysDocumentBMOImpl; |
| | | @Autowired |
| | | private IUpdateSysDocumentBMO updateSysDocumentBMOImpl; |
| | | @Autowired |
| | | private IDeleteSysDocumentBMO deleteSysDocumentBMOImpl; |
| | | |
| | | @Autowired |
| | | private IGetSysDocumentBMO getSysDocumentBMOImpl; |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /sysDocument/saveSysDocument |
| | | * @path /app/sysDocument/saveSysDocument |
| | | */ |
| | | @RequestMapping(value = "/saveSysDocument", method = RequestMethod.POST) |
| | | public ResponseEntity<String> saveSysDocument(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "docCode", "请求报文中未包含docCode"); |
| | | Assert.hasKeyAndValue(reqJson, "docContent", "请求报文中未包含docContent"); |
| | | |
| | | |
| | | SysDocumentPo sysDocumentPo = BeanConvertUtil.covertBean(reqJson, SysDocumentPo.class); |
| | | return saveSysDocumentBMOImpl.save(sysDocumentPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信修改消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /sysDocument/updateSysDocument |
| | | * @path /app/sysDocument/updateSysDocument |
| | | */ |
| | | @RequestMapping(value = "/updateSysDocument", method = RequestMethod.POST) |
| | | public ResponseEntity<String> updateSysDocument(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "docCode", "请求报文中未包含docCode"); |
| | | Assert.hasKeyAndValue(reqJson, "docContent", "请求报文中未包含docContent"); |
| | | Assert.hasKeyAndValue(reqJson, "docId", "docId不能为空"); |
| | | |
| | | |
| | | SysDocumentPo sysDocumentPo = BeanConvertUtil.covertBean(reqJson, SysDocumentPo.class); |
| | | return updateSysDocumentBMOImpl.update(sysDocumentPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /sysDocument/deleteSysDocument |
| | | * @path /app/sysDocument/deleteSysDocument |
| | | */ |
| | | @RequestMapping(value = "/deleteSysDocument", method = RequestMethod.POST) |
| | | public ResponseEntity<String> deleteSysDocument(@RequestBody JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "docId", "docId不能为空"); |
| | | |
| | | |
| | | SysDocumentPo sysDocumentPo = BeanConvertUtil.covertBean(reqJson, SysDocumentPo.class); |
| | | return deleteSysDocumentBMOImpl.delete(sysDocumentPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param docCode 文档编码 |
| | | * @return |
| | | * @serviceCode /sysDocument/querySysDocument |
| | | * @path /app/sysDocument/querySysDocument |
| | | */ |
| | | @RequestMapping(value = "/querySysDocument", method = RequestMethod.GET) |
| | | public ResponseEntity<String> querySysDocument(@RequestParam(value = "docCode",required = false) String docCode, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | SysDocumentDto sysDocumentDto = new SysDocumentDto(); |
| | | sysDocumentDto.setPage(page); |
| | | sysDocumentDto.setRow(row); |
| | | sysDocumentDto.setDocCode(docCode); |
| | | return getSysDocumentBMOImpl.get(sysDocumentDto); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.sysDocument; |
| | | import com.java110.po.sysDocument.SysDocumentPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteSysDocumentBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改系统文档 |
| | | * add by wuxw |
| | | * @param sysDocumentPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(SysDocumentPo sysDocumentPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.sysDocument; |
| | | import com.java110.dto.sysDocument.SysDocumentDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | public interface IGetSysDocumentBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询系统文档 |
| | | * add by wuxw |
| | | * @param sysDocumentDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(SysDocumentDto sysDocumentDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.sysDocument; |
| | | |
| | | import com.java110.po.sysDocument.SysDocumentPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | public interface ISaveSysDocumentBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加系统文档 |
| | | * add by wuxw |
| | | * @param sysDocumentPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(SysDocumentPo sysDocumentPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.sysDocument; |
| | | import com.java110.po.sysDocument.SysDocumentPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateSysDocumentBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改系统文档 |
| | | * add by wuxw |
| | | * @param sysDocumentPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(SysDocumentPo sysDocumentPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.sysDocument.impl; |
| | | |
| | | import com.java110.common.bmo.sysDocument.IDeleteSysDocumentBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.common.ISysDocumentInnerServiceSMO; |
| | | import com.java110.po.sysDocument.SysDocumentPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteSysDocumentBMOImpl") |
| | | public class DeleteSysDocumentBMOImpl implements IDeleteSysDocumentBMO { |
| | | |
| | | @Autowired |
| | | private ISysDocumentInnerServiceSMO sysDocumentInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param sysDocumentPo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(SysDocumentPo sysDocumentPo) { |
| | | |
| | | int flag = sysDocumentInnerServiceSMOImpl.deleteSysDocument(sysDocumentPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.sysDocument.impl; |
| | | |
| | | import com.java110.common.bmo.sysDocument.IGetSysDocumentBMO; |
| | | import com.java110.dto.sysDocument.SysDocumentDto; |
| | | import com.java110.intf.common.ISysDocumentInnerServiceSMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("getSysDocumentBMOImpl") |
| | | public class GetSysDocumentBMOImpl implements IGetSysDocumentBMO { |
| | | |
| | | @Autowired |
| | | private ISysDocumentInnerServiceSMO sysDocumentInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param sysDocumentDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(SysDocumentDto sysDocumentDto) { |
| | | |
| | | |
| | | int count = sysDocumentInnerServiceSMOImpl.querySysDocumentsCount(sysDocumentDto); |
| | | |
| | | List<SysDocumentDto> sysDocumentDtos = null; |
| | | if (count > 0) { |
| | | sysDocumentDtos = sysDocumentInnerServiceSMOImpl.querySysDocuments(sysDocumentDto); |
| | | } else { |
| | | sysDocumentDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) sysDocumentDto.getRow()), count, sysDocumentDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.sysDocument.impl; |
| | | |
| | | import com.java110.common.bmo.sysDocument.ISaveSysDocumentBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.common.ISysDocumentInnerServiceSMO; |
| | | import com.java110.po.sysDocument.SysDocumentPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveSysDocumentBMOImpl") |
| | | public class SaveSysDocumentBMOImpl implements ISaveSysDocumentBMO { |
| | | |
| | | @Autowired |
| | | private ISysDocumentInnerServiceSMO sysDocumentInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param sysDocumentPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> save(SysDocumentPo sysDocumentPo) { |
| | | |
| | | sysDocumentPo.setDocId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_docId)); |
| | | int flag = sysDocumentInnerServiceSMOImpl.saveSysDocument(sysDocumentPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.sysDocument.impl; |
| | | |
| | | import com.java110.common.bmo.sysDocument.IUpdateSysDocumentBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.common.ISysDocumentInnerServiceSMO; |
| | | import com.java110.po.sysDocument.SysDocumentPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateSysDocumentBMOImpl") |
| | | public class UpdateSysDocumentBMOImpl implements IUpdateSysDocumentBMO { |
| | | |
| | | @Autowired |
| | | private ISysDocumentInnerServiceSMO sysDocumentInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param sysDocumentPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(SysDocumentPo sysDocumentPo) { |
| | | |
| | | int flag = sysDocumentInnerServiceSMOImpl.updateSysDocument(sysDocumentPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 系统文档组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 系统文档服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface ISysDocumentServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 系统文档信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveSysDocumentInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询系统文档信息(instance过程) |
| | | * 根据bId 查询系统文档信息 |
| | | * @param info bId 信息 |
| | | * @return 系统文档信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getSysDocumentInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改系统文档信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateSysDocumentInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询系统文档总数 |
| | | * |
| | | * @param info 系统文档信息 |
| | | * @return 系统文档数量 |
| | | */ |
| | | int querySysDocumentsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.common.dao.ISysDocumentServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 系统文档服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("sysDocumentServiceDaoImpl") |
| | | //@Transactional |
| | | public class SysDocumentServiceDaoImpl extends BaseServiceDao implements ISysDocumentServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SysDocumentServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存系统文档信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveSysDocumentInfo(Map info) throws DAOException { |
| | | logger.debug("保存系统文档信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("sysDocumentServiceDaoImpl.saveSysDocumentInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存系统文档信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询系统文档信息(instance) |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getSysDocumentInfo(Map info) throws DAOException { |
| | | logger.debug("查询系统文档信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessSysDocumentInfos = sqlSessionTemplate.selectList("sysDocumentServiceDaoImpl.getSysDocumentInfo",info); |
| | | |
| | | return businessSysDocumentInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改系统文档信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateSysDocumentInfo(Map info) throws DAOException { |
| | | logger.debug("修改系统文档信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("sysDocumentServiceDaoImpl.updateSysDocumentInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改系统文档信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询系统文档数量 |
| | | * @param info 系统文档信息 |
| | | * @return 系统文档数量 |
| | | */ |
| | | @Override |
| | | public int querySysDocumentsCount(Map info) { |
| | | logger.debug("查询系统文档数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessSysDocumentInfos = sqlSessionTemplate.selectList("sysDocumentServiceDaoImpl.querySysDocumentsCount", info); |
| | | if (businessSysDocumentInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessSysDocumentInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.smo.impl; |
| | | |
| | | |
| | | import com.java110.common.dao.ISysDocumentServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.sysDocument.SysDocumentDto; |
| | | import com.java110.intf.common.ISysDocumentInnerServiceSMO; |
| | | import com.java110.po.sysDocument.SysDocumentPo; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 系统文档内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class SysDocumentInnerServiceSMOImpl extends BaseServiceSMO implements ISysDocumentInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private ISysDocumentServiceDao sysDocumentServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveSysDocument(@RequestBody SysDocumentPo sysDocumentPo) { |
| | | int saveFlag = 1; |
| | | sysDocumentServiceDaoImpl.saveSysDocumentInfo(BeanConvertUtil.beanCovertMap(sysDocumentPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateSysDocument(@RequestBody SysDocumentPo sysDocumentPo) { |
| | | int saveFlag = 1; |
| | | sysDocumentServiceDaoImpl.updateSysDocumentInfo(BeanConvertUtil.beanCovertMap(sysDocumentPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteSysDocument(@RequestBody SysDocumentPo sysDocumentPo) { |
| | | int saveFlag = 1; |
| | | sysDocumentPo.setStatusCd("1"); |
| | | sysDocumentServiceDaoImpl.updateSysDocumentInfo(BeanConvertUtil.beanCovertMap(sysDocumentPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysDocumentDto> querySysDocuments(@RequestBody SysDocumentDto sysDocumentDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = sysDocumentDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | sysDocumentDto.setPage((page - 1) * sysDocumentDto.getRow()); |
| | | } |
| | | |
| | | List<SysDocumentDto> sysDocuments = BeanConvertUtil.covertBeanList(sysDocumentServiceDaoImpl.getSysDocumentInfo(BeanConvertUtil.beanCovertMap(sysDocumentDto)), SysDocumentDto.class); |
| | | |
| | | return sysDocuments; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int querySysDocumentsCount(@RequestBody SysDocumentDto sysDocumentDto) { |
| | | return sysDocumentServiceDaoImpl.querySysDocumentsCount(BeanConvertUtil.beanCovertMap(sysDocumentDto)); |
| | | } |
| | | |
| | | public ISysDocumentServiceDao getSysDocumentServiceDaoImpl() { |
| | | return sysDocumentServiceDaoImpl; |
| | | } |
| | | |
| | | public void setSysDocumentServiceDaoImpl(ISysDocumentServiceDao sysDocumentServiceDaoImpl) { |
| | | this.sysDocumentServiceDaoImpl = sysDocumentServiceDaoImpl; |
| | | } |
| | | } |