Commit 2be6f787 authored by redragon's avatar redragon
Browse files

0.5.1

parent 9ed70e10
Showing with 46 additions and 15 deletions
+46 -15
......@@ -26,11 +26,6 @@
<artifactId>erp-dataset</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>redragon</groupId>
<artifactId>erp-springboot</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>redragon</groupId>
<artifactId>erp-hr</artifactId>
......
......@@ -29,11 +29,11 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import com.framework.controller.ControllerSupport;
import com.framework.dao.data.GlobalDataBox;
import com.framework.dao.model.Pages;
import com.framework.util.JsonResultUtil;
import com.framework.util.JsonUtil;
import com.framework.util.ShiroUtil;
import com.springboot.dao.data.GlobalDataBox;
import com.erp.dataset.service.DatasetCommonService;
import com.erp.hr.dao.model.HrStaffInfoRO;
import com.erp.hr.service.HrCommonService;
......@@ -89,7 +89,7 @@ public class PoHeadWebController extends ControllerSupport{
}
//分页查询数据
List<PoHead> poHeadList = this.poHeadService.getDataObjects(pages, poHeadCO);
List<PoHead> poHeadList = this.poHeadService.getDataObjectsForDataAuth("", pages, poHeadCO);
//采购订单类型
Map poTypeMap = this.datasetCommonService.getPOType();
......@@ -240,7 +240,6 @@ public class PoHeadWebController extends ControllerSupport{
if(poHead.getStatus().equals("NEW")) {
//删除数据
this.poHeadService.deleteDataObject(poHead);
this.poLineService.deletetPoLineByPoHeadCode(poHead.getPoHeadCode());
//提示信息
attr.addFlashAttribute("hint", "success");
......
......@@ -122,9 +122,24 @@ public class PoHeadDaoImpl implements PoHeadDao{
}
@Override
@Permissions(PermissionType.OWN)
@Permissions(PermissionType.DATA_AUTH)
public List<PoHead> getDataObjectsForDataAuth(@SqlParam String dataAuthSQL, Pages pages, PoHeadCO paramObj) {
return null;
String sql = "select p.* from po_head p where 1=1";
Map<String, Object> args = new HashMap<String, Object>();
sql = sql + DaoUtil.getSQLCondition(paramObj, "poHeadCode", "and p.", args);
sql = sql + DaoUtil.getSQLCondition(paramObj, "poType", "and p.", args);
sql = sql + DaoUtil.getSQLCondition(paramObj, "poName", "and p.", args);
sql = sql + DaoUtil.getSQLCondition(paramObj, "vendorCode", "and p.", args);
sql = sql + DaoUtil.getSQLCondition(paramObj, "projectCode", "and p.", args);
sql = sql + DaoUtil.getSQLCondition(paramObj, "status", "and p.", args);
sql = sql + DaoUtil.getDataAuthSQL(dataAuthSQL, "p.", "p.");
sql = sql + " order by p.po_head_id desc";
Map<String, Class<?>> entity = new HashMap<String, Class<?>>();
entity.put("p", PoHead.class);
return this.daoSupport.getDataSqlByPage(sql, entity, args, pages);
}
@Override
......
......@@ -29,6 +29,7 @@ import com.erp.order.po.dao.PoHeadDao;
import com.erp.order.po.dao.model.PoHead;
import com.erp.order.po.dao.model.PoHeadCO;
import com.erp.order.po.service.PoHeadService;
import com.erp.order.po.service.PoLineService;
@Service
@Transactional(rollbackFor=Exception.class)
......@@ -37,6 +38,8 @@ public class PoHeadServiceImpl implements PoHeadService {
//注入Dao
@Autowired
private PoHeadDao poHeadDao;
@Autowired
private PoLineService poLineService;
@Override
public void insertDataObject(PoHead obj) {
......@@ -56,6 +59,7 @@ public class PoHeadServiceImpl implements PoHeadService {
@Override
public void deleteDataObject(PoHead obj) {
this.poHeadDao.deleteDataObject(obj);
this.poLineService.deletetPoLineByPoHeadCode(obj.getPoHeadCode());
}
@Override
......
......@@ -29,11 +29,11 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import com.framework.controller.ControllerSupport;
import com.framework.dao.data.GlobalDataBox;
import com.framework.dao.model.Pages;
import com.framework.util.JsonResultUtil;
import com.framework.util.JsonUtil;
import com.framework.util.ShiroUtil;
import com.springboot.dao.data.GlobalDataBox;
import com.erp.dataset.service.DatasetCommonService;
import com.erp.hr.dao.model.HrStaffInfoRO;
import com.erp.hr.service.HrCommonService;
......@@ -90,7 +90,7 @@ public class SoHeadWebController extends ControllerSupport{
}
//分页查询数据
List<SoHead> soHeadList = this.soHeadService.getDataObjects(pages, soHeadCO);
List<SoHead> soHeadList = this.soHeadService.getDataObjectsForDataAuth("", pages, soHeadCO);
//采购销售类型
Map soTypeMap = this.datasetCommonService.getSOType();
......@@ -241,7 +241,6 @@ public class SoHeadWebController extends ControllerSupport{
if(soHead.getStatus().equals("NEW")) {
//删除数据
this.soHeadService.deleteDataObject(soHead);
this.soLineService.deletetSoLineBySoHeadCode(soHead.getSoHeadCode());
//提示信息
attr.addFlashAttribute("hint", "success");
......
......@@ -123,9 +123,24 @@ public class SoHeadDaoImpl implements SoHeadDao{
}
@Override
@Permissions(PermissionType.OWN)
@Permissions(PermissionType.DATA_AUTH)
public List<SoHead> getDataObjectsForDataAuth(@SqlParam String dataAuthSQL, Pages pages, SoHeadCO paramObj) {
return null;
String sql = "select s.* from so_head s where 1=1";
Map<String, Object> args = new HashMap<String, Object>();
sql = sql + DaoUtil.getSQLCondition(paramObj, "soHeadCode", "and s.", args);
sql = sql + DaoUtil.getSQLCondition(paramObj, "soType", "and s.", args);
sql = sql + DaoUtil.getSQLCondition(paramObj, "soName", "and s.", args);
sql = sql + DaoUtil.getSQLCondition(paramObj, "customerCode", "and s.", args);
sql = sql + DaoUtil.getSQLCondition(paramObj, "projectCode", "and s.", args);
sql = sql + DaoUtil.getSQLCondition(paramObj, "status", "and s.", args);
sql = sql + DaoUtil.getDataAuthSQL(dataAuthSQL, "s.", "s.");
sql = sql + " order by s.so_head_id desc";
Map<String, Class<?>> entity = new HashMap<String, Class<?>>();
entity.put("s", SoHead.class);
return this.daoSupport.getDataSqlByPage(sql, entity, args, pages);
}
@Override
......
......@@ -29,6 +29,7 @@ import com.erp.order.so.dao.SoHeadDao;
import com.erp.order.so.dao.model.SoHead;
import com.erp.order.so.dao.model.SoHeadCO;
import com.erp.order.so.service.SoHeadService;
import com.erp.order.so.service.SoLineService;
@Service
@Transactional(rollbackFor=Exception.class)
......@@ -37,6 +38,8 @@ public class SoHeadServiceImpl implements SoHeadService {
//注入Dao
@Autowired
private SoHeadDao soHeadDao;
@Autowired
private SoLineService soLineService;
@Override
public void insertDataObject(SoHead obj) {
......@@ -56,6 +59,7 @@ public class SoHeadServiceImpl implements SoHeadService {
@Override
public void deleteDataObject(SoHead obj) {
this.soHeadDao.deleteDataObject(obj);
this.soLineService.deletetSoLineBySoHeadCode(obj.getSoHeadCode());
}
@Override
......
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment