ソースを参照

提交接口中英文切换

zhangding 5 年 前
コミット
484dcb1f4a
15 ファイル変更645 行追加22 行削除
  1. 18 0
      dgtly-api/src/main/java/com/dgtly/api/controller/SysNoticeInterface.java
  2. 23 0
      dgtly-member/dgtly-member-api/src/main/java/com/dgtly/member/controller/DemandInfoController.java
  3. 18 0
      dgtly-member/dgtly-member-api/src/main/java/com/dgtly/member/controller/SupplyInfoController.java
  4. 74 0
      dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/domain/NoticeDemand.java
  5. 84 0
      dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/domain/NoticeSupply.java
  6. 32 0
      dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/mapper/NoticeDemandMapper.java
  7. 53 1
      dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/mapper/NoticeSupplyMapper.java
  8. 55 0
      dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/service/impl/NoticeDemandServiceImpl.java
  9. 63 0
      dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/service/impl/NoticeSupplyServiceImpl.java
  10. 26 8
      dgtly-member/dgtly-member-common/src/main/resources/mapper/notice/NoticeDemandMapper.xml
  11. 47 9
      dgtly-member/dgtly-member-common/src/main/resources/mapper/notice/NoticeSupplyMapper.xml
  12. 44 0
      dgtly-system/src/main/java/com/dgtly/system/domain/SysNotice.java
  13. 46 0
      dgtly-system/src/main/java/com/dgtly/system/mapper/SysNoticeMapper.java
  14. 42 0
      dgtly-system/src/main/java/com/dgtly/system/service/impl/SysNoticeServiceImpl.java
  15. 20 4
      dgtly-system/src/main/resources/mapper/system/SysNoticeMapper.xml

+ 18 - 0
dgtly-api/src/main/java/com/dgtly/api/controller/SysNoticeInterface.java

@@ -9,6 +9,9 @@ import com.dgtly.common.core.domain.ParameterObject;
 import com.dgtly.common.utils.StringUtils;
 import com.dgtly.system.domain.SysNotice;
 import com.dgtly.system.service.ISysNoticeService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -41,6 +44,11 @@ public class SysNoticeInterface extends ApiBaseController {
      * @auther: LiuLingChao
      * @date: 2019-11-04 11:46
      */
+    @ApiOperation(value = "根据类型查询内容列表前五个")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body"),
+            @ApiImplicitParam(name = "language" , paramType = "header")
+    })
     @PostMapping("getNoticeListTop5")
     public AjaxResult getNoticeList(){
 
@@ -71,6 +79,11 @@ public class SysNoticeInterface extends ApiBaseController {
      * @auther: LiuLingChao
      * @date: 2019-11-04 15:01
      */
+    @ApiOperation(value = "根据类型查询全部内容列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body"),
+            @ApiImplicitParam(name = "language" , paramType = "header")
+    })
     @PostMapping("getNoticeListAll")
     public AjaxResult getNoticeListAll(){
         ParameterObject obj =  getParameterObject();
@@ -94,6 +107,11 @@ public class SysNoticeInterface extends ApiBaseController {
      * @auther: LiuLingChao
      * @date: 2020-2-27 10:31
      */
+    @ApiOperation(value = "根据id查询详情")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body"),
+            @ApiImplicitParam(name = "language" , paramType = "header")
+    })
     @RequestMapping("getNoticeListById")
     public AjaxResult getNoticeListById(){
         ParameterObject obj =  getParameterObject();

+ 23 - 0
dgtly-member/dgtly-member-api/src/main/java/com/dgtly/member/controller/DemandInfoController.java

@@ -11,6 +11,9 @@ import com.dgtly.common.utils.DateUtils;
 import com.dgtly.common.utils.StringUtils;
 import com.dgtly.notice.domain.NoticeDemand;
 import com.dgtly.notice.service.INoticeDemandService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -44,6 +47,11 @@ public class DemandInfoController extends ApiBaseController {
      * @auther: LiuLingChao
      * @date: 2020-2-25 10:11
      */
+     @ApiOperation(value = "首页获取需求列表前10条")
+     @ApiImplicitParams({
+             @ApiImplicitParam(name = "params" , paramType = "body"),
+             @ApiImplicitParam(name = "language" , paramType = "header")
+     })
     @ApiPassToken/* 不用验证token  方法上可用*/
     @PostMapping("/getDemandInfoTenList")
     public Object getDemandInfoTenList(){
@@ -59,6 +67,11 @@ public class DemandInfoController extends ApiBaseController {
      * @auther: LiuLingChao
      * @date: 2020-2-25 10:54
      */
+    @ApiOperation(value = "获取需求信息详情")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body"),
+            @ApiImplicitParam(name = "language" , paramType = "header")
+    })
     @ApiPassToken/* 不用验证token  方法上可用*/
     @PostMapping("/getDemandInfo")
     public Object getDemandInfo(){
@@ -75,6 +88,11 @@ public class DemandInfoController extends ApiBaseController {
      * @auther: LiuLingChao
      * @date: 2020-2-25 11:02
      */
+    @ApiOperation(value = "获取全部需求信息分页列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body"),
+            @ApiImplicitParam(name = "language" , paramType = "header")
+    })
     @ApiPassToken/* 不用验证token  方法上可用*/
     @PostMapping("/getDemandInfoAllList")
     public Object getDemandInfoAllList(){
@@ -113,6 +131,11 @@ public class DemandInfoController extends ApiBaseController {
      * @auther: LiuLingChao
      * @date: 2020-2-27 16:08
      */
+    @ApiOperation(value = "获取网站用户发布的需求")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body"),
+            @ApiImplicitParam(name = "language" , paramType = "header")
+    })
     @PostMapping("/getMemberDemandList")
     public Object getMemberDemandList(){
         String userId = TokenUtil.getTokenUserId();

+ 18 - 0
dgtly-member/dgtly-member-api/src/main/java/com/dgtly/member/controller/SupplyInfoController.java

@@ -7,6 +7,9 @@ import com.dgtly.common.core.domain.AjaxResult;
 import com.dgtly.common.core.domain.ParameterObject;
 import com.dgtly.notice.domain.NoticeSupply;
 import com.dgtly.notice.service.INoticeSupplyService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -39,6 +42,11 @@ public class SupplyInfoController extends ApiBaseController {
      * @auther: LiuLingChao
      * @date: 2020-2-25 11:09
      */
+    @ApiOperation(value = "获取全部供应信息分页列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body"),
+            @ApiImplicitParam(name = "language" , paramType = "header")
+    })
     @PostMapping("/getSupplyInfoAllList")
     public Object getSupplyInfoAllList(){
         ParameterObject obj =  getParameterObject();
@@ -55,6 +63,11 @@ public class SupplyInfoController extends ApiBaseController {
      * @auther: LiuLingChao
      * @date: 2020-2-25 11:11
      */
+    @ApiOperation(value = "根据供应id获取供应详细信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body"),
+            @ApiImplicitParam(name = "language" , paramType = "header")
+    })
     @PostMapping("/getSupplyInfo")
     public Object getSupplyInfo(){
         ParameterObject obj =  getParameterObject();
@@ -70,6 +83,11 @@ public class SupplyInfoController extends ApiBaseController {
      * @auther: LiuLingChao
      * @date: 2020-2-25 11:12
      */
+    @ApiOperation(value = "获取最新的供应信息前10条")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "params" , paramType = "body"),
+            @ApiImplicitParam(name = "language" , paramType = "header")
+    })
     @PostMapping("/getSupplyInfoTenLsit")
     public Object getSupplyInfoTenLsit(){
 

+ 74 - 0
dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/domain/NoticeDemand.java

@@ -47,6 +47,30 @@ public class NoticeDemand extends BaseEntity
     @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date releaseTime;
 
+    /** 求购标题 */
+    @Excel(name = "求购标题英文字段")
+    private String purchaseTitleEn;
+
+    /** 需求概要 */
+    @Excel(name = "需求概要英文字段")
+    private String summaryOfNeedsEn;
+
+    /** 需求详情 */
+    @Excel(name = "需求详情英文字段")
+    private String demandDetailsEn;
+
+    /** 联系人 */
+    @Excel(name = "联系人英文字段")
+    private String contactsEn;
+
+    /** 联系电话 */
+    @Excel(name = "联系电话英文字段")
+    private String contactNumberEn;
+
+    /** 发布时间 */
+    @Excel(name = "发布时间英文字段", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date releaseTimeEn;
+
     /** 需求信息状态 */
     @Excel(name = "需求信息状态")
     private String status;
@@ -145,6 +169,54 @@ public class NoticeDemand extends BaseEntity
         return delFlag;
     }
 
+    public String getPurchaseTitleEn() {
+        return purchaseTitleEn;
+    }
+
+    public void setPurchaseTitleEn(String purchaseTitleEn) {
+        this.purchaseTitleEn = purchaseTitleEn;
+    }
+
+    public String getSummaryOfNeedsEn() {
+        return summaryOfNeedsEn;
+    }
+
+    public void setSummaryOfNeedsEn(String summaryOfNeedsEn) {
+        this.summaryOfNeedsEn = summaryOfNeedsEn;
+    }
+
+    public String getDemandDetailsEn() {
+        return demandDetailsEn;
+    }
+
+    public void setDemandDetailsEn(String demandDetailsEn) {
+        this.demandDetailsEn = demandDetailsEn;
+    }
+
+    public String getContactsEn() {
+        return contactsEn;
+    }
+
+    public void setContactsEn(String contactsEn) {
+        this.contactsEn = contactsEn;
+    }
+
+    public String getContactNumberEn() {
+        return contactNumberEn;
+    }
+
+    public void setContactNumberEn(String contactNumberEn) {
+        this.contactNumberEn = contactNumberEn;
+    }
+
+    public Date getReleaseTimeEn() {
+        return releaseTimeEn;
+    }
+
+    public void setReleaseTimeEn(Date releaseTimeEn) {
+        this.releaseTimeEn = releaseTimeEn;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -165,4 +237,6 @@ public class NoticeDemand extends BaseEntity
             .append("remark", getRemark())
             .toString();
     }
+
+
 }

+ 84 - 0
dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/domain/NoticeSupply.java

@@ -36,30 +36,58 @@ public class NoticeSupply extends BaseEntity
     @Excel(name = "供应信息标题")
     private String supplyTitle;
 
+    /** 供应信息标题 */
+    @Excel(name = "供应信息标题英文字段")
+    private String supplyTitleEn;
+
     /** 供应信息详情 */
     @Excel(name = "供应信息详情")
     private String supplyDetails ;
 
+    /** 供应信息详情 */
+    @Excel(name = "供应信息详情英文字段")
+    private String supplyDetailsEn ;
+
     /** 生产厂家 */
     @Excel(name = "生产厂家")
     private String manufacturer;
 
+    /** 生产厂家 */
+    @Excel(name = "生产厂家英文字段")
+    private String manufacturerEn;
+
     /** 联系人 */
     @Excel(name = "联系人")
     private String contacts;
 
+    /** 联系人 */
+    @Excel(name = "联系人")
+    private String contactsEn;
+
     /** 联系电话 */
     @Excel(name = "联系电话")
     private String telephone;
 
+    /** 联系电话 */
+    @Excel(name = "联系电话")
+    private String telephoneEn;
+
     /** 发布时间 */
     @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date releaseTime;
 
+    /** 发布时间 */
+    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date releaseTimeEn;
+
     /** 商品图片 */
     @Excel(name = "商品图片")
     private String picture;
 
+    /** 商品图片 */
+    @Excel(name = "商品图片")
+    private String pictureEn;
+
     /** 供应信息状态 */
     @Excel(name = "供应信息状态")
     private String status;
@@ -189,6 +217,62 @@ public class NoticeSupply extends BaseEntity
         return delFlag;
     }
 
+    public String getSupplyTitleEn() {
+        return supplyTitleEn;
+    }
+
+    public void setSupplyTitleEn(String supplyTitleEn) {
+        this.supplyTitleEn = supplyTitleEn;
+    }
+
+    public String getSupplyDetailsEn() {
+        return supplyDetailsEn;
+    }
+
+    public void setSupplyDetailsEn(String supplyDetailsEn) {
+        this.supplyDetailsEn = supplyDetailsEn;
+    }
+
+    public String getManufacturerEn() {
+        return manufacturerEn;
+    }
+
+    public void setManufacturerEn(String manufacturerEn) {
+        this.manufacturerEn = manufacturerEn;
+    }
+
+    public String getContactsEn() {
+        return contactsEn;
+    }
+
+    public void setContactsEn(String contactsEn) {
+        this.contactsEn = contactsEn;
+    }
+
+    public String getTelephoneEn() {
+        return telephoneEn;
+    }
+
+    public void setTelephoneEn(String telephoneEn) {
+        this.telephoneEn = telephoneEn;
+    }
+
+    public Date getReleaseTimeEn() {
+        return releaseTimeEn;
+    }
+
+    public void setReleaseTimeEn(Date releaseTimeEn) {
+        this.releaseTimeEn = releaseTimeEn;
+    }
+
+    public String getPictureEn() {
+        return pictureEn;
+    }
+
+    public void setPictureEn(String pictureEn) {
+        this.pictureEn = pictureEn;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 32 - 0
dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/mapper/NoticeDemandMapper.java

@@ -1,5 +1,6 @@
 package com.dgtly.notice.mapper;
 
+import com.dgtly.common.annotation.SwitchEn;
 import com.dgtly.notice.domain.NoticeDemand;
 import java.util.List;
 
@@ -17,6 +18,19 @@ public interface NoticeDemandMapper
      * @param id 【请填写功能名称】ID
      * @return 【请填写功能名称】
      */
+    @SwitchEn(oldfiles = {
+            "purchase_title",
+            "summary_of_needs",
+            "demand_details",
+            "contacts",
+            "contact_number"
+    },newfiles = {
+            "purchase_title_en purchase_title",
+            "summary_of_needs_en summary_of_needs",
+            "demand_details_en demand_details",
+            "contacts_en contacts",
+            "contact_number_en contact_number"
+    })
     public NoticeDemand selectNoticeDemandById(Long id);
 
     /**
@@ -25,6 +39,19 @@ public interface NoticeDemandMapper
      * @param noticeDemand 【请填写功能名称】
      * @return 【请填写功能名称】集合
      */
+    @SwitchEn(oldfiles = {
+            "purchase_title",
+            "summary_of_needs",
+            "demand_details",
+            "contacts",
+            "contact_number"
+    },newfiles = {
+            "purchase_title_en purchase_title",
+            "summary_of_needs_en summary_of_needs",
+            "demand_details_en demand_details",
+            "contacts_en contacts",
+            "contact_number_en contact_number"
+    })
     public List<NoticeDemand> selectNoticeDemandList(NoticeDemand noticeDemand);
 
     /**
@@ -67,5 +94,10 @@ public interface NoticeDemandMapper
      * @auther: LiuLingChao
      * @date: 2020-2-25 10:27
      */
+    @SwitchEn(oldfiles = {
+            "purchase_title"
+    },newfiles = {
+            "purchase_title_en purchase_title"
+    })
     public List<NoticeDemand> getDemandInfoTenList();
 }

+ 53 - 1
dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/mapper/NoticeSupplyMapper.java

@@ -1,5 +1,6 @@
 package com.dgtly.notice.mapper;
 
+import com.dgtly.common.annotation.SwitchEn;
 import com.dgtly.notice.domain.NoticeSupply;
 import java.util.List;
 
@@ -17,6 +18,21 @@ public interface NoticeSupplyMapper
      * @param id 【请填写功能名称】ID
      * @return 【请填写功能名称】
      */
+    @SwitchEn(oldfiles = {
+            "n.supply_title",
+            "n.supply_details",
+            "n.manufacturer",
+            "n.contacts",
+            "n.telephone",
+            "n.picture"
+    },newfiles = {
+            "n.supply_title_en supply_title",
+            "n.supply_details_en supply_details",
+            "n.manufacturer_en manufacturer",
+            "n.contacts_en contacts",
+            "n.telephone_en telephone",
+            "n.picture_en picture"
+    })
     public NoticeSupply selectNoticeSupplyById(Long id);
 
     /**
@@ -25,6 +41,21 @@ public interface NoticeSupplyMapper
      * @param noticeSupply 【请填写功能名称】
      * @return 【请填写功能名称】集合
      */
+    @SwitchEn(oldfiles = {
+            "n.supply_title",
+            "n.supply_details",
+            "n.manufacturer",
+            "n.contacts",
+            "n.telephone",
+            "n.picture"
+    },newfiles = {
+            "n.supply_title_en supply_title",
+            "n.supply_details_en supply_details",
+            "n.manufacturer_en manufacturer",
+            "n.contacts_en contacts",
+            "n.telephone_en telephone",
+            "n.picture_en picture"
+    })
     public List<NoticeSupply> selectNoticeSupplyList(NoticeSupply noticeSupply);
 
     /**
@@ -66,6 +97,11 @@ public interface NoticeSupplyMapper
      * @auther: LiuLingChao
      * @date: 2020-2-25 11:15
      */
+    @SwitchEn(oldfiles = {
+            "supply_title"
+    },newfiles = {
+            "supply_title_en supply_title"
+    })
     public List<NoticeSupply> getSupplyInfoTenList();
 
     /**
@@ -75,6 +111,22 @@ public interface NoticeSupplyMapper
      * @auther: LiuLingChao
      * @date: 2020-3-3 9:15
      */
-
+    @SwitchEn(oldfiles = {
+            "n.supply_title",
+            "n.supply_details",
+            "n.manufacturer",
+            "n.contacts",
+            "t.name",
+            "n.telephone",
+            "n.picture"
+    },newfiles = {
+            "n.supply_title_en supply_title",
+            "n.supply_details_en supply_details",
+            "n.manufacturer_en manufacturer",
+            "n.contacts_en contacts",
+            "t.name_en name",
+            "n.telephone_en telephone",
+            "n.picture_en picture"
+    })
     public List<NoticeSupply> getSupplyInfoAllList(NoticeSupply noticeSupply);
 }

+ 55 - 0
dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/service/impl/NoticeDemandServiceImpl.java

@@ -2,6 +2,8 @@ package com.dgtly.notice.service.impl;
 
 import java.util.List;
 import com.dgtly.common.utils.DateUtils;
+import com.dgtly.common.utils.StringUtils;
+import com.dgtly.common.utils.TranslateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.dgtly.notice.mapper.NoticeDemandMapper;
@@ -54,6 +56,34 @@ public class NoticeDemandServiceImpl implements INoticeDemandService
     @Override
     public int insertNoticeDemand(NoticeDemand noticeDemand)
     {
+        //求购标题
+        String purchaseTitle = noticeDemand.getPurchaseTitle();
+        if (StringUtils.isNotEmpty(purchaseTitle)){
+            noticeDemand.setPurchaseTitleEn(TranslateUtil.getEnTranslateInfo(purchaseTitle));
+        }
+        //需求概要
+        String summaryOfNeeds = noticeDemand.getSummaryOfNeeds();
+        if (StringUtils.isNotEmpty(summaryOfNeeds)){
+            noticeDemand.setSummaryOfNeedsEn(TranslateUtil.getEnTranslateInfo(summaryOfNeeds));
+        }
+        //需求详情
+        String demandDetails = noticeDemand.getDemandDetails();
+        if (StringUtils.isNotEmpty(demandDetails)){
+            noticeDemand.setDemandDetailsEn(TranslateUtil.getEnTranslateInfo(demandDetails));
+        }
+        //联系人
+        String contacts = noticeDemand.getContacts();
+        if (StringUtils.isNotEmpty(contacts)){
+            noticeDemand.setContactsEn(TranslateUtil.getEnTranslateInfo(contacts));
+        }
+        //联系电话
+        String contactNumber = noticeDemand.getContactNumber();
+        if (StringUtils.isNotEmpty(contactNumber)){
+            noticeDemand.setContactNumberEn(TranslateUtil.getEnTranslateInfo(contactNumber));
+        }
+        //发布时间
+        noticeDemand.setReleaseTimeEn(DateUtils.getNowDate());
+        noticeDemand.setReleaseTime(DateUtils.getNowDate());
         noticeDemand.setCreateTime(DateUtils.getNowDate());
         return noticeDemandMapper.insertNoticeDemand(noticeDemand);
     }
@@ -67,6 +97,31 @@ public class NoticeDemandServiceImpl implements INoticeDemandService
     @Override
     public int updateNoticeDemand(NoticeDemand noticeDemand)
     {
+        //求购标题
+        String purchaseTitle = noticeDemand.getPurchaseTitle();
+        if (StringUtils.isNotEmpty(purchaseTitle)){
+            noticeDemand.setPurchaseTitleEn(TranslateUtil.getEnTranslateInfo(purchaseTitle));
+        }
+        //需求概要
+        String summaryOfNeeds = noticeDemand.getSummaryOfNeeds();
+        if (StringUtils.isNotEmpty(summaryOfNeeds)){
+            noticeDemand.setSummaryOfNeedsEn(TranslateUtil.getEnTranslateInfo(summaryOfNeeds));
+        }
+        //需求详情
+        String demandDetails = noticeDemand.getDemandDetails();
+        if (StringUtils.isNotEmpty(demandDetails)){
+            noticeDemand.setDemandDetailsEn(TranslateUtil.getEnTranslateInfo(demandDetails));
+        }
+        //联系人
+        String contacts = noticeDemand.getContacts();
+        if (StringUtils.isNotEmpty(contacts)){
+            noticeDemand.setContactsEn(TranslateUtil.getEnTranslateInfo(contacts));
+        }
+        //联系电话
+        String contactNumber = noticeDemand.getContactNumber();
+        if (StringUtils.isNotEmpty(contactNumber)){
+            noticeDemand.setContactNumberEn(TranslateUtil.getEnTranslateInfo(contactNumber));
+        }
         noticeDemand.setUpdateTime(DateUtils.getNowDate());
         return noticeDemandMapper.updateNoticeDemand(noticeDemand);
     }

+ 63 - 0
dgtly-member/dgtly-member-common/src/main/java/com/dgtly/notice/service/impl/NoticeSupplyServiceImpl.java

@@ -4,6 +4,8 @@ import java.util.List;
 
 import com.dgtly.common.annotation.DataScope;
 import com.dgtly.common.utils.DateUtils;
+import com.dgtly.common.utils.StringUtils;
+import com.dgtly.common.utils.TranslateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.dgtly.notice.mapper.NoticeSupplyMapper;
@@ -57,6 +59,38 @@ public class NoticeSupplyServiceImpl implements INoticeSupplyService
     @Override
     public int insertNoticeSupply(NoticeSupply noticeSupply)
     {
+        //供应标题信息
+        String supplyTitle = noticeSupply.getSupplyTitle();
+        if (StringUtils.isNotEmpty(supplyTitle)){
+            noticeSupply.setSupplyTitleEn(TranslateUtil.getEnTranslateInfo(supplyTitle));
+        }
+        //供应信息详情
+        String supplyDetails = noticeSupply.getSupplyDetails();
+        if (StringUtils.isNotEmpty(supplyDetails)){
+            noticeSupply.setSupplyDetailsEn(TranslateUtil.getEnTranslateInfo(supplyDetails));
+        }
+        //生产厂家
+        String manufacturer = noticeSupply.getManufacturer();
+        if (StringUtils.isNotEmpty(manufacturer)){
+            noticeSupply.setManufacturerEn(TranslateUtil.getEnTranslateInfo(manufacturer));
+        }
+        //联系人
+        String contacts = noticeSupply.getContacts();
+        if (StringUtils.isNotEmpty(contacts)){
+            noticeSupply.setContactsEn(TranslateUtil.getEnTranslateInfo(contacts));
+        }
+        //联系电话
+        String telephone = noticeSupply.getTelephone();
+        if (StringUtils.isNotEmpty(telephone)){
+            noticeSupply.setTelephoneEn(TranslateUtil.getEnTranslateInfo(telephone));
+        }
+        //图片
+
+            noticeSupply.setPictureEn(noticeSupply.getPicture());
+
+        //发布时间
+        noticeSupply.setReleaseTime(DateUtils.getNowDate());
+        noticeSupply.setReleaseTimeEn(DateUtils.getNowDate());
         noticeSupply.setCreateTime(DateUtils.getNowDate());
         return noticeSupplyMapper.insertNoticeSupply(noticeSupply);
     }
@@ -70,6 +104,35 @@ public class NoticeSupplyServiceImpl implements INoticeSupplyService
     @Override
     public int updateNoticeSupply(NoticeSupply noticeSupply)
     {
+        //供应标题信息
+        String supplyTitle = noticeSupply.getSupplyTitle();
+        if (StringUtils.isNotEmpty(supplyTitle)){
+            noticeSupply.setSupplyDetailsEn(TranslateUtil.getEnTranslateInfo(supplyTitle));
+        }
+        //供应信息详情
+        String supplyDetails = noticeSupply.getSupplyDetails();
+        if (StringUtils.isNotEmpty(supplyDetails)){
+            noticeSupply.setSupplyDetailsEn(TranslateUtil.getEnTranslateInfo(supplyDetails));
+        }
+        //生产厂家
+        String manufacturer = noticeSupply.getManufacturer();
+        if (StringUtils.isNotEmpty(manufacturer)){
+            noticeSupply.setManufacturerEn(TranslateUtil.getEnTranslateInfo(manufacturer));
+        }
+        //联系人
+        String contacts = noticeSupply.getContacts();
+        if (StringUtils.isNotEmpty(contacts)){
+            noticeSupply.setContactsEn(TranslateUtil.getEnTranslateInfo(contacts));
+        }
+        //联系电话
+        String telephone = noticeSupply.getTelephone();
+        if (StringUtils.isNotEmpty(telephone)){
+            noticeSupply.setTelephoneEn(TranslateUtil.getEnTranslateInfo(telephone));
+        }
+        //图片
+
+            noticeSupply.setPictureEn(noticeSupply.getPicture());
+
         noticeSupply.setUpdateTime(DateUtils.getNowDate());
         return noticeSupplyMapper.updateNoticeSupply(noticeSupply);
     }

+ 26 - 8
dgtly-member/dgtly-member-common/src/main/resources/mapper/notice/NoticeDemandMapper.xml

@@ -23,19 +23,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectNoticeDemandVo">
-        select id, member_id, purchase_title, summary_of_needs, demand_details, contacts, contact_number, release_time, status, create_by, create_time, update_by, update_time, del_flag, remark from notice_demand
+        select id, member_id, purchase_title,purchase_title_en, summary_of_needs,summary_of_needs_en, demand_details,demand_details_en, contacts,contacts_en, contact_number,contact_number_en, release_time,release_time_en, status, create_by, create_time, update_by, update_time, del_flag, remark from notice_demand
     </sql>
 
     <select id="selectNoticeDemandList" parameterType="NoticeDemand" resultMap="NoticeDemandResult">
         <include refid="selectNoticeDemandVo"/>
         <where>  
             <if test="memberId != null "> and member_id = #{memberId}</if>
-            <if test="purchaseTitle != null  and purchaseTitle != ''"> and purchase_title = #{purchaseTitle}</if>
-            <if test="summaryOfNeeds != null  and summaryOfNeeds != ''"> and summary_of_needs = #{summaryOfNeeds}</if>
-            <if test="demandDetails != null  and demandDetails != ''"> and demand_details = #{demandDetails}</if>
-            <if test="contacts != null  and contacts != ''"> and contacts = #{contacts}</if>
-            <if test="contactNumber != null  and contactNumber != ''"> and contact_number = #{contactNumber}</if>
-            <if test="releaseTime != null "> and release_time = #{releaseTime}</if>
+            <if test="purchaseTitle != null  and purchaseTitle != ''"> and purchase_title = #{purchaseTitle} or purchase_title_en = #{purchaseTitle}</if>
+            <if test="summaryOfNeeds != null  and summaryOfNeeds != ''"> and summary_of_needs = #{summaryOfNeeds} or summary_of_needs_en = #{summaryOfNeeds}</if>
+            <if test="demandDetails != null  and demandDetails != ''"> and demand_details = #{demandDetails} or demand_details_en = #{demandDetails}</if>
+            <if test="contacts != null  and contacts != ''"> and contacts = #{contacts} or contacts_en = #{contacts}</if>
+            <if test="contactNumber != null  and contactNumber != ''"> and contact_number = #{contactNumber} or contact_number_en = #{contactNumber}</if>
+            <if test="releaseTime != null "> and release_time = #{releaseTime} or release_time_en = #{releaseTime}</if>
             <if test="status != null  and status != ''"> and status = #{status}</if>
         </where>
     </select>
@@ -50,11 +50,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="memberId != null ">member_id,</if>
             <if test="purchaseTitle != null  and purchaseTitle != ''">purchase_title,</if>
+            <if test="purchaseTitleEn != null  and purchaseTitleEn != ''">purchase_title_en,</if>
             <if test="summaryOfNeeds != null  and summaryOfNeeds != ''">summary_of_needs,</if>
+            <if test="summaryOfNeedsEn != null  and summaryOfNeedsEn != ''">summary_of_needs_en,</if>
             <if test="demandDetails != null  and demandDetails != ''">demand_details,</if>
+            <if test="demandDetailsEn != null  and demandDetailsEn != ''">demand_details_en,</if>
             <if test="contacts != null  and contacts != ''">contacts,</if>
+            <if test="contactsEn != null  and contactsEn != ''">contacts_en,</if>
             <if test="contactNumber != null  and contactNumber != ''">contact_number,</if>
+            <if test="contactNumberEn != null  and contactNumberEn != ''">contact_number_en,</if>
             <if test="releaseTime != null ">release_time,</if>
+            <if test="releaseTimeEn != null ">release_time_en,</if>
             <if test="status != null  and status != ''">status,</if>
             <if test="createBy != null  and createBy != ''">create_by,</if>
             <if test="createTime != null ">create_time,</if>
@@ -66,11 +72,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="memberId != null ">#{memberId},</if>
             <if test="purchaseTitle != null  and purchaseTitle != ''">#{purchaseTitle},</if>
+            <if test="purchaseTitleEn != null  and purchaseTitleEn != ''">#{purchaseTitleEn},</if>
             <if test="summaryOfNeeds != null  and summaryOfNeeds != ''">#{summaryOfNeeds},</if>
+            <if test="summaryOfNeedsEn != null  and summaryOfNeedsEn != ''">#{summaryOfNeedsEn},</if>
             <if test="demandDetails != null  and demandDetails != ''">#{demandDetails},</if>
+            <if test="demandDetailsEn != null  and demandDetailsEn != ''">#{demandDetailsEn},</if>
             <if test="contacts != null  and contacts != ''">#{contacts},</if>
+            <if test="contactsEn != null  and contactsEn != ''">#{contactsEn},</if>
             <if test="contactNumber != null  and contactNumber != ''">#{contactNumber},</if>
+            <if test="contactNumberEn != null  and contactNumberEn != ''">#{contactNumberEn},</if>
             <if test="releaseTime != null ">#{releaseTime},</if>
+            <if test="releaseTimeEn != null ">#{releaseTimeEn},</if>
             <if test="status != null  and status != ''">#{status},</if>
             <if test="createBy != null  and createBy != ''">#{createBy},</if>
             <if test="createTime != null ">#{createTime},</if>
@@ -86,11 +98,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="memberId != null ">member_id = #{memberId},</if>
             <if test="purchaseTitle != null  and purchaseTitle != ''">purchase_title = #{purchaseTitle},</if>
+            <if test="purchaseTitleEn != null  and purchaseTitleEn != ''">purchase_title_en = #{purchaseTitleEn},</if>
             <if test="summaryOfNeeds != null  and summaryOfNeeds != ''">summary_of_needs = #{summaryOfNeeds},</if>
+            <if test="summaryOfNeedsEn != null  and summaryOfNeedsEn != ''">summary_of_needs_en = #{summaryOfNeedsEn},</if>
             <if test="demandDetails != null  and demandDetails != ''">demand_details = #{demandDetails},</if>
+            <if test="demandDetailsEn != null  and demandDetailsEn != ''">demand_details_en = #{demandDetailsEn},</if>
             <if test="contacts != null  and contacts != ''">contacts = #{contacts},</if>
+            <if test="contactsEn != null  and contactsEn != ''">contacts_en = #{contactsEn},</if>
             <if test="contactNumber != null  and contactNumber != ''">contact_number = #{contactNumber},</if>
+            <if test="contactNumberEn != null  and contactNumberEn != ''">contact_number_en = #{contactNumberEn},</if>
             <if test="releaseTime != null ">release_time = #{releaseTime},</if>
+            <if test="releaseTimeEn != null ">release_time_en = #{releaseTimeEn},</if>
             <if test="status != null  and status != ''">status = #{status},</if>
             <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
             <if test="createTime != null ">create_time = #{createTime},</if>
@@ -115,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     
     <select id="getDemandInfoTenList" resultMap="NoticeDemandResult">
-        select id, member_id, purchase_title,release_time from notice_demand
+        select id, member_id, purchase_title,purchase_title_en,release_time,release_time_en from notice_demand
         order by release_time desc limit 0,6
 
     </select>

+ 47 - 9
dgtly-member/dgtly-member-common/src/main/resources/mapper/notice/NoticeSupplyMapper.xml

@@ -34,12 +34,19 @@ SELECT
   t.name,
   n.merchant_id,
   n.supply_title,
+  n.supply_title_en,
   n.supply_details,
+  n.supply_details_en,
   n.manufacturer,
+  n.manufacturer_en,
   n.contacts,
+  n.contacts_en,
   n.telephone,
+  n.telephone_en,
   n.release_time,
+  n.release_time_en,
   n.picture,
+  n.picture_en,
   n.status,
   n.create_by,
   n.create_time,
@@ -59,10 +66,10 @@ FROM
         <where>  
             <if test="typeId != null "> and n.type_id = #{typeId}</if>
             <if test="merchantId != null "> and n.merchant_id = #{merchantId}</if>
-            <if test="supplyTitle != null  and supplyTitle != ''"> and n.supply_title = #{supplyTitle}</if>
-            <if test="manufacturer != null  and manufacturer != ''"> and n.manufacturer = #{manufacturer}</if>
-            <if test="contacts != null  and contacts != ''"> and n.contacts = #{contacts}</if>
-            <if test="telephone != null  and telephone != ''"> and n.telephone = #{telephone}</if>
+            <if test="supplyTitle != null  and supplyTitle != ''"> and n.supply_title = #{supplyTitle} or n.supply_title_en = #{supplyTitle}</if>
+            <if test="manufacturer != null  and manufacturer != ''"> and n.manufacturer = #{manufacturer} or n.manufacturer_en = #{manufacturer}</if>
+            <if test="contacts != null  and contacts != ''"> and n.contacts = #{contacts} or n.contacts_en = #{contacts}</if>
+            <if test="telephone != null  and telephone != ''"> and n.telephone = #{telephone} or n.telephone_en = #{telephone}</if>
             <if test="status != null  and status != ''"> and n.status = #{status}</if>
             ${params.dataScope}
         </where>
@@ -80,12 +87,19 @@ FROM
             <if test="typeId != null ">type_id,</if>
             <if test="merchantId != null ">merchant_id,</if>
             <if test="supplyTitle != null  and supplyTitle != ''">supply_title,</if>
+            <if test="supplyTitleEn != null  and supplyTitleEn != ''">supply_title_en,</if>
             <if test="supplyDetails != null  and supplyDetails != ''">supply_details,</if>
+            <if test="supplyDetailsEn != null  and supplyDetailsEn != ''">supply_details_en,</if>
             <if test="manufacturer != null  and manufacturer != ''">manufacturer,</if>
+            <if test="manufacturerEn != null  and manufacturerEn != ''">manufacturer_en,</if>
             <if test="contacts != null  and contacts != ''">contacts,</if>
+            <if test="contactsEn != null  and contactsEn != ''">contacts_en,</if>
             <if test="telephone != null  and telephone != ''">telephone,</if>
+            <if test="telephoneEn != null  and telephoneEn != ''">telephone_en,</if>
             <if test="releaseTime != null ">release_time,</if>
+            <if test="releaseTimeEn != null ">release_time_en,</if>
             <if test="picture != null  and picture != ''">picture,</if>
+            <if test="pictureEn != null  and pictureEn != ''">picture_en,</if>
             <if test="status != null  and status != ''">status,</if>
             <if test="createBy != null  and createBy != ''">create_by,</if>
             <if test="updateBy != null  and updateBy != ''">update_by,</if>
@@ -97,12 +111,19 @@ FROM
             <if test="typeId != null ">#{typeId},</if>
             <if test="merchantId != null ">#{merchantId},</if>
             <if test="supplyTitle != null  and supplyTitle != ''">#{supplyTitle},</if>
+            <if test="supplyTitleEn != null  and supplyTitleEn != ''">#{supplyTitleEn},</if>
             <if test="supplyDetails != null  and supplyDetails != ''">#{supplyDetails},</if>
+            <if test="supplyDetailsEn != null  and supplyDetailsEn != ''">#{supplyDetailsEn},</if>
             <if test="manufacturer != null  and manufacturer != ''">#{manufacturer},</if>
+            <if test="manufacturerEn != null  and manufacturerEn != ''">#{manufacturerEn},</if>
             <if test="contacts != null  and contacts != ''">#{contacts},</if>
+            <if test="contactsEn != null  and contactsEn != ''">#{contactsEn},</if>
             <if test="telephone != null  and telephone != ''">#{telephone},</if>
+            <if test="telephoneEn != null  and telephoneEn != ''">#{telephoneEn},</if>
             <if test="releaseTime != null ">#{releaseTime},</if>
+            <if test="releaseTimeEn != null ">#{releaseTimeEn},</if>
             <if test="picture != null  and picture != ''">#{picture},</if>
+            <if test="pictureEn != null  and pictureEn != ''">#{pictureEn},</if>
             <if test="status != null  and status != ''">#{status},</if>
             <if test="createBy != null  and createBy != ''">#{createBy},</if>
             <if test="updateBy != null  and updateBy != ''">#{updateBy},</if>
@@ -118,12 +139,19 @@ FROM
             <if test="typeId != null ">type_id = #{typeId},</if>
             <if test="merchantId != null ">merchant_id = #{merchantId},</if>
             <if test="supplyTitle != null  and supplyTitle != ''">supply_title = #{supplyTitle},</if>
+            <if test="supplyTitleEn != null  and supplyTitleEn != ''">supply_title_en = #{supplyTitleEn},</if>
             <if test="supplyDetails != null  and supplyDetails != ''">supply_details = #{supplyDetails},</if>
+            <if test="supplyDetailsEn != null  and supplyDetailsEn != ''">supply_details_en = #{supplyDetailsEn},</if>
             <if test="manufacturer != null  and manufacturer != ''">manufacturer = #{manufacturer},</if>
+            <if test="manufacturerEn != null  and manufacturerEn != ''">manufacturer_en = #{manufacturerEn},</if>
             <if test="contacts != null  and contacts != ''">contacts = #{contacts},</if>
+            <if test="contactsEn != null  and contactsEn != ''">contacts_en = #{contactsEn},</if>
             <if test="telephone != null  and telephone != ''">telephone = #{telephone},</if>
+            <if test="telephoneEn != null  and telephoneEn != ''">telephone_en = #{telephoneEn},</if>
             <if test="releaseTime != null ">release_time = #{releaseTime},</if>
+            <if test="releaseTimeEn != null ">release_time_en = #{releaseTimeEn},</if>
             <if test="picture != null  and picture != ''">picture = #{picture},</if>
+            <if test="pictureEn != null  and pictureEn != ''">picture_en = #{pictureEn},</if>
             <if test="status != null  and status != ''">status = #{status},</if>
             <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
             <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
@@ -150,7 +178,9 @@ FROM
         select id,
         type_id,
         supply_title,
-        release_time
+        supply_title_en,
+        release_time,
+        release_time_en
         from notice_supply
         order by release_time desc limit 0,6
 
@@ -161,14 +191,22 @@ FROM
           n.id,
           n.type_id,
           t.name,
+          t.name_en,
           n.merchant_id,
           n.supply_title,
+          n.supply_title_en,
           n.supply_details,
+          n.supply_details_en,
           n.manufacturer,
+          n.manufacturer_en,
           n.contacts,
+          n.contacts_en,
           n.telephone,
+          n.telephone_en,
           n.release_time,
+          n.release_time_en,
           n.picture,
+          n.picture_en,
           n.status,
           n.create_by,
           n.create_time
@@ -178,10 +216,10 @@ FROM
         <where>
             <if test="typeId != null "> and n.type_id = #{typeId}</if>
             <if test="merchantId != null "> and n.merchant_id = #{merchantId}</if>
-            <if test="supplyTitle != null  and supplyTitle != ''"> and n.supply_title = #{supplyTitle}</if>
-            <if test="manufacturer != null  and manufacturer != ''"> and n.manufacturer = #{manufacturer}</if>
-            <if test="contacts != null  and contacts != ''"> and n.contacts = #{contacts}</if>
-            <if test="telephone != null  and telephone != ''"> and n.telephone = #{telephone}</if>
+            <if test="supplyTitle != null  and supplyTitle != ''"> and n.supply_title = #{supplyTitle} or n.supply_title_en = #{supplyTitle}</if>
+            <if test="manufacturer != null  and manufacturer != ''"> and n.manufacturer = #{manufacturer} or n.manufacturer_en = #{manufacturer}</if>
+            <if test="contacts != null  and contacts != ''"> and n.contacts = #{contacts} or n.contacts_en = #{contacts}</if>
+            <if test="telephone != null  and telephone != ''"> and n.telephone = #{telephone} or n.telephone_en = #{telephone}</if>
             <if test="status != null  and status != ''"> and n.status = #{status}</if>
         </where>
         order by  n.create_time desc

+ 44 - 0
dgtly-system/src/main/java/com/dgtly/system/domain/SysNotice.java

@@ -27,16 +27,27 @@ public class SysNotice extends BaseEntity
     /** 公告概要 */
     private String noticeOutline;
 
+    /** 公告标题英文字段 */
+    private String noticeTitleEn;
+
+    /** 公告概要英文字段 */
+    private String noticeOutlineEn;
+
     /** 公告类型(1通知 2公告) */
     private String noticeType;
 
     /** 公告内容 */
     private String noticeContent;
 
+    /** 公告内容 */
+    private String noticeContentEn;
+
     private String fmzFile;
 
     private String fmzFileUrl;
 
+    private String fmzFileUrlEn;
+
     private String limitFlag;
 
 
@@ -136,6 +147,38 @@ public class SysNotice extends BaseEntity
         this.limitFlag = limitFlag;
     }
 
+    public String getNoticeTitleEn() {
+        return noticeTitleEn;
+    }
+
+    public void setNoticeTitleEn(String noticeTitleEn) {
+        this.noticeTitleEn = noticeTitleEn;
+    }
+
+    public String getNoticeOutlineEn() {
+        return noticeOutlineEn;
+    }
+
+    public void setNoticeOutlineEn(String noticeOutlineEn) {
+        this.noticeOutlineEn = noticeOutlineEn;
+    }
+
+    public String getNoticeContentEn() {
+        return noticeContentEn;
+    }
+
+    public void setNoticeContentEn(String noticeContentEn) {
+        this.noticeContentEn = noticeContentEn;
+    }
+
+    public String getFmzFileUrlEn() {
+        return fmzFileUrlEn;
+    }
+
+    public void setFmzFileUrlEn(String fmzFileUrlEn) {
+        this.fmzFileUrlEn = fmzFileUrlEn;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -152,4 +195,5 @@ public class SysNotice extends BaseEntity
             .append("noticeOutline", getNoticeOutline())
             .toString();
     }
+
 }

+ 46 - 0
dgtly-system/src/main/java/com/dgtly/system/mapper/SysNoticeMapper.java

@@ -1,6 +1,8 @@
 package com.dgtly.system.mapper;
 
 import java.util.List;
+
+import com.dgtly.common.annotation.SwitchEn;
 import com.dgtly.system.domain.SysNotice;
 
 /**
@@ -16,6 +18,17 @@ public interface SysNoticeMapper
      * @param noticeId 公告ID
      * @return 公告信息
      */
+    @SwitchEn(oldfiles = {
+            "fmz_file_url",
+            "notice_title",
+            "notice_outline",
+            "notice_content"
+    },newfiles = {
+            "fmz_file_url_en fmz_file_url",
+            "notice_title_en notice_title",
+            "notice_outline_en notice_outline",
+            "notice_content_en notice_content"
+    })
     public SysNotice selectNoticeById(Long noticeId);
 
     /**
@@ -24,6 +37,17 @@ public interface SysNoticeMapper
      * @param notice 公告信息
      * @return 公告集合
      */
+    @SwitchEn(oldfiles = {
+            "fmz_file_url",
+            "notice_title",
+            "notice_outline",
+            "notice_content"
+    },newfiles = {
+            "fmz_file_url_en fmz_file_url",
+            "notice_title_en notice_title",
+            "notice_outline_en notice_outline",
+            "notice_content_en notice_content"
+    })
     public List<SysNotice> selectNoticeList(SysNotice notice);
 
     /**
@@ -32,6 +56,17 @@ public interface SysNoticeMapper
      * @param notice 公告信息
      * @return 公告集合
      */
+    @SwitchEn(oldfiles = {
+            "sn.fmz_file_url",
+            "sn.notice_title",
+            "sn.notice_outline",
+            "sn.notice_content"
+    },newfiles = {
+            "sn.fmz_file_url_en fmz_file_url",
+            "sn.notice_title_en notice_title",
+            "sn.notice_outline_en notice_outline",
+            "sn.notice_content_en notice_content"
+    })
     public List<SysNotice> selectNoticeListByRole(SysNotice notice);
 
 
@@ -43,6 +78,17 @@ public interface SysNoticeMapper
      * @auther: LiuLingChao
      * @date: 2019-11-04 11:36
      */
+    @SwitchEn(oldfiles = {
+            "fmz_file_url",
+            "notice_title",
+            "notice_outline",
+            "notice_content"
+    },newfiles = {
+            "fmz_file_url_en fmz_file_url",
+            "notice_title_en notice_title",
+            "notice_outline_en notice_outline",
+            "notice_content_en notice_content"
+    })
     public List<SysNotice> selectNoticeTop3ByRole(SysNotice notice);
 
     /**

+ 42 - 0
dgtly-system/src/main/java/com/dgtly/system/service/impl/SysNoticeServiceImpl.java

@@ -3,6 +3,8 @@ package com.dgtly.system.service.impl;
 import java.util.List;
 
 import com.dgtly.common.annotation.DataScope;
+import com.dgtly.common.utils.StringUtils;
+import com.dgtly.common.utils.TranslateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.dgtly.common.core.text.Convert;
@@ -55,6 +57,26 @@ public class SysNoticeServiceImpl implements ISysNoticeService
     @Override
     public int insertNotice(SysNotice notice)
     {
+        //公告标题
+        String noticeTitle = notice.getNoticeTitle();
+        if(StringUtils.isNotEmpty(noticeTitle)) {
+            notice.setNoticeTitleEn(TranslateUtil.getEnTranslateInfo(noticeTitle));
+        }
+        //公告概要
+        String noticeOutline = notice.getNoticeOutline();
+        if (StringUtils.isNotEmpty(noticeOutline)){
+            notice.setNoticeOutlineEn(TranslateUtil.getEnTranslateInfo(noticeOutline));
+        }
+        //公告内容
+        String noticeContent = notice.getNoticeContent();
+        if (StringUtils.isNotEmpty(noticeContent)){
+            notice.setNoticeContentEn(TranslateUtil.getEnTranslateInfo(noticeContent));
+        }
+        //图片
+        String fmzFileUrl = notice.getFmzFileUrl();
+        if (StringUtils.isNotEmpty(fmzFileUrl)){
+            notice.setFmzFileUrlEn(fmzFileUrl);
+        }
         return noticeMapper.insertNotice(notice);
     }
 
@@ -67,6 +89,26 @@ public class SysNoticeServiceImpl implements ISysNoticeService
     @Override
     public int updateNotice(SysNotice notice)
     {
+        //公告标题
+        String noticeTitle = notice.getNoticeTitle();
+        if(StringUtils.isNotEmpty(noticeTitle)) {
+            notice.setNoticeTitleEn(TranslateUtil.getEnTranslateInfo(noticeTitle));
+        }
+        //公告概要
+        String noticeOutline = notice.getNoticeOutline();
+        if (StringUtils.isNotEmpty(noticeOutline)){
+            notice.setNoticeOutlineEn(TranslateUtil.getEnTranslateInfo(noticeOutline));
+        }
+        //公告内容
+        String noticeContent = notice.getNoticeContent();
+        if (StringUtils.isNotEmpty(noticeContent)){
+            notice.setNoticeContentEn(TranslateUtil.getEnTranslateInfo(noticeContent));
+        }
+        //图片
+        String fmzFileUrl = notice.getFmzFileUrl();
+        if (StringUtils.isNotEmpty(fmzFileUrl)){
+            notice.setFmzFileUrlEn(fmzFileUrl);
+        }
         return noticeMapper.updateNotice(notice);
     }
 

+ 20 - 4
dgtly-system/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
     
     <sql id="selectNoticeVo">
-        select notice_id,company_id,notice_title,notice_outline, notice_type, notice_content, status, create_by, fmz_file_url, create_time, update_by, update_time, remark
+        select notice_id,company_id,notice_title,notice_title_en,notice_outline,notice_outline_en, notice_type, notice_content,notice_content_en, status, create_by, fmz_file_url,fmz_file_url_en, create_time, update_by, update_time, remark
 		from sys_notice
     </sql>
 
@@ -29,9 +29,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select sn.notice_id,
         su.company_id,
         sn.notice_title,
+        sn.notice_title_en,
         sn.notice_outline,
+        sn.notice_outline_en,
         sn.notice_type,
         sn.notice_content,
+        sn.notice_content_en,
         sn.status,
         su.user_name create_by,
         sn.create_time,
@@ -39,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         sn.update_time,
         sn.remark,
         sn.fmz_file_url,
+        sn.fmz_file_url_en,
         sn.create_time
 		from sys_notice sn
 		left join sys_user su on su.user_id = sn.create_by
@@ -54,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectNoticeVo"/>
         <where>
 			<if test="noticeTitle != null and noticeTitle != ''">
-				AND notice_title like concat('%', #{noticeTitle}, '%')
+				AND notice_title like concat('%', #{noticeTitle}, '%') or notice_title_en like concat('%', #{noticeTitle}, '%')
 			</if>
             <if test="companyId != null and companyId != 0">
                 AND company_id = #{companyId}
@@ -73,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectNotice"/>
         <where>
             <if test="noticeTitle != null and noticeTitle != ''">
-                AND sn.notice_title like concat('%', #{noticeTitle}, '%')
+                AND sn.notice_title like concat('%', #{noticeTitle}, '%') or sn.notice_title_en like concat('%', #{noticeTitle}, '%')
             </if>
             <if test="companyId != null and companyId != 0">
                 AND sn.company_id = #{companyId}
@@ -94,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectNoticeVo"/>
         <where>
             <if test="noticeTitle != null and noticeTitle != ''">
-                AND notice_title like concat('%', #{noticeTitle}, '%')
+                AND notice_title like concat('%', #{noticeTitle}, '%') or notice_title_en like concat('%', #{noticeTitle}, '%')
             </if>
             <if test="companyId != null and companyId != 0">
                 AND company_id = #{companyId}
@@ -118,24 +122,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into sys_notice (
             <if test="companyId != null and companyId != 0">company_id,</if>
 			<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
+			<if test="noticeTitleEn != null and noticeTitleEn != '' ">notice_title_en, </if>
 			<if test="noticeOutline != null and noticeOutline != '' ">notice_outline, </if>
+			<if test="noticeOutlineEn != null and noticeOutlineEn != '' ">notice_outline_en, </if>
 			<if test="noticeType != null and noticeType != '' ">notice_type, </if>
 			<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
+			<if test="noticeContentEn != null and noticeContentEn != '' ">notice_content_en, </if>
 			<if test="status != null and status != '' ">status, </if>
 			<if test="remark != null and remark != ''">remark,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
             <if test="fmzFileUrl != null and fmzFileUrl != ''">fmz_file_url,</if>
+            <if test="fmzFileUrlEn != null and fmzFileUrlEn != ''">fmz_file_url_en,</if>
  			create_time
  		)values(
             <if test="companyId != null and companyId != 0">#{companyId},</if>
 			<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
+			<if test="noticeTitleEn != null and noticeTitleEn != ''">#{noticeTitleEn}, </if>
 			<if test="noticeOutline != null and noticeOutline != ''">#{noticeOutline}, </if>
+			<if test="noticeOutlineEn != null and noticeOutlineEn != ''">#{noticeOutlineEn}, </if>
 			<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
 			<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
+			<if test="noticeContentEn != null and noticeContentEn != ''">#{noticeContentEn}, </if>
 			<if test="status != null and status != ''">#{status}, </if>
 			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
             <if test="fmzFileUrl != null and fmzFileUrl != ''">#{fmzFileUrl},</if>
+            <if test="fmzFileUrlEn != null and fmzFileUrlEn != ''">#{fmzFileUrlEn},</if>
              sysdate()
 		)
     </insert>
@@ -144,11 +156,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update sys_notice 
         <set>
             <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
+            <if test="noticeTitleEn != null and noticeTitleEn != ''">notice_title_en = #{noticeTitleEn}, </if>
             <if test="noticeOutline != null and noticeOutline != ''">notice_outline = #{noticeOutline}, </if>
+            <if test="noticeOutlineEn != null and noticeOutlineEn != ''">notice_outline_en = #{noticeOutlineEn}, </if>
             <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
             <if test="noticeContent != null">notice_content = #{noticeContent}, </if>
+            <if test="noticeContentEn != null">notice_content_en = #{noticeContentEn}, </if>
             <if test="status != null and status != ''">status = #{status}, </if>
             <if test="fmzFileUrl != null and fmzFileUrl != ''">fmz_file_url = #{fmzFileUrl}, </if>
+            <if test="fmzFileUrlEn != null and fmzFileUrlEn != ''">fmz_file_url_en = #{fmzFileUrlEn}, </if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()
         </set>