8 changed files with 950 additions and 0 deletions
-
124.idea/uiDesigner.xml
-
173src/main/java/com/spring/modules/base/controller/BaseController.java
-
165src/main/java/com/spring/modules/base/dao/BaseMapper.java
-
140src/main/java/com/spring/modules/base/entity/CompanyData.java
-
82src/main/java/com/spring/modules/base/service/BaseService.java
-
133src/main/java/com/spring/modules/base/service/Impl/BaseServiceImpl.java
-
133src/main/resources/mapper/base/BaseMapper.xml
-
BINtarget/classes/com/spring/common/aop/RepeatSubmitAspect.class
@ -0,0 +1,124 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="Palette2"> |
||||
|
<group name="Swing"> |
||||
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> |
||||
|
</item> |
||||
|
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> |
||||
|
<initial-values> |
||||
|
<property name="text" value="Button" /> |
||||
|
</initial-values> |
||||
|
</item> |
||||
|
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
||||
|
<initial-values> |
||||
|
<property name="text" value="RadioButton" /> |
||||
|
</initial-values> |
||||
|
</item> |
||||
|
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
||||
|
<initial-values> |
||||
|
<property name="text" value="CheckBox" /> |
||||
|
</initial-values> |
||||
|
</item> |
||||
|
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> |
||||
|
<initial-values> |
||||
|
<property name="text" value="Label" /> |
||||
|
</initial-values> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||
|
<preferred-size width="150" height="-1" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||
|
<preferred-size width="150" height="-1" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
||||
|
<preferred-size width="150" height="-1" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
||||
|
<preferred-size width="150" height="50" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
||||
|
<preferred-size width="200" height="200" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
||||
|
<preferred-size width="200" height="200" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> |
||||
|
<preferred-size width="-1" height="20" /> |
||||
|
</default-constraints> |
||||
|
</item> |
||||
|
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> |
||||
|
</item> |
||||
|
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
||||
|
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> |
||||
|
</item> |
||||
|
</group> |
||||
|
</component> |
||||
|
</project> |
||||
@ -0,0 +1,173 @@ |
|||||
|
package com.spring.modules.base.controller; |
||||
|
|
||||
|
import com.spring.modules.base.entity.CompanyData; |
||||
|
import com.spring.modules.base.entity.*; |
||||
|
import com.spring.modules.base.service.BaseService; |
||||
|
import com.spring.modules.base.utils.ResponseData; |
||||
|
import com.spring.modules.sys.controller.AbstractController; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author rq |
||||
|
* @ClassName: BaseController |
||||
|
* @Description: 基础功能controller |
||||
|
* @date 2021年9月25日 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping(value = "/base") |
||||
|
public class BaseController extends AbstractController { |
||||
|
@Autowired |
||||
|
private BaseService baseService; |
||||
|
|
||||
|
|
||||
|
|
||||
|
//----------工厂信息-------------------------- |
||||
|
|
||||
|
/** |
||||
|
* 获取工厂日历 |
||||
|
* |
||||
|
* @param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping(value = "/getSiteData") |
||||
|
@ResponseBody |
||||
|
public Object getSiteData(@RequestBody SiteData inData) { |
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
try { |
||||
|
List<SiteData> result = baseService.getSiteData(inData); |
||||
|
map.put("success", true); |
||||
|
map.put("rows", result); |
||||
|
map.put("total", result.size()); |
||||
|
} catch (Exception e) { |
||||
|
map.put("success", false); |
||||
|
map.put("msg", e.getMessage()); |
||||
|
} |
||||
|
return map; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取会计企业 |
||||
|
* |
||||
|
* @param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping(value = "/getCompanyData") |
||||
|
@ResponseBody |
||||
|
public Object getCompanyData() { |
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
try { |
||||
|
List<CompanyData> result = baseService.getCompanyData(); |
||||
|
map.put("success", true); |
||||
|
map.put("rows", result); |
||||
|
map.put("total", result.size()); |
||||
|
} catch (Exception e) { |
||||
|
map.put("success", false); |
||||
|
map.put("msg", e.getMessage()); |
||||
|
} |
||||
|
return map; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @return {@link Object} |
||||
|
* @Title siteSave |
||||
|
* @Description 保存工厂 |
||||
|
* @author rq |
||||
|
* @date 2021/4/16 11:56 |
||||
|
*/ |
||||
|
|
||||
|
@PostMapping("/siteSave") |
||||
|
@ResponseBody |
||||
|
public Object siteSave(@RequestBody SiteData inData) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
try { |
||||
|
responseData = baseService.siteSave(inData); |
||||
|
} catch (Exception e) { |
||||
|
responseData.setMsg(e.getMessage()); |
||||
|
responseData.setCode("500"); |
||||
|
} |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//=============会计单位信息=================== |
||||
|
|
||||
|
/** |
||||
|
* 获取生产订单类型 |
||||
|
* |
||||
|
* @param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping(value = "/getCompanyInformation") |
||||
|
@ResponseBody |
||||
|
public Object getCompanyInformation(@RequestBody CompanyData indata) { |
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
try { |
||||
|
List<CompanyData> result = baseService.getCompanyInformation(indata); |
||||
|
map.put("success", true); |
||||
|
map.put("rows", result); |
||||
|
map.put("total", result.size()); |
||||
|
} catch (Exception e) { |
||||
|
map.put("success", false); |
||||
|
map.put("msg", e.getMessage()); |
||||
|
} |
||||
|
return map; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @return {@link Object} |
||||
|
* @Title saveShopOrderFamily |
||||
|
* @Description 保存修改生产订单类型 |
||||
|
* @author rq |
||||
|
* @date 2021/4/16 11:56 |
||||
|
*/ |
||||
|
|
||||
|
@PostMapping("/saveCompanyInformation") |
||||
|
@ResponseBody |
||||
|
public Object saveCompanyInformation(@RequestBody CompanyData inData) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
try { |
||||
|
responseData = baseService.saveCompanyInformation(inData); |
||||
|
} catch (Exception e) { |
||||
|
responseData.setMsg(e.getMessage()); |
||||
|
responseData.setCode("500"); |
||||
|
} |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @return {@link Object} |
||||
|
* @Title deleteShopOrderFamily |
||||
|
* @Description 删除生产订单类型 |
||||
|
* @author rq |
||||
|
* @date 2021/4/16 11:56 |
||||
|
*/ |
||||
|
|
||||
|
@PostMapping("/deleteCompanyInformation") |
||||
|
@ResponseBody |
||||
|
public Object deleteCompanyInformation(@RequestBody CompanyData inData) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
try { |
||||
|
responseData = baseService.deleteCompanyInformation(inData); |
||||
|
} catch (Exception e) { |
||||
|
responseData.setMsg(e.getMessage()); |
||||
|
responseData.setCode("500"); |
||||
|
} |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,165 @@ |
|||||
|
package com.spring.modules.base.dao; |
||||
|
|
||||
|
|
||||
|
import com.spring.modules.base.entity.AccessSiteData; |
||||
|
import com.spring.modules.base.entity.CompanyData; |
||||
|
import com.spring.modules.base.entity.SiteData; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author rq |
||||
|
* @ClassName: BaseMapper |
||||
|
* @Description: 工艺的dao |
||||
|
* @date 2021年9月25日 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
@Repository |
||||
|
public interface BaseMapper { |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param |
||||
|
* @return List<SiteData> |
||||
|
* @Description 获得工厂信息 |
||||
|
* @Title getSiteData |
||||
|
* @author rq |
||||
|
* @date 2021/10/9 14:27 |
||||
|
* @throw |
||||
|
*/ |
||||
|
List<SiteData> getSiteData(SiteData inData); |
||||
|
|
||||
|
/** |
||||
|
* @param |
||||
|
* @return List<CompanyData> |
||||
|
* @Description 获取会计企业 |
||||
|
* @Title getCompanyData |
||||
|
* @author rq |
||||
|
* @date 2021/10/9 16:37 |
||||
|
* @throw |
||||
|
*/ |
||||
|
List<CompanyData> getCompanyData(); |
||||
|
|
||||
|
/** |
||||
|
* @param |
||||
|
* @return List<CompanyData> |
||||
|
* @Description 检查工厂编码 |
||||
|
* @Title checkSiteId |
||||
|
* @author rq |
||||
|
* @date 2021/10/10 16:49 |
||||
|
* @throw |
||||
|
*/ |
||||
|
List<SiteData> checkSiteId(String siteID); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param inData |
||||
|
* @return void |
||||
|
* @Description 保存工厂 |
||||
|
* @Title saveSite |
||||
|
* @author rq |
||||
|
* @date 2021/10/10 16:52 |
||||
|
* @throw |
||||
|
*/ |
||||
|
void saveSite(SiteData inData); |
||||
|
|
||||
|
/** |
||||
|
* @param inData |
||||
|
* @return void |
||||
|
* @Description 修改工厂 |
||||
|
* @Title editSite |
||||
|
* @author rq |
||||
|
* @date 2021/10/10 16:52 |
||||
|
* @throw |
||||
|
*/ |
||||
|
void editSite(SiteData inData); |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @return List<PartFamilyData> |
||||
|
* @Description 检查角色工厂权限 |
||||
|
* @Title checkAccessSite |
||||
|
* @author rq |
||||
|
* @date 2021/10/10 22:05 |
||||
|
* @throw |
||||
|
*/ |
||||
|
List<AccessSiteData> checkAccessSite(@Param("site") String site, @Param("userID") String userID); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param indata |
||||
|
* @return List<CompanyData> |
||||
|
* @Description 查询会计单位信息 |
||||
|
* @Title getCompanyInformation |
||||
|
* @author rq |
||||
|
* @date 2021/10/10 22:05 |
||||
|
* @throw |
||||
|
*/ |
||||
|
List<CompanyData> getCompanyInformation(CompanyData indata); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param indata |
||||
|
* @return List<CompanyData> |
||||
|
* @Description 查询会计单位信息 |
||||
|
* @Title getCompanyInformation |
||||
|
* @author rq |
||||
|
* @date 2021/10/10 22:05 |
||||
|
* @throw |
||||
|
*/ |
||||
|
List<CompanyData> checkCompanyInformation(CompanyData indata); |
||||
|
|
||||
|
/** |
||||
|
* @param |
||||
|
* @Description 保存加工中心 |
||||
|
* @Title saveProductionLineData |
||||
|
* @author rq |
||||
|
* @date 2021/10/9 16:37 |
||||
|
* @throw |
||||
|
*/ |
||||
|
void saveCompanyInformation(CompanyData indata); |
||||
|
|
||||
|
/** |
||||
|
* @param inData |
||||
|
* @return void |
||||
|
* @Description 修改加工中心 |
||||
|
* @Title editProductionLineData |
||||
|
* @author rq |
||||
|
* @date 2021/10/10 16:52 |
||||
|
* @throw |
||||
|
*/ |
||||
|
void editCompanyInformation(CompanyData inData); |
||||
|
|
||||
|
/** |
||||
|
* @param inData |
||||
|
* @return void |
||||
|
* @Description 删除加工中心 |
||||
|
* @Title deleteProductionLineData |
||||
|
* @author rq |
||||
|
* @date 2021/10/10 23:39 |
||||
|
* @throw |
||||
|
*/ |
||||
|
void deleteCompanyInformation(CompanyData inData); |
||||
|
|
||||
|
/** |
||||
|
* @param inData |
||||
|
* @return List<SiteData> |
||||
|
* @Description TODO |
||||
|
* @Title checkCompanyInSite |
||||
|
* @author rq |
||||
|
* @date 2022/1/10 17:10 |
||||
|
* @throw |
||||
|
*/ |
||||
|
List<SiteData> checkCompanyInSite(CompanyData inData); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,140 @@ |
|||||
|
package com.spring.modules.base.entity; |
||||
|
|
||||
|
public class CompanyData { |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String companyID; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String companyName; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String active; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String taxNo; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String bankName; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String bankAccount; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String cutoffDateDb; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String cutoffDate; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer cutoffDateFixDate; |
||||
|
|
||||
|
private Integer add; |
||||
|
private String user; |
||||
|
|
||||
|
public String getCompanyID() { |
||||
|
return companyID; |
||||
|
} |
||||
|
|
||||
|
public void setCompanyID(String companyID) { |
||||
|
this.companyID = companyID; |
||||
|
} |
||||
|
|
||||
|
public String getCompanyName() { |
||||
|
return companyName; |
||||
|
} |
||||
|
|
||||
|
public void setCompanyName(String companyName) { |
||||
|
this.companyName = companyName; |
||||
|
} |
||||
|
|
||||
|
public String getActive() { |
||||
|
return active; |
||||
|
} |
||||
|
|
||||
|
public void setActive(String active) { |
||||
|
this.active = active; |
||||
|
} |
||||
|
|
||||
|
public String getTaxNo() { |
||||
|
return taxNo; |
||||
|
} |
||||
|
|
||||
|
public void setTaxNo(String taxNo) { |
||||
|
this.taxNo = taxNo; |
||||
|
} |
||||
|
|
||||
|
public String getBankName() { |
||||
|
return bankName; |
||||
|
} |
||||
|
|
||||
|
public void setBankName(String bankName) { |
||||
|
this.bankName = bankName; |
||||
|
} |
||||
|
|
||||
|
public String getBankAccount() { |
||||
|
return bankAccount; |
||||
|
} |
||||
|
|
||||
|
public void setBankAccount(String bankAccount) { |
||||
|
this.bankAccount = bankAccount; |
||||
|
} |
||||
|
|
||||
|
public String getCutoffDateDb() { |
||||
|
return cutoffDateDb; |
||||
|
} |
||||
|
|
||||
|
public void setCutoffDateDb(String cutoffDateDb) { |
||||
|
this.cutoffDateDb = cutoffDateDb; |
||||
|
} |
||||
|
|
||||
|
public String getCutoffDate() { |
||||
|
return cutoffDate; |
||||
|
} |
||||
|
|
||||
|
public void setCutoffDate(String cutoffDate) { |
||||
|
this.cutoffDate = cutoffDate; |
||||
|
} |
||||
|
|
||||
|
public Integer getCutoffDateFixDate() { |
||||
|
return cutoffDateFixDate; |
||||
|
} |
||||
|
|
||||
|
public void setCutoffDateFixDate(Integer cutoffDateFixDate) { |
||||
|
this.cutoffDateFixDate = cutoffDateFixDate; |
||||
|
} |
||||
|
|
||||
|
public Integer getAdd() { |
||||
|
return add; |
||||
|
} |
||||
|
|
||||
|
public void setAdd(Integer add) { |
||||
|
this.add = add; |
||||
|
} |
||||
|
|
||||
|
public String getUser() { |
||||
|
return user; |
||||
|
} |
||||
|
|
||||
|
public void setUser(String user) { |
||||
|
this.user = user; |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,82 @@ |
|||||
|
package com.spring.modules.base.service; |
||||
|
|
||||
|
import com.spring.modules.base.entity.CompanyData; |
||||
|
import com.spring.modules.base.entity.*; |
||||
|
import com.spring.modules.base.utils.ResponseData; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface BaseService { |
||||
|
|
||||
|
//----------工厂信息-------------------------- |
||||
|
/** |
||||
|
* @Description 获得工厂信息 |
||||
|
* @Title getSiteData |
||||
|
* @param |
||||
|
* @author rq |
||||
|
* @date 2021/10/9 14:27 |
||||
|
* @return List<SiteData> |
||||
|
* @throw |
||||
|
*/ |
||||
|
List<SiteData> getSiteData(SiteData inData); |
||||
|
/** |
||||
|
* @Description 获取会计企业 |
||||
|
* @Title getCompanyData |
||||
|
* @param |
||||
|
* @author rq |
||||
|
* @date 2021/10/9 16:37 |
||||
|
* @return List<CompanyData> |
||||
|
* @throw |
||||
|
*/ |
||||
|
List<CompanyData> getCompanyData(); |
||||
|
|
||||
|
/** |
||||
|
* @Description 保存修改工厂 |
||||
|
* @Title siteSave |
||||
|
* @param |
||||
|
* @author rq |
||||
|
* @date 2021/10/9 16:37 |
||||
|
* @return List<CompanyData> |
||||
|
* @throw |
||||
|
*/ |
||||
|
ResponseData siteSave(SiteData inData); |
||||
|
|
||||
|
|
||||
|
|
||||
|
//=============会计单位信息=================== |
||||
|
/** |
||||
|
* @Description 获取生产订单类型 |
||||
|
* @Title getCompanyInformation |
||||
|
* @param indata |
||||
|
* @author rq |
||||
|
* @date 2021/10/10 22:05 |
||||
|
* @return List<InspectionDefectCodeData> |
||||
|
* @throw |
||||
|
*/ |
||||
|
List<CompanyData> getCompanyInformation(CompanyData indata); |
||||
|
|
||||
|
/** |
||||
|
* @Description 保存修改生产订单类型 |
||||
|
* @Title saveCompanyInformation |
||||
|
* @param |
||||
|
* @author rq |
||||
|
* @date 2021/10/9 16:37 |
||||
|
* @return |
||||
|
* @throw |
||||
|
*/ |
||||
|
ResponseData saveCompanyInformation(CompanyData inData); |
||||
|
|
||||
|
/** |
||||
|
* @Description 删除生产订单类型 |
||||
|
* @Title deleteCompanyInformation |
||||
|
* @param |
||||
|
* @author rq |
||||
|
* @date 2021/10/9 16:37 |
||||
|
* @return |
||||
|
* @throw |
||||
|
*/ |
||||
|
ResponseData deleteCompanyInformation(CompanyData inData); |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,133 @@ |
|||||
|
package com.spring.modules.base.service.Impl; |
||||
|
|
||||
|
|
||||
|
|
||||
|
import com.spring.common.constant.SysMsgConstant; |
||||
|
|
||||
|
import com.spring.modules.base.dao.BaseMapper; |
||||
|
import com.spring.modules.base.entity.CompanyData; |
||||
|
import com.spring.modules.base.entity.*; |
||||
|
import com.spring.modules.base.service.BaseService; |
||||
|
import com.spring.modules.base.utils.ResponseData; |
||||
|
|
||||
|
import com.spring.modules.sys.service.SysMsgService; |
||||
|
|
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
@Service |
||||
|
public class BaseServiceImpl implements BaseService { |
||||
|
@Autowired |
||||
|
private BaseMapper baseMapper; |
||||
|
|
||||
|
|
||||
|
@Autowired |
||||
|
private SysMsgService sysMsgService; |
||||
|
|
||||
|
|
||||
|
|
||||
|
//----------工厂信息-------------------------- |
||||
|
@Override |
||||
|
public List<SiteData> getSiteData(SiteData inData) { |
||||
|
List<SiteData> result = baseMapper.getSiteData(inData); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<CompanyData> getCompanyData() { |
||||
|
List<CompanyData> result = baseMapper.getCompanyData(); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResponseData siteSave(@RequestBody SiteData inData) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
if (inData.getAdd() == 0) { |
||||
|
List<SiteData> list = baseMapper.checkSiteId(inData.getSiteID()); |
||||
|
if (list.size() != 0) { |
||||
|
responseData.setMsg(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200030)); |
||||
|
responseData.setCode("500"); |
||||
|
return responseData; |
||||
|
} |
||||
|
//新增 |
||||
|
baseMapper.saveSite(inData); |
||||
|
} else { |
||||
|
List<SiteData> list = baseMapper.checkSiteId(inData.getSiteID()); |
||||
|
if (list.size() == 0) { |
||||
|
responseData.setMsg(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200031)); |
||||
|
responseData.setCode("500"); |
||||
|
return responseData; |
||||
|
} |
||||
|
baseMapper.editSite(inData); |
||||
|
} |
||||
|
responseData.setCode("200"); |
||||
|
responseData.setSuccess(true); |
||||
|
responseData.setMsg(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200000)); |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
//=============生产订单类型=================== |
||||
|
@Override |
||||
|
public List<CompanyData> getCompanyInformation(CompanyData indata) { |
||||
|
List<CompanyData> result = baseMapper.getCompanyInformation(indata); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResponseData saveCompanyInformation(CompanyData inData) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
if (inData.getCutoffDate().equals("自然月月底")) { |
||||
|
inData.setCutoffDateDb("E"); |
||||
|
inData.setCutoffDateFixDate(0); |
||||
|
} |
||||
|
if (inData.getCutoffDate().equals("不固定")) { |
||||
|
inData.setCutoffDateDb("V"); |
||||
|
inData.setCutoffDateFixDate(0); |
||||
|
} |
||||
|
if (inData.getCutoffDate().equals("每月固定日")) { |
||||
|
inData.setCutoffDateDb("F"); |
||||
|
} |
||||
|
if (inData.getAdd() == 0) { |
||||
|
List<CompanyData> list2 = baseMapper.checkCompanyInformation(inData); |
||||
|
if (list2.size() != 0) { |
||||
|
responseData.setMsg(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200053)); |
||||
|
responseData.setCode("500"); |
||||
|
return responseData; |
||||
|
} |
||||
|
//新增 |
||||
|
baseMapper.saveCompanyInformation(inData); |
||||
|
} else { |
||||
|
baseMapper.editCompanyInformation(inData); |
||||
|
} |
||||
|
responseData.setCode("200"); |
||||
|
responseData.setSuccess(true); |
||||
|
responseData.setMsg(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200000)); |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResponseData deleteCompanyInformation(CompanyData inData) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
List<SiteData> check = baseMapper.checkCompanyInSite(inData); |
||||
|
if (check.size() > 0) { |
||||
|
responseData.setMsg(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200054)); |
||||
|
responseData.setCode("500"); |
||||
|
return responseData; |
||||
|
} |
||||
|
baseMapper.deleteCompanyInformation(inData); |
||||
|
responseData.setCode("200"); |
||||
|
responseData.setSuccess(true); |
||||
|
responseData.setMsg(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200000)); |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,133 @@ |
|||||
|
<?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="com.spring.modules.base.dao.BaseMapper"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<select id="getSiteData" resultType="com.spring.modules.base.entity.SiteData"> |
||||
|
Select T.* ,C.CompanyName from Site as T left join Company C ON T.CompanyID=C.CompanyID |
||||
|
<where> |
||||
|
<if test="companyID != null and companyID != ''"> |
||||
|
AND T.CompanyID = #{companyID} |
||||
|
</if> |
||||
|
<if test="companyName != null and companyName != ''"> |
||||
|
AND C.CompanyName = #{companyName} |
||||
|
</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="getCompanyData" resultType="com.spring.modules.base.entity.CompanyData"> |
||||
|
Select CompanyID, |
||||
|
CompanyName, |
||||
|
Active, |
||||
|
TaxNo, |
||||
|
BankName, |
||||
|
BankAccount, |
||||
|
CutoffDate_DB, |
||||
|
CutoffDate, |
||||
|
CutoffDate_FixDate |
||||
|
from Company |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
<select id="checkSiteId" resultType="com.spring.modules.base.entity.SiteData"> |
||||
|
select SiteName, SiteID |
||||
|
from Site |
||||
|
where SiteID = #{siteID} |
||||
|
and Active = 'Y' |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<insert id="saveSite" parameterType="com.spring.modules.base.entity.SiteData"> |
||||
|
INSERT INTO Site (SiteID, SiteName, SiteName_E, Address, Address_E, ContactName, PostCode, Email, FaxNo, |
||||
|
PhoneNo, Active, Website, CompanyID, ShipTime, |
||||
|
ReferenceCustomerID) |
||||
|
VALUES (#{siteID}, #{siteName}, #{siteNameE}, #{address}, #{addressE}, #{contactName}, #{postCode}, #{email}, |
||||
|
#{faxNo}, #{phoneNo}, #{active}, |
||||
|
#{website}, #{companyID}, #{shipTime}, #{referenceCustomerID}) |
||||
|
</insert> |
||||
|
|
||||
|
<update id="editSite" parameterType="com.spring.modules.base.entity.SiteData"> |
||||
|
update Site |
||||
|
SET SiteName=#{siteName}, |
||||
|
SiteName_E=#{siteNameE}, |
||||
|
Address=#{address}, |
||||
|
Address_E=#{addressE}, |
||||
|
ContactName=#{contactName}, |
||||
|
PostCode=#{postCode}, |
||||
|
Email=#{email}, |
||||
|
FaxNo=#{faxNo}, |
||||
|
PhoneNo=#{phoneNo}, |
||||
|
Active=#{active}, |
||||
|
Website=#{website}, |
||||
|
CompanyID=#{companyID}, |
||||
|
ShipTime=#{shipTime}, |
||||
|
ReferenceCustomerID=#{referenceCustomerID} |
||||
|
where SiteID = #{siteID} |
||||
|
</update> |
||||
|
|
||||
|
|
||||
|
<select id="checkAccessSite" resultType="com.spring.modules.base.entity.AccessSiteData"> |
||||
|
Select UserID, Site |
||||
|
from AccessSite |
||||
|
where UserID = #{userID} |
||||
|
and Site = #{site} |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
<select id="getCompanyInformation" resultType="com.spring.modules.base.entity.CompanyData"> |
||||
|
Select * from Company |
||||
|
<where> |
||||
|
|
||||
|
<if test="companyID != null and companyID != ''"> |
||||
|
AND companyID LIKE #{companyID} |
||||
|
</if> |
||||
|
<if test="companyName != null and companyName != ''"> |
||||
|
AND companyName LIKE #{companyName} |
||||
|
</if> |
||||
|
|
||||
|
<if test="active != null and active != ''"> |
||||
|
AND Active = #{active} |
||||
|
</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
<select id="checkCompanyInformation" resultType="com.spring.modules.base.entity.CompanyData"> |
||||
|
select companyID, companyName |
||||
|
FROM Company |
||||
|
WHERE companyID = #{companyID} |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
<insert id="saveCompanyInformation" parameterType="com.spring.modules.base.entity.CompanyData"> |
||||
|
INSERT INTO Company (CompanyID, CompanyName, Active, TaxNo, BankName, BankAccount, CutoffDate_DB, CutoffDate, |
||||
|
CutoffDate_FixDate) |
||||
|
values (#{companyID}, #{companyName}, #{active}, #{taxNo}, #{bankName}, #{bankAccount}, #{cutoffDateDb}, |
||||
|
#{cutoffDate}, #{cutoffDateFixDate}) |
||||
|
</insert> |
||||
|
<update id="editCompanyInformation" parameterType="com.spring.modules.base.entity.CompanyData"> |
||||
|
UPDATE Company |
||||
|
SET CompanyName=#{companyName}, |
||||
|
CutoffDate_DB=#{cutoffDateDb}, |
||||
|
Active=#{active}, |
||||
|
TaxNo=#{taxNo}, |
||||
|
BankName=#{bankName}, |
||||
|
BankAccount=#{bankAccount}, |
||||
|
CutoffDate=#{cutoffDate}, |
||||
|
CutoffDate_FixDate=#{cutoffDateFixDate} |
||||
|
where CompanyID = #{companyID} |
||||
|
</update> |
||||
|
<delete id="deleteCompanyInformation" parameterType="com.spring.modules.base.entity.CompanyData"> |
||||
|
delete |
||||
|
from Company |
||||
|
where CompanyID = #{companyID} |
||||
|
</delete> |
||||
|
|
||||
|
|
||||
|
<select id="checkCompanyInSite" resultType="com.spring.modules.base.entity.SiteData"> |
||||
|
Select SiteID |
||||
|
from site |
||||
|
where CompanyID = #{companyID} |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue